Live data from Hacker News

Ruby on Jets: Like Rails but serverless

github.com

11–20 of 92 posts

Re: Ruby on Jets: Like Rails but serverless

#11
post #3

Does it really make sense to map each controller method to a lambda? Wouldn’t it make more sense to have gateway route to a single function per controller and then do the method routing inside that function? You’re going to get a lot of lambda functions otherwise.

It's typically fine - AWS bills by GB/s (in ms), not by number of functions in an account. There are limits to the number of functions per account, and number of resources per CloudFormation stack (etc); but within those parameters it's usually a good idea to use one function for a specific controller or action. This allows you to limit IAM permissions, configure memory/CPU, and define associated resources at a per-c…

this makes logging much more difficult to search through

Re: Ruby on Jets: Like Rails but serverless

#12
post #3

Does it really make sense to map each controller method to a lambda? Wouldn’t it make more sense to have gateway route to a single function per controller and then do the method routing inside that function? You’re going to get a lot of lambda functions otherwise.

maybe this will eventually have an algorithm for deciding when to deploy separately and when not to, based on cost, performance, etc.

Re: Ruby on Jets: Like Rails but serverless

#13
post #3

Does it really make sense to map each controller method to a lambda? Wouldn’t it make more sense to have gateway route to a single function per controller and then do the method routing inside that function? You’re going to get a lot of lambda functions otherwise.

I've built some nice small frameworks for projects on both CloudFlare Workers and GCP Functions that do exactly this. They are so simple to build that I can't imagine needing to even open source them... but maybe should write up a blog post on the details at some point. So many people seem to miss this detail for some reason.

The main benefit is that it sure is a lot easier/faster to deploy one function than one for each route (CI/CD goes so much faster). As well as the cold starts.

Re: Ruby on Jets: Like Rails but serverless

#14

Am I the only one who is kinda irritated with how AWS has effectively created a piecemeal proprietary operating system and slowly started displacing good server ops? All while "supporting" open-source development. I really don't want to be an AWS engineer. I like being able to host my own tools when I want. Sorry for the rant, serverless stuff in general is cool. As a followup... I'm curious if anyone can recommend s…

I have found the Serverless framework to be great. Never really had to deal with AWS console at any point

https://www.serverless.com/

Re: Ruby on Jets: Like Rails but serverless

#15

Am I the only one who is kinda irritated with how AWS has effectively created a piecemeal proprietary operating system and slowly started displacing good server ops? All while "supporting" open-source development. I really don't want to be an AWS engineer. I like being able to host my own tools when I want. Sorry for the rant, serverless stuff in general is cool. As a followup... I'm curious if anyone can recommend s…

You might be interested to check out something like wintercg which aims to make serverless environments interoperable (for JavaScript).

https://wintercg.org/

Re: Ruby on Jets: Like Rails but serverless

#16
post #14

Am I the only one who is kinda irritated with how AWS has effectively created a piecemeal proprietary operating system and slowly started displacing good server ops? All while "supporting" open-source development. I really don't want to be an AWS engineer. I like being able to host my own tools when I want. Sorry for the rant, serverless stuff in general is cool. As a followup... I'm curious if anyone can recommend s…

I have found the Serverless framework to be great. Never really had to deal with AWS console at any point https://www.serverless.com/

Sure its a layer of abstraction but super leaky if you want to do anything meaningful.

Re: Ruby on Jets: Like Rails but serverless

#17

Earlier quoted context omitted.

It's typically fine - AWS bills by GB/s (in ms), not by number of functions in an account. There are limits to the number of functions per account, and number of resources per CloudFormation stack (etc); but within those parameters it's usually a good idea to use one function for a specific controller or action. This allows you to limit IAM permissions, configure memory/CPU, and define associated resources at a per-c…

You will definitely run into more cold starts though, if that is a consideration for your project

A serverless function that never cold-starts is just a container.

Re: Ruby on Jets: Like Rails but serverless

#18
post #7

Has anyone investigated what latency is like? Looks amazing for a low cost deployment, but I’d guess there could be significant startup latency for each controller.

There's a Django-ish version of this out there, and when I looked into using it briefly some time ago they had instructions on how to keep things "warm".

All that to say: I guess it's been considered, but I don't have measurements handy. It's not unknown tho.

Post reply on HN