arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.01302cs.SE
收藏

通过 API 处理微服务间的通信

Handling Communication via APIs for Microservices

Vini Kanvar, Ridhi Jain, Srikanth Tamilselvam

AI总结:

本文提出通过 API 传递 ID 替代 JSON 以解决微服务通信依赖问题,设计算法构建子图并重构代码以减少 API 数量,在五个 Java 应用中验证了其在时间和内存复杂度上优于 JSON,并减少 40-60% 手动重构工作。

摘要:

企业在向云端迁移的过程中,希望将单体应用分解为微服务,以最大化云的收益。当前的研究主要集中在如何将单体应用划分为在耦合度、内聚性等标准指标上表现良好的较小集群。然而,对于如何获取这些划分,识别微服务之间的依赖关系,探索进一步减少依赖的方法,以及在不修改应用行为的前提下进行适当的代码更改以实现稳健通信,目前的研究甚少。在这项工作中,我们讨论了使用 JSON 进行通信的传统技术所面临的挑战,并提出了一种通过 API 传递 ID 的替代方法。我们还设计了一种算法来减少 API 的数量。为此,我们在每个类中构建了方法及其关联变量的子图,并将它们重新定位到与其功能更对齐的微服务中。我们对五个公开的 Java 应用进行的定量和定性研究清楚地表明,我们使用 ID 重构的微服务在时间和内存复杂度上明显优于 JSON。我们的自动化技术减少了 40-60% 的手动重构工作。

英文摘要:

Enterprises in their journey to the cloud, want to decompose their monolith applications into microservices to maximize cloud benefits. Current research focuses a lot on how to partition the monolith into smaller clusters that perform well across standard metrics like coupling, cohesion, etc. However, there is little research done on taking the partitions, identifying their dependencies between the microservices, exploring ways to further reduce the dependencies, and making appropriate code changes to enable robust communication without modifying the application behaviour. In this work, we discuss the challenges with the conventional techniques of communication using JSON and propose an alternative way of ID-passing via APIs. We also devise an algorithm to reduce the number of APIs. For this, we construct subgraphs of methods and their associated variables in each class and relocate them to their more functionally aligned microservices. Our quantitative and qualitative studies on five public Java applications clearly demonstrate that our refactored microservices using ID have decidedly better time and memory complexities than JSON. Our automation reduces 40-60\% of the manual refactoring efforts.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑