Serverless was a big mistake... says Amazon

By: JC Coles
Posted: February 13, 2024

Serverless for Speed, not Scale

Serverless vs. Monolith: Amazon's Surprising Cost-Saving Move

In a recent and surprising twist, Amazon Prime Video made a decision that had the tech world buzzing and chuckling with amusement. They bravely bid farewell to the trendy serverless microservices and embraced the classic monolith architecture. It was a move that defied expectations and challenged the prevailing belief that serverless is the ultimate cost-efficient option for scaling infrastructure.

As one of the pioneers of serverless technology with their Lambda functions, Amazon's transparency in this decision is commendable. Their groundbreaking innovations have paved the way for platforms like Vercel and Netlify to emerge, democratizing the accessibility of AWS services. Additionally, open-source projects like the Vercel serverless framework and SST have simplified the usage of AWS, making it more approachable for developers.

However, it's important to note that not everyone is on board with the serverless trend. DHH, the mastermind behind Ruby on Rails and Basecamp, has become a vocal advocate for what he calls "Majestic Monoliths." He even made the bold move of taking his company off the cloud due to substantial expenses. Dropbox, a successful startup, has also chosen to depart from the cloud as they continue to grow.

Despite the ongoing debate, serverless remains a game-changer for many, enabling rapid development and innovation. While there have been instances of accidental infinite scaling loops resulting in significant costs, the undeniable benefits of serverless cannot be ignored.

So, what led Amazon Prime Video to make this unexpected shift? They encountered a specific challenge related to analyzing audio content and addressing issues like video freeze and corruption. Initially, they relied on serverless functions, known as Step functions, to handle these tasks. However, they soon discovered that the distributed architecture caused bottlenecks. This realization prompted a decision to re-architect to a monolithic structure.

By consolidating everything into a single container, Amazon Prime Video had no choice but to opt for vertical scaling. While some may view this as a drawback compared to the horizontal scalability of microservices, it proved to be a wise move. The elimination of unnecessary communication and network usage resulted in an astounding 90% reduction in costs. For a product of Amazon Prime Video's magnitude, this translates to millions of dollars saved.

It's important to remember that this particular example shouldn't be taken as a one-size-fits-all solution. Each situation is unique and requires careful consideration. For instance, Netflix transitioned from a monolithic architecture to hundreds of microservices after a major failure in 2008. While the complexity and costs increased, the ability to scale independently and ensure fault tolerance became crucial for their large-scale platform.

On the other hand, small businesses can greatly benefit from the simplicity and peace of mind that serverless provides. Deploying code without worrying about infrastructure concerns and staying within the free tier are significant advantages for these enterprises.

In the realm of cloud architecture, there are no definitive answers—only trade-offs. Organizations must weigh the benefits and drawbacks of serverless and monolithic approaches, taking into account their specific needs. Amazon Prime Video's cost-saving move challenges conventional wisdom and sparks a necessary conversation within the tech community.

As the landscape of cloud architecture continues to evolve, it's essential to maintain an open mind and explore the best fit for each unique scenario. The story of serverless and monoliths is far from over, and there are sure to be more surprises and twists along the way. So, stay tuned for the next chapter in this ever-evolving tech saga!

This post was inspired by "The Code Report" by JC Coles.