Skip to main content
QUICK REVIEW

[论文解读] A comparison between traditional and Serverless technologies in a microservices setting

Juan Mera Menéndez, José Emilio Labra Gayo|arXiv (Cornell University)|May 23, 2023
Software System Performance and Reliability被引用 7
一句话总结

本文评估了将基于微服务的电子商务应用从传统 Kubernetes 迁移到无服务器架构(使用 AWS)时的性能与成本权衡,对比了结合 AWS Lambda、ECS Fargate 和数据库选项(DynamoDB 与 DocumentDB)的九种配置。研究发现,尽管无服务器架构可显著降低运维负担,但性能与成本表现因工作负载模式而异,冷启动和状态管理是架构决策中的关键因素。

ABSTRACT

Serverless technologies, also known as FaaS (Function as a Service), are promoted as solutions that provide dynamic scalability, speed of development, cost-per-consumption model, and the ability to focus on the code while taking attention away from the infrastructure that is managed by the vendor. A microservices architecture is defined by the interaction and management of the application state by several independent services, each with a well-defined domain. When implementing software architectures based on microservices, there are several decisions to take about the technologies and the possibility of adopting Serverless. In this study, we implement 9 prototypes of the same microservice application using different technologies. Some architectural decisions and their impact on the performance and cost of the result obtained are analysed. We use Amazon Web Services and start with an application that uses a more traditional deployment environment (Kubernetes) and migration to a serverless architecture is performed by combining and analysing the impact (both cost and performance) of the use of different technologies such as AWS ECS Fargate, AWS Lambda, DynamoDB or DocumentDB.

研究动机与目标

  • 评估将微服务从传统 Kubernetes 迁移到无服务器架构的性能与成本影响。
  • 识别在微服务中采用无服务器技术(如 AWS Lambda 和 ECS Fargate)时的架构权衡。
  • 分析数据库选择(DynamoDB(无服务器)与 DocumentDB(预置))对系统成本与性能的影响。
  • 提供实证数据与开源原型,以指导真实世界云原生项目中的迁移决策。
  • 突出迁移过程中非显而易见的挑战,包括冷启动、状态管理与资源分配。

提出的方法

  • 使用 Kubernetes 和 Spring Boot 实现了一个基线微服务电子商务应用。
  • 将应用迁移至九种不同的配置,结合 AWS Lambda、ECS Fargate 以及两种数据库服务:DynamoDB(完全无服务器)与 DocumentDB(预置,非无服务器)。
  • 在受控工作负载下,通过请求延迟和吞吐量测量性能。
  • 基于每种配置的 AWS 定价模型计算基础设施成本。
  • 使用自动化脚本与监控工具收集所有原型的运行时指标。
  • 开源所有实现代码与评估脚本,以确保可复现性并供社区使用。

实验结果

研究问题

  • RQ1在微服务环境中,传统 Kubernetes 部署与无服务器部署(Lambda、Fargate)在性能特征(延迟、吞吐量)上存在哪些差异?
  • RQ2在微服务架构中,使用无服务器函数与托管容器及预置数据库的成本影响如何?
  • RQ3数据库选择(DynamoDB 与 DocumentDB)在无服务器与传统架构中如何影响成本与性能?
  • RQ4从 Kubernetes 迁移到无服务器架构时,遇到的关键非功能性挑战(如冷启动、状态管理)有哪些?
  • RQ5无服务器迁移中的架构决策在多大程度上影响了运维复杂性与可维护性?

主要发现

  • AWS Lambda 等无服务器架构显著降低了运维负担,但因冷启动导致延迟波动明显,尤其在低请求量场景下。
  • ECS Fargate 提供了性能可预测的中间方案,冷启动影响小于 Lambda,但成本高于细粒度无服务器函数。
  • 在无服务器工作负载中,DynamoDB 的成本始终低于 DocumentDB,尤其在间歇性或突发性流量模式下表现更优。
  • 无服务器自动扩展的成本并非免费——若缩放触发器未正确调优,可能导致性能下降与成本上升。
  • 从 Kubernetes 迁移到无服务器架构需要架构重构,而不仅仅是部署变更,尤其对有状态组件需进行大规模重设计。
  • 无服务器与传统微服务架构的选择并非普遍最优;性能与成本结果高度依赖工作负载特征与数据访问模式。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。