Architectural Pivot: Amazon Prime's Audio-Video Monitoring Service reduces 90% cost by moving from Serverless to Monolith!

Architectural Pivot: Amazon Prime's Audio-Video Monitoring Service reduces 90% cost by moving from Serverless to Monolith!

Amazon Prime's Audio-Video Monitoring shifts from serverless to monolith, slashing costs by 90%. Architectural choice depends on context and scalability.

Architectural Pivot: Amazon Prime's Audio-Video Monitoring Service reduces 90% cost by moving from Serverless to Monolith!

💡 Disclaimer: Please note that Amazon Prime Video still operates on a microservice model. This article discusses the redesign of its audio/video monitoring service, not the entire platform.

🎯 What is the service's purpose?

It is designed to identify and rectify streaming quality issues. Under the hood, the service utilized AWS Lambda functions (similar to Azure Functions) to execute necessary procedures such as media conversion, detection, and orchestration.

🚧 So, what were the drawbacks of this microservice design?

Two primary limitations existed:

1️⃣ The Orchestration Workflow: The high frequency of state transitions, occurring every second of streaming, led to excessive expenses and rapid exhaustion of account limits.

2️⃣ Inter-Component Communication Costs: Storing data in Amazon S3 by one service and retrieving it by another proved expensive due to high volume.

🔄 How did a shift to a monolithic architecture help?

Moving to a monolith provided significant benefits:

✔️ All processes (media conversion, detection, and orchestration) now occur within a single Amazon EC2 instance, similar to an Azure VM.

✔️ Data is stored in-memory, significantly reducing network calls.

✔️ In instances where additional detectors overload the server, the service can be replicated multiple times with varying detector parameters.

✔️ Furthermore, a lightweight orchestration layer has been introduced to distribute requests more efficiently.

❓ But does this mean monoliths are the superior choice now? Certainly not.

Consider Netflix, which in 2010 broke down its application into 700+ microservices. Today, it serves 232 million subscribers with a stunningly low glitch rate of 0.07 per hour, cementing its place as the most reliable streaming platform to date.

❓ Does this then imply microservices are the ideal choice? Clearly not.

⚙️ So, what should you opt for?

There is no universal solution. The choice between monolith and microservices depends on multiple factors, including the system to be designed, its complexity, the specific use case, and the architectural problem you're addressing.

🚀 For early-stage startups, a monolith might be a better fit to build minimum viable products (MVPs).

📈 On the other hand, established companies might benefit from migrating to microservices for easier decoupling and horizontal scaling, subject to the scale and complexity.

🔑 The key takeaway? Maintain an open mind, grasp the nuances of various architectural styles, and choose what suits your situation best!