DEV Community

Discussion on: The Easiest Way to Run Microservices: Comparing AWS and Heroku

Collapse
 
mostlyjason profile image
Jason Skowronski

Serverless functions are a great way to run microservices, depending on your team's needs. Serverless isn't exactly a direct comparison since Heroku offers dynos which support long-running processes and runs a full app or web server. It's more closely related to what you'd get on an EC2 instance or AWS Fargate. I figured EC2 is more widely used so I picked that for my comparison.

Lambda is geared more towards short running processes and has an execution limit of a few minutes, whereas a dyno runs continuously. This has some advantages for operations requiring more compute or high latency operations such as coordinating multiple service calls. You'll also run into fewer issues with warm up time, and is potentially lower cost for ongoing usage. It may also be quicker to port your existing service built on Django or Express to a dyno than rewrite it as as serverless function. Each team would have to consider which is best for their specific needs.

Yes Aurora Serverless and Dynamo are also great backend database options, again depending on your use case. You can call any database from Heroku so you can choose which you want to use. Traditional RDS is probably more widely used at the moment so that's why I used it for my comparison.