DEV Community

Discussion on: My monolith doesn't fit in your serverless

Collapse
 
diegocard profile image
Diego Cardozo • Edited

Hey, nice post Gabriel!

In my opinion, in order to understand the value of serverless frameworks, there are two questions that you need to answer first and foremost:

1) What type of application are you trying to build? a.k.a what is your business model?

For instance, a company that sells a specific service/product is a completely different world from a company that has 10 teams working on 10 different applications tailored for 10 different customers. These companies could be equal in size, but they have completely different requirements and trade-offs.

2) Where is the bulk of the cost/effort for your product? Is it in setting up the infrastructure initially? Is it in adding new requirements? Is it in troubleshooting? Setting up CI/CD?

Depending on the answer to these questions, different serverless frameworks will yield different benefits. Otherwise it's hard to draw any concrete conclusions.

Now, allow me to get into some specifics in order to provide something a bit more valuable to this discussion. I'm going to talk about AWS because, well, it's simply what I know best. Say you are building a typical web app (SPA, API backend, DB and authentication).

In this case, the likes of Fargate and RabbitMQ and incredibly overkill. Yes, if you're trying to model a simple app using those components, you're going to run into trouble. They're meant for much larger applications.

You should be looking at solutions like SAM and Amplify that will abstract away a lot of complexity. Vercel is also a great alternative.

Concretely, SAM lets you specify your desired architecture in a single config file, and it will take care of deploying, creating and changing all the components for you. It will also allow you to run your serverless code locally and do things like debugging lambdas directly on your IDE. Is this more complex than Heroku dynos? Yeah, and that may be enough to make you go for the latter. But it's significantly more powerful.

-- Disclaimer: I work in AWS, but these are just my own opinions.