[论文解读] Microservice Architecture Practices and Experience: a Focused Look on Docker Configuration Files
本文通过对29个开源GitHub项目的Mining Software Repositories(MSR)研究,分析Docker配置文件(Dockerfiles和docker-compose文件),揭示了当前微服务架构的实践情况。研究发现,尽管小型独立服务较为普遍,但多语言编程较为罕见,而API网关和服务注册表等工具则被广泛采用,凸显了实际开发中与既定微服务原则之间的差距。
Cloud applications are more and more microservice-oriented, but a concrete charting of the microservices architecture landscape -- namely, the space of technical options available for microservice software architects in their decision-making -- is still very much lacking, thereby limiting the ability of software architects to properly evaluate their architectural decisions with sound experiential devices and/or practical design principles. On the one hand, Microservices are fine-grained, loosely coupled services that communicate through lightweight protocols. On the other hand, each microservice can use a different software stack, be deployed and scaled independently or even executed in different containers, which provide isolation and a wide-range of configuration options but also offer unforeseeable architectural interactions and under-explored architecture smells, with such experience captured mainly in software repositories where such solutions are cycled. This paper adopts a mining software repositories (MSR) approach to capture the practice within the microservice architecture landscape, by eliciting and analysing Docker configuration files, being Docker the leading technical device to design for, and implement modern microservices. Our analysis of Docker-based microservices gives an interesting summary of the current state of microservices practice and experience. Conversely, observing that all our datapoints have their own shape and characteristics, we conclude that further comparative assessment with industrial systems is needed to better address the recurring positive principles and patterns around microservices.
研究动机与目标
- 通过分析来自开源代码库的实际Docker配置文件,映射当前微服务架构的实践方法。
- 识别基于微服务的系统中Dockerfile和docker-compose文件使用中的常见模式与反模式。
- 评估既定微服务原则(如服务独立性和最小耦合)在实际开发实践中的体现程度。
- 突出理论微服务设计原则与生产环境中的实际实现模式之间的差异。
- 通过从真实代码库中提取的数据,为软件架构师提供基于实证、经验驱动的设计指导。
提出的方法
- 在包含Docker配置文件(Dockerfiles和docker-compose.yml)的GitHub代码库上开展MSR研究。
- 使用半自动化的数据处理流程,筛选并选取29个具有相关Docker配置文件的开源微服务项目。
- 收集并分析Dockerfiles,以理解服务构建与配置实践。
- 分析docker-compose文件,以研究服务组合、服务间通信及部署拓扑结构。
- 识别并分类配置文件中使用的工具与模式(例如API网关、服务注册表、监控系统)。
- 将研究发现与既定的微服务原则及相关工作进行对比,识别实践中的差距。
实验结果
研究问题
- RQ1在实际的Docker配置文件中,知名微服务原则(如细粒度、松散耦合的服务)的体现程度如何?
- RQ2从Docker配置文件的证据来看,微服务项目中使用多种编程语言和软件栈的普遍程度如何?
- RQ3哪些架构组件(如API网关、服务注册表、消息总线)被最广泛使用,以及它们如何被配置?
- RQ4Dockerfile和docker-compose文件中的配置模式如何反映微服务系统中的实际部署与通信策略?
- RQ5在实际的微服务配置中,最常见的反模式或最佳实践偏离行为是什么?
主要发现
- 所分析的平均微服务项目规模较小,大多数项目每个服务包含的业务功能少于三个,支持了细粒度服务的原则。
- 尽管理论上支持多语言编程,但在所分析的代码库中,同一微服务项目内使用多种编程语言的情况几乎可以忽略不计。
- API网关、服务注册表和消息总线被广泛使用,表明支持服务发现和解耦通信的模式得到了充分采纳。
- 监控系统经常被包含在配置中,表明在生产级微服务部署中对可观测性的高度重视。
- 分析表明,尽管部分最佳实践已被广泛采纳,但其他实践(如真正的服务独立性)却应用不一致,提示可能存在架构风险。
- 本研究指出,有必要进一步与工业级、闭源系统进行对比分析,以验证并推广所观察到的模式。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。