Hacker News new | ask | show | jobs
by logandk 2600 days ago
For things like simple Sinatra APIs, a light-weight alternative is https://github.com/logandk/serverless-rack (a plugin for https://serverless.com, I'm the maintainer.)

To get a large Rails app operational on Lambda, Jets is the way to go.

2 comments

What is the advantage of serverless-rack over using AWS SAM? A quick glance at your project seems like it has a similar general intent, but without the official backing/support of Amazon.
Indeed, SAM and serverless framework serve the same overall purpose. It's mostly a matter of whether you prefer CloudFormation (SAM) or serverless' configuration format. I have mostly used serverless, but there are some posts out there comparing the two in detail, such as: https://sanderknape.com/2018/02/comparing-aws-sam-with-serve...
What are the benefits of it being operational on Lambda?
The merits of deploying a complex Rails app on Lambda are debatable, mainly due to the fact that larger code bases will result in slower cold request times for Lambda functions. For HTTP APIs in general, however, the three main benefits of being operational on Lambda are:

* Paying only for compute time/requests, if the API is not being accessed for a period of time, it's free - on a regular instance, you'd be paying for idle time

* Automatic scaling

* Simple deployment

The downsides include:

* Irregular response times due to cold containers

* Slower request/response cycle due to overhead in Lambda + API Gateway