DEV Community

Jay Sitapara
Jay Sitapara

Posted on

Moving from EC2 to AWS Lambda: Our Journey to Serverless

For a startup to thrive in today's competitive environment, it is critical to iterate and improve their time to test, deploy new features and delivering them to the customers. And for this to become reality, developers need to focus on developing the business features rather than maintaining and provisioning instances.

To deploy our MVP model, we had a single EC2 per microservice. Everything was running smoothly until the number of microservices went up to 20. 

  1. For final testing our production in the staging environment, we had a dedicated instance for each of the microservices. Over the time, we realised that these instances were sitting idle and costing us really high. 
  2. Replicating our production EC2 instances didn't turn out to be a feasible solution as well.
  3. Since our team is small, having a dedicated person to monitor scaling groups for EC2 wasn't possible. 
  4. For processing just a couple of requests sometimes, we had to spin up a whole new container which took our considerable time. 

We needed to change. And that's when we thought of moving to serverless architecture. Here's how it is going so far.  

  1. For user authentication, the combination of AWS Lambda and Cognito is working fine for us (currently 5000 app users and increasing). 
  2. For our scheduled CRON jobs, we are operating through AWS Lambda and CloudWatch. 
  3. It turned out, our current cost is 1/5th the amount we were spending on running our instances. 
  4. In the past 2 months, we've been able to release 10 new features after full-proof testing. 

Although moving to the serverless architecture was accompanied by few hurdles. But our development team really happy with our decision. Making the correct technology choices is one of the hardest jobs and that's why we've compiled our experience in the form of a blog post- AWS Lambda vs EC2: Comparison of AWS Compute Resources.

I'd really like to know what has been your experience (especially developers) with serverless technology. Drop a comment or hit me up on Twitter @JSitapara

Top comments (4)

Collapse
 
vishwendh profile image
vishwendh

Hello, @sitajay
Can you please explain in detail, about how to migrate ec2 instances from lambda and what issues

we get while migrating. As I have learnt AWS Recently.

Collapse
 
vishwendh profile image
vishwendh • Edited

Hello, @sitajay
Can you please explain in detail, about how to migrate ec2 instances to lambda and what issues
we get while migrating. As I have learnt AWS Recently.

Collapse
 
vishwendh profile image
vishwendh

Hello, @sitajay
Can you please explain in detail, about how to migrate ec2 instances to lambda and what issues we get while migrating. As I have learnt AWS Recently.

Collapse
 
vishwendh profile image
vishwendh

Hello, @jay sitapara
Can you please explain in detail, about how to migrate ec2 instances from lambda and what issues

we get while migrating. As I have learnt AWS Recently.