Cloud Technology

Is a Serverless architecture with AWS Lambda better than using Amazon EC2 for a scaling web app?

RO Asked by Robert Jones · 10-11-2023
0 upvotes 12,906 views 0 comments
The question

I'm building a new web application and I'm torn between managing my own servers on EC2 or going fully Serverless with AWS Lambda and API Gateway. My main concern is "Cold Starts" and how they might affect my user experience during traffic spikes. For a scaling application, which path offers better long-term reliability and lower operational overhead for a small engineering team?

 

3 answers

0
JE
Answered on 12-11-2023

For a small team, Serverless is almost always the winner because it removes the "undifferentiated heavy lifting" of patching and scaling servers. With Lambda, you only pay for the execution time, which is perfect for apps with variable traffic. Regarding cold starts, they are often exaggerated. You can mitigate them by using "Provisioned Concurrency" for your most critical functions or by keeping your deployment packages small. EC2 requires you to manage Auto Scaling groups and load balancers, which adds significant operational complexity. If your app is event-driven, go Serverless and focus your energy on writing code rather than managing the OS. 

0
JA
Answered on 14-11-2023

Have you considered the "Lambda Timeout" limits? If your application performs long-running tasks, will the 15-minute execution limit be a blocker for your logic?

AS 15-11-2023

James, that's a valid point. We actually split our long-running tasks into AWS Step Functions. This allowed us to keep the Lambda functions short and efficient while orchestrating the entire workflow. It made our system much more resilient because if one step fails, we can retry it without restarting the whole process. It’s a bit of a learning curve to move from a monolithic EC2 mindset to a microservices/step-function mindset, but the scalability we've achieved is incredible.

0
W
Answered on 16-11-2023

Serverless scaling is much faster. An EC2 instance can take minutes to boot up and join a cluster, while Lambda scales to thousands of concurrent requests in seconds. 

RO 17-11-2023

Exactly, William. That instantaneous scaling is what makes Lambda so powerful for viral marketing campaigns or sudden news-driven traffic spikes.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session