Should I Choose Serverless or EC2 for My Project?

0
5
Asked By TechieGuru42 On

Hey everyone! I'm in the process of planning the infrastructure for a new project with a couple of other developers. We're considering a fully serverless setup using AWS Lambda and the Serverless Framework, but we want to weigh the advantages and disadvantages carefully. Here are a few things I'm particularly curious about:

* If you've worked on a mature project using this stack, what challenges did you face?
* How does CI/CD, workflow management, and environment separation work with serverless? I've seen that the Serverless Framework dashboard offers some of these features, but I'm not sure I fully understand it yet.
* From a conceptual perspective, what are the main questions to ask before deciding between EC2 and Lambda?

I'd appreciate any additional insights or experiences you can share!

5 Answers

Answered By SimplicitySeeker5 On

Think about your workloads. If you have sporadic demand, serverless is the way to go. But for consistent loads, I’d recommend EC2 with an autoscaling group. A downside of serverless is the delay due to its distributed nature, especially when using services like SQS. I also suggest using the serverless stack rather than just the framework; it offers better options for managing different environments.

Answered By CloudWhisperer79 On

Have you considered ECS Fargate? It offers the benefits of containerization without the rigid infrastructure of EC2 and avoids the complexities of Lambda. With Fargate, you just deal with images and scale easily – it's much simpler for local development too. Deployments are straightforward; just update your image and restart.

Answered By CodeNinja7 On

Keep in mind that Lambda has a 15-minute execution limit, which can be crucial for certain workloads like data processing pipelines.

Answered By FutureBuilder22 On

Before making a choice, consider your expected traffic flow. Consistent loads lean towards EC2, while unpredictable or event-driven workloads suit Lambda. Just know that initially, Lambda can be less costly, but it's not always the best for heavy, ongoing loads. If you're going serverless, it’s best to have a hybrid approach rather than fully committing from the start.

Answered By DevDynamo23 On

How many Lambdas are you planning on using? If you go with EC2, you'll have to manage things like ALBs, certificates, and potentially separate scaling strategies. It's more complex but gives you greater control. Personally, I've found that Lambda is easier for smaller projects, but I wouldn’t recommend it for larger, serious applications. In our case, we’ve used multiple AWS accounts to manage environments, but we made a mistake by running separate APIs for each Lambda; it's usually better to consolidate them under a single API gateway.

TechieGuru42 -

Thanks for the thorough explanation! Setting up an EC2 environment has been pretty tedious for us since we lack serious DevOps experience. Lambda definitely feels easier. Though I keep hearing folks say, 'stick to a monolithic EC2 setup.' I'm leaning more towards that now.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.