Four years ago I wrote on this blog about the architectural suicide that is adopting microservices purely for fashion. Many people called me outdated. "Netflix and Amazon use microservices, we must too," they said. Well, this week the Amazon Prime Video engineering team has just published an article detailing how they have migrated their video quality monitoring system from microservices to a monolith... and have reduced their infrastructure costs by an astonishing 90%.
Seeing Amazon, the parent company of AWS and the biggest historical evangelist of distributed architecture and the serverless model, admit that microservices are not always the answer is a technical humbling for the entire industry.
The problem: Serialization and state transitions
The Prime Video team had an internal tool to monitor the quality of thousands of concurrent video streams. Initially, they designed it as a textbook serverless architecture: multiple AWS Lambda functions orchestrated by AWS Step Functions.
On paper, the architecture was elegant. Each step of the video analysis (detecting image blocking, audio synchronization failures) was an independent component. In practice, it was a financial and performance disaster on a massive scale.
The fundamental mistake of distributed architecture in this context is ignoring the physical toll of the network. In the microservices version, to pass video frames from one detector to another, the system had to write the data to a temporary S3 bucket and read it in the next Lambda. Furthermore, AWS Step Functions charges for each "state transition". When you pass millions of video frames per second, the costs of serializing data, writing it to a network disk, and paying the toll for each orchestration hop choke latency and drain the corporate credit card.
The return to the Modular Monolith
Amazon's solution was overwhelmingly sensible: put everything in one box.
They grouped all detectors (audio, video, subtitles) within a single process running on an Amazon EC2 instance (or in long-running ECS containers).
By moving data through the process's own RAM instead of passing it over the network, they completely eliminated network and I/O bottlenecks.
And how do they scale if the monolith becomes too small? The oldest and most reliable way: cloning the monolith. If they need to process more concurrent streams, they simply spin up more complete instances of the monolith on larger EC2 servers and distribute the work. That is, horizontal scaling (scale-out) of a monolith, not of isolated components.
Reflection: Physics does not forgive
Amazon Prime Video's official post should be mandatory reading in all software engineering universities. Microservices solve human scalability problems (they allow hundreds of programmers to deploy code without stepping on each other's toes), but on a purely technical level, they add latency, network overhead, and extreme operational complexity.
Communication over a network (milliseconds) will always be orders of magnitude slower and more expensive than a local memory call (nanoseconds). Physics does not forgive, and neither does the Cloud provider's bill. It is an immense relief to see the industry pendulum starting to correct itself: you have to choose the architecture that solves your business bottleneck, not the one that looks most modern on a slide deck.