Back to the Monolith: Why Did Amazon Dump Microservices?

Back to the Monolith: Why Did Amazon Dump Microservices?

Posted in

It’s been a harsh couple of years for buzzy digital products and services. Crypto exchanges have been closing left and right. NFTs haven’t been panning out. The metaverse is running out of steam, and falling market shares show streaming services’ dreams of infinite expansion for the fantasy they always were.

Bubbles are bursting, and the bottom is falling out on tech concepts without enough substance. Some API companies are feeling the squeeze, too, as evidenced by the recent Rapid layoffs. Tech companies are desperately trying to cut costs and overhead in any way possible. Obviously, a bloated AWS bill would be a good place to start.

A recent blog post from Amazon Prime Video developers suggests microservices may be the next hyped-up tech trend on the chopping block.

In March 2023, Prime Video’s Marcin Kolny detailed how their team has been using AWS to monitor every user’s stream for glitches and sync issues for their Video Quality Analysis team. The trouble is their tool, which was developed using microservices architecture, was never designed to scale. This approach was making their platform very expensive and creating bottlenecks, causing the team to step back, reassess their approach, and refactor things into a monolithic design.

Breaking Down Prime Video’s AWS Solution

In the blog post, Kolney describes how their video monitoring tool worked. It involved three parts: a media converter to translate video streams into frames and audio streams into decrypted audio buffers, an algorithm for detecting, and a tool that controls the flow within the service.

The monitoring tool was designed to be serverless, using either AWS Step Function or AWS Lambda. However, this approach proved too expensive and experienced performance issues before the service even hit its expected peak. Passing video frames between components was one of the main causes for the bottleneck, causing the team to consider converting to a monolithic solution to solve their problems.

How Prime Video Solved Their Microservices Dilemma

Rather than try and fix each individual component, Kolny’s team decided to overhaul their entire infrastructure. Here’s what their revamped video quality tool looks like:

designAmazonWebServicesMicroservices1.jpg

Image Credit: PrimeVideoTech

Conceptually and architecturally, their service was almost identical to their microservices-based solution. It still has the same components: media conversion, error detection, and an orchestration layer. They simply created more monolithic solution instances and ran them in parallel. They also created a new orchestration layer to distribute customer requests when capacity is being reached. This monolithic conversion ended up saving their organization 90% on their monthly AWS bill.

Reflections on Prime Video’s Monolithic Conversion

One lesson from Prime Video’s pivot away from microservices is there’s no such thing as a catch-all solution in tech. Every decision needs to be made on a case-by-case basis. It’s also a lesson to view all breathless 32-point headlines from tech evangelists with skepticism.

As Kelsey Hightower, a leading proponent of Kubernetes, predicted all the way back in 2020, converting to microservices without proper planning simply trades bad code for faulty infrastructures. “We’re gonna break [the monolith] up and somehow find the engineering discipline we never had in the first place,” as Hightower put it. He goes on to criticize the architecture itself, as well as the hype that went with it. “Because it drives a lot of new spend, it drives a lot of new hiring… So a lot of people get addicted to all the flourishment of money, and marketing, and it’s just a lot of buzz that people are attaching their assignment to, when honestly it’s not gonna necessarily solve their problem.”

As developers and business owners, we need to evaluate every promising new tool and trend when they emerge. Prime Video’s update suggests it’s maybe not always the smartest move to sell off all of our physical systems and convert everything to the cloud, so to speak.

Instead of using serverless or microservices-based architecture for every situation, you should consider a monolithic approach for long-running computing jobs or when there are predictable traffic spikes, as advised by Adrian Cockcroft. You should also consider monolithic architecture if you’re creating a tool or system if it’s going to be used by one team or application. That being said, microservices and serverless solutions often make sense for an organization of Amazon’s size.

Not everybody is as convinced by Kolny’s conversion. Lambos Petrou, a software developer at DataDog, blames the inefficiency on faulty programming. Others feel that the move from microservices to embedded containers is a fairly obvious solution.

Every time you add a microservice, you’re also adding an HTTPS call, OAuth authorization, and JSON transfer for each component. This makes your network more brittle and breakable. It can also be much more expensive, as you’re charged for each call.

Takeaways From The Current Debate

The main takeaway from the ‘microservices vs. monolith‘ “debate” is that there is definitely a time and a place for both architectures. Microservices can help you get a product to market much more quickly, for one thing. They can also play an important part in both DevOps and CI/CD.

You should never get complacent with your microservices-based architecture, though. Once your product is stable and established, consider conducting a periodic assessment to see where you can reduce or eliminate inefficiencies when possible.

Scale may also dictate architectural decisions. As Amazon CTO Dr. Werner Vogels put it for All Things Distributed, “there is not one architectural pattern to rule them all. … My rule of thumb has been that with every order of magnitude of growth you should revisit your architecture, and determine whether it can still support the next order level of growth.”

With the hype calming down around microservices giving way to a more careful re-assessment, we’re offered the opportunity to realize there is no flashy or gimmicky replacement for solid coding, architecture, and development principles. We should be just as wary of the sudden reversal to the monolith, though, which could become the next cycle of splashy headlines.