資料載入中.....
|
請使用永久網址來引用或連結此文件:
https://nccur.lib.nccu.edu.tw/handle/140.119/159418
|
題名: | 支援 gRPC 微服務的非侵入式分散式交易攔截器模組 An Interceptor Module for Supporting Transparent Distributed Transactions among gRPC-based Microservices |
作者: | 施閔雅 Shih, Min-Ya |
貢獻者: | 廖峻鋒 Liao, Chun-Feng 施閔雅 Shih, Min-Ya |
關鍵詞: | 分散式交易 gRPC 攔截器 微服務 AOP Distributed Transaction Interceptor AOP |
日期: | 2025 |
上傳時間: | 2025-09-01 16:58:20 (UTC+8) |
摘要: | 隨著分散式系統與微服務架構的廣泛應用,橫跨多個服務的分散式交易已成常態,為確保資料正確性與一致性,交易控制機制的重要性日益提升。傳統的二階段提交協定(Two-Phase Commit, 2PC)理論上可確保分散式交易的一致性,然而在實務上,需將交易控制邏輯嵌入各個微服務中,不僅導致交易控制與業務邏輯混合,亦降低系統模組化與可維護性。
目前在企業應用中,對外多以 Web API 進行服務整合,而內部微服務間的溝通則以 gRPC 為主流。針對企業內部微服務通訊需求,本研究提出一套基於 gRPC 的非侵入式分散式交易攔截器架構,將交易控制邏輯封裝為可重用的攔截器模組,有效實現交易控制與業務邏輯的解耦。該架構借鑑切面程式設計導向(Aspect-Oriented Programming, AOP)的核心理念,將分散式交易控制抽象為通用的 gRPC 攔截器,實現橫切關注點與核心業務邏輯的分離。
透過此架構,交易控制邏輯可於執行期間動態插入請求處理流程中,使微服務本身無需感知交易控制即可正常運作,實現交易的透明性與可插拔性。本研究亦設計一系列實驗,從每秒交易量(Transactions Per Second, TPS)、平均延遲(Average Latency)等指標評估本架構之效能表現,並與傳統 2PC 實作進行比較,以驗證本架構在維持資料一致性的同時,能有效兼顧系統效能之可行性與實用性。 With the widespread adoption of distributed systems and microservice architectures, distributed transactions that span multiple services have become the norm. To ensure data correctness and consistency, the importance of transaction control mechanisms is increasingly recognized. Although the traditional Two-Phase Commit (2PC) protocol theoretically ensures consistency in distributed transactions, its practical implementation requires embedding transaction control logic into each microservice. This leads to the intertwining of transaction control and business logic, reducing system modularity and maintainability.
In modern enterprise applications, external service integration is typically achieved through Web APIs, while internal microservice communication predominantly relies on gRPC. To address the needs of internal microservice communication, this study proposes a non-intrusive distributed transaction interceptor framework based on gRPC. The framework encapsulates transaction control logic into reusable interceptor modules, effectively decoupling transaction management from business logic. Inspired by the core principles of Aspect-Oriented Programming (AOP), this architecture abstracts distributed transaction control into a general-purpose gRPC interceptor, achieving a clear separation between cross-cutting concerns and core business logic.
Through this architecture, transaction control logic can be dynamically injected into the request handling process at runtime, allowing microservices to operate normally without being aware of the underlying transaction control. This achieves transparency in transaction management. This study also designs experiments to evaluate the performance of the proposed framework using metrics such as Transactions Per Second (TPS) and Average Latency. The results are compared with traditional 2PC implementations to validate the feasibility and practicality of this approach in maintaining data consistency while achieving efficient system performance. |
參考文獻: | [1] L. Richardson, M. Amundsen, and S. Ruby, RESTful web APIs: services for a changing world. ” O’Reilly Media, Inc.”, 2013. [2] H. Babal, gRPC microservices in Go. Simon and Schuster, 2023. [3] C. Currier, “Protocol buffers”, in Mobile Forensics–The File Format Handbook: Common File Formats and File Systems Used in Mobile Devices, Springer, 2022, pp. 223–260. [4] S. Arora, A. Bhardwaj, A. Kukkar, S. Kaur, et al., “A comparative analysis of com-munication efficiency: Rest vs. grpc in microservice-based ecosystems”, in 2024 International Conference on Emerging Innovations and Advanced Computing (IN- NOCOMP), IEEE, 2024, pp. 621–626. [5] K. Indrasiri and D. Kuruppu, gRPC: up and running: building cloud native appli- cations with Go and Java for Docker and Kubernetes. O’Reilly Media, 2020. [6] H. Garcia-Molina and K. Salem, “Sagas”, ACM Sigmod Record, vol. 16, no. 3, pp. 249–259, 1987. [7] G. Pardon and C. Pautasso, “Atomic distributed transactions: A restful design”, in Proceedings of the 23rd International Conference on World Wide Web, 2014, pp. 943–948. [8] C. Richardson, Microservices patterns: with examples in Java. Simon and Schuster, 2018. [9] Y. Lee and Y. Liu, “Using refactoring to migrate rest applications to grpc”, in Pro-ceedings of the 2022 ACM Southeast Conference, ser. ACMSE ’22, Virtual Event: Association for Computing Machinery, 2022, pp. 219–223, ISBN: 9781450386975.DOI: 10.1145/3476883.3520220. [Online]. Available: https://doi.org/10.1145/3476883.3520220. [10] M. Bolanowski, K. Żak, A. Paszkiewicz, et al., “Eficiency of rest and grpc real-izing communication tasks in microservice-based ecosystems”, in New Trends in Intelligent Software Methodologies, Tools and Techniques. IOS Press, Sep. 2022. [11] E. F. de Souza Soares, R. Melo Thiago, L. G. Azevedo, M. de Bayser, V. Torres da Silva, and R. F. de G. Cerqueira, “Evaluation of server push technologies for scal- able client-server communication”, in 2018 IEEE Symposium on Service-Oriented System Engineering (SOSE), 2018, pp. 1–10. [12] P. A. Bernstein and E. Newcomer, Principles of Transaction Processing, 2nd. Mor-gan Kaufmann Publishers Inc., 2009, ISBN: 1558606238. [13] Y. Wang and L. Yang, “A distributed transaction performance optimization method”, in 2023 5th International Conference on Electronics and Communication, Network and Computer Technology (ECNCT), 2023, pp. 71–75. DOI: 10.1109/ECNCT59757. 2023.10280971. [14] P. Fan, J. Liu, W. Yin, H. Wang, X. Chen, and H. Sun, “2pc*: A distributed trans- action concurrency control protocol of multi-microservice based on cloud comput- ing platform”, Journal of Cloud Computing, vol. 9, no. 1, p. 40, Jul. 2020, ISSN: 2192-113X. DOI: 10.1186/s13677-020-00183-w. [Online]. Available: https: //doi.org/10.1186/s13677-020-00183-w. [15] H. Saissi, M. Serafini, and N. Suri, “Gyro: A modular scale-out layer for single- server dbmss”, in 2019 38th Symposium on Reliable Distributed Systems (SRDS), 2019, pp. 71–7111. |
描述: | 碩士 國立政治大學 資訊科學系 113753119 |
資料來源: | http://thesis.lib.nccu.edu.tw/record/#G0113753119 |
資料類型: | thesis |
顯示於類別: | [資訊科學系] 學位論文
|
文件中的檔案:
檔案 |
描述 |
大小 | 格式 | 瀏覽次數 |
311901.pdf | | 3155Kb | Adobe PDF | 0 | 檢視/開啟 |
|
在政大典藏中所有的資料項目都受到原著作權保護.
|