Amazon Prime Video Case Study: Transitioning from Microservices to Monolith – A Cost-Saving Architectural Shift

In a surprising turn of events, a recent case study from the Prime Video team at Amazon has sparked attention and discussion within the developer community. The study presents a candid assessment of cost-saving measures by transitioning from a microservices architecture to a monolith, while also avoiding expensive services such as AWS Step Functions and Lambda serverless functions.

The case study stemmed from the need for a highly scalable monitoring tool to identify quality issues in every stream viewed by customers, with the requirement to handle thousands of concurrent streams. Initially, the team created a solution with distributed components orchestrated by AWS Step Functions, a serverless orchestration service. However, they encountered challenges as Step Functions became a bottleneck due to high state transition costs and account limits.

Furthermore, the high number of tier-1 calls to the S3 bucket used for temporary storage of captured video frames resulted in a significant cost problem. As a result, the initial architecture for the Prime Video monitoring application proved to be both costly and inefficient at scaling.

The team’s solution was to consolidate all components into a single process, eliminating the need for S3 and implementing orchestration that controls components within a single instance. The application now runs on EC2 and ECS, with a lightweight orchestration layer to distribute customer requests. This shift to a monolithic architecture led to a substantial infrastructure cost reduction of over 90% and increased scaling capabilities.

The case study has prompted reactions from the developer community, with some expressing surprise at the article’s existence. It also raises questions about the widely promoted benefits of microservices and serverless architecture by AWS, challenging the notion that these approaches are always the most cost-effective or suitable for all use cases.

In response to the case study, industry experts such as David Heinemeier Hansson and Sam Newman have shared their perspectives, emphasizing the practical challenges and potential drawbacks of microservices. While AWS has traditionally advocated for microservices and serverless architecture, the case study provides a refreshing and honest look at how simplifying the architecture can lead to significant cost reductions.

Despite the divergence from AWS’ typical best practices, the case study offers valuable insights for AWS customers and demonstrates a willingness to adapt and change course. Unlike many promotional case studies, this candid examination of architectural choices offers practical lessons and considerations for developers and organizations navigating complex infrastructure decisions.

In conclusion, the Amazon Prime Video case study serves as a reminder that the choice between microservices and monolithic applications should be made based on specific use cases and requirements, rather than adhering to a one-size-fits-all approach. It also highlights the importance of continuously evaluating and adapting architectural strategies to optimize cost and performance.

Overall, the case study presents a valuable learning opportunity for the developer community and AWS customers, shedding light on the nuanced considerations involved in architectural decision-making within complex cloud environments.