equivalent / we_demand_serverless_ruby

online petition application hosted on serverless-ruby.org
https://www.serverless-ruby.org/
4 stars 4 forks source link

Heroku One-Off dynos #7

Open januszm opened 6 years ago

januszm commented 6 years ago

https://devcenter.heroku.com/articles/one-off-dynos

One-Off "dynos" are available at least since 6-7 years. It's not exactly the same thing as AWS Lambda but it serves a very similar purpose.

More about dynos (app containers): https://www.heroku.com/dynos

equivalent commented 6 years ago

:thinking: hmm, that is kind of a gray area as developer would need to spin it manually, execute command and then spin down manually.

Imagine you have 100 000 jobs/requests you need to execute this way (as a true FaaS you would expect that it will automatically spin 100 000 one-off dynos that will shout down independently of each other once they're done)

[req 1][req 2][req3 ]..[req 100k]     -> [dyno 1] -> finish req1
                                      -> [dyno 2]  -> finish req2
                                      -> [dyno 3] -> finish req3
                                      .....
                                      -> [dyno 100k]  -> finish req100k

To me the Heroku one of dyno approach would rather spin up one or two dynos, execute those 100 000 requests/jobs and then spin down.

[req 1][req 2][req3 ]..[req 100k]     -> [dyno 1]   -> finish req1,req2, req3 ...req100k

So therefore this to me still feels like PaaS (provider as a service) not FaaS

The real benefit of FaaS is that you don't care if you need to execute 1 or 10Milion times certain piece of code. You are sure that FaaS provider will have enough power in the cloud to do than simultaneously.

I'm happy to discuss this more. Do you have any examples how to use this as a FaaS ?

januszm commented 6 years ago

Well, the a typical use case is to spin it up via a plug-in, like Heroku Scheduler, but there's also an option to spin it up manually (eg. heroku run rails console) and I believe you refer to that use case.

Regarding spinning-down, well it's only required for interactive sessions (like the rails console). One-Off Dyno will terminate itself once the scheduled task is complete (at least this is how it worked when I used it last time).

I came here via Ruby Weekly mailing and just wanted to add my two cents on this issue, because I noticed that nowhere is reference to Heroku One-Off dynos, which fall a little under this category.

But I agree that it'd be nice to have Ruby support in AWS Lambda.

equivalent commented 6 years ago

@januszm don't get me wrong, your insight is actually really valuable.

Since you've posted this issue I'm thinking about it, and it's actually a great point. I think I will create a section in the website for "close enough" solutions and this will be one of them. is will be one of them.

But truth is this is not FaaS. It's really helpful solution to lot of cases but not really what FaaS is trying to achieve. But I'll definitely add it to the website.

The website is slowly turning from petition to something like documentation of FaaS and almost FaaS solutions... I really like that :smile: Thank you for contributing to this.