Serverless was a big mistake... says Amazon

preview_player
Показать описание
Amazon Prime Video released an article explaining how they saved 90% on cloud computing costs by switching from microservices to a monolith. Let's examine the details of their software architecture and find out why serverless was a bad choice.

#programming #aws #thecodereport

💬 Chat with Me on Discord

🔗 Resources

🔥 Get More Content - Upgrade to PRO

Use code YT25 for 25% off PRO access

🎨 My Editor Settings

- Atom One Dark
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- Monolith vs Microservice
- Pros and Cons of serverless
- Serverless pitfalls
- AWS lambda vs EC2
- What is a microservice
- How to save money on AWS
- Startups that have left the cloud
Рекомендации по теме
Комментарии
Автор

So what I learned is that the more servers you add the more serverless it is.

sp.n
Автор

been in IT for 30 years. it is an endless cycle of flipping back and forth on architecture decisions. can’t remember anymore if we are centralizing or decentralizing now.

John_Fx
Автор

Who could have guessed that initiating classes and calling functions is faster than API calls over HTTP

bkucenski
Автор

This is a lesson I learned at AOL over 2 decades ago. Monoliths are great for efficiency (going fast), microservices are great for flexibility (Change fast). It’s a question of what you want or need to optimize for. There is rarely one single approach for everything, it’s always a trade-off.

johnwu
Автор

TLDR; They were doing a lot of IO from lambda/step functions/state transitions/S3 for EACH FRAME in movies. Obviously slow. They decided to change that to process a movie's frames all at once in a worker per movie architecture avoiding 90%+ of the IO and slowness. They can still scale horizontally by adding more workers.

Denominus
Автор

"When it comes to cloud architecture, there are no solutions, only tradeoffs." What a great way to wrap the video up! Keep up the great content

ceco
Автор

I once visited a small biotech company that had its own server. I was confused, and they explained that due to the massive amounts of data their machines produce, it costs less for them in the long run to just buy a server than relying on the cloud. If your price for electricity is less than what AWS would bill you, and you can manage the upfront cost, having your own infrastructure actually makes sense.

dal
Автор

A small business had incomplete webapp which they used for day to day operations. I helped them complete it, the previous dev who worked on it built it as microservice using netflix discovery libraries. It was an overkill as only 10 employees used it, scaling was highly unlikely. The dev lost interest and left, due to overcomplicated architecture he created and lot of time was lost.

I rewrote it as monolithic nodejs apis + react app. It worked fine with same performance. I am not against microservice, but sometimes you need to be pragmatic, not idealistic.

As always, you teach me something in every video, Thanks fireship!

Kchandrashekaran
Автор

As a lot of things in Computer Science: it depends. There's a tradeoff for using monoliths or microservices. The key is to understand your needs and be aware of the tradeoffs while choosing an approach.

name-oskl
Автор

Whenever we discuss anything about anything in my programming team, i start by asking "what are the tradeoffs?" The devs know what they are doing, but want a team approach to make a decision. 95% of the time it doesn't really matter, but saving money for the startup usually takes slight priority. There very often are no real hard and fast solutions, only tradeoffs.

SkamanSamTyler
Автор

I think Prime Video's main cost was not from Lambdas/serverless per se but from using Step Functions service which is pretty expensive and not designed for high volume workflows.

alexandrid
Автор

Good points!
My take on this PR debacle: It's always been obvious that the primary scaling (or even use case) for serverless was to have *sparse* workloads. It shouldn't be engineered as a solution for continuous workloads, because the primary benefit is being able to scale to zero. If you scale serverless to be basically continuous use, it's gonna be expensive.
There's now some debate on whether or not this is sufficiently documented, but anyone with an AWS/Azure/GCP calculator can quite easily make their own projections and figure this out.

Also, serverless and microservices are not interchangeable concepts. I think the best takeaway from this is to consider network overhead when implementing microservices or serverless. It's always baffling to notice that developers have no clue on how much traffic flows between functions (or services). If you run it all on one machine, it doesn't matter, but that's where the key is.

TweakMDS
Автор

The new approach CAN scale horizontally. Look at the image - it says ECS Task.
They just packaged all the steps into one service (this is still a microservice) and they can run multiple instances of this service as containers in ECS
Multiple instances will handle multiple different frames in parallel

iverson
Автор

I've started using the term cloud psychosis for cases where microservices (or some vendor-specific cloud services) are expected to fix any underlying issue with architecture or software design.

BoloH.
Автор

"No solutions, only tradeoffs" <-- so well said. this was great.

aae
Автор

Prime still uses microservices, it's just the VQA (Video Quality Analysis) product that moved their product from multiple microservices to a larger microservice. They still maintain horizontal scalability, as there's a load balancer in front of the service (this scale cannot be achieved without horizontal scalability).
I don't know why they decided to use the term monolith, probably to get more impressions.

muizzy
Автор

Totally fair that AWS moved this set of services into a traditional container. It really just depends on your use case. We run our SaaS on all serverless, and it works out great for us. Probably our most expensive parts are just outgoing bandwidth due to streaming audio/video (which can't be helped), and using MediaConvert for video uploads.

We've been partly serverless since 2016, and fully serverless since 2022.

ffxsam
Автор

Just the Thomas Sowell reference at the end already deserves a like.

Bstiler
Автор

serverless is perfect for my use case. If my project don't work, it will stay on the free tier, if it sky rocket, it can scale.

Grahfx
Автор

Software Engineering Professor here:

This video is **really** good for explaining serverless and the serverless/monolith trade-off. Thanks for putting it together!

paulmcburney