Live data from Hacker News

Rethinking serverless with FLAME

fly.io

21–30 of 153 posts

Re: Rethinking serverless with FLAME

#21
post #20

Very interesting concept, however it's a bit soured by the fact that Container-based FaaS is never mentioned, and it removes a decent chunk of the negatives around FaaS. Yeah you still need to deal with the communication layer (probably with managed services such as SQS or Pub/Sub), but there's no proprietary runtime needed, no rewrites needed between local/remote runtime environments.

what are some examples of container-based faas? like you put your docker image onto lambda?

Re: Rethinking serverless with FLAME

#22
post #20

Very interesting concept, however it's a bit soured by the fact that Container-based FaaS is never mentioned, and it removes a decent chunk of the negatives around FaaS. Yeah you still need to deal with the communication layer (probably with managed services such as SQS or Pub/Sub), but there's no proprietary runtime needed, no rewrites needed between local/remote runtime environments.

what are some examples of container-based faas? like you put your docker image onto lambda?

* Google Cloud Run - https://cloud.google.com/run/docs/deploying#command-line

* OpenFaaS - https://www.openfaas.com/blog/porting-existing-containers-to...

* AWS Lambda - https://docs.aws.amazon.com/prescriptive-guidance/latest/pat...

* Scaleway Serverless Containers - https://www.scaleway.com/en/serverless-containers/

* Azure Container Instances - https://learn.microsoft.com/en-us/azure/container-instances/...

Probably others too, those are just the ones I know off the top of my head. I see very little reason to use traditional Function-based FaaS, which forces you into a special, locked-in framework, instead of using containers that work everywhere.

Re: Rethinking serverless with FLAME

#23
Looks like a great integrated take on carving out serverless work. Curious to see how it handles the server parts of serverless like environment variables, db connection counts, etc.

One potential gotcha I'm curious if there is a good story for is if it can guard against code that depends on other processes in the local supervision tree. I'm assuming since it's talking about Ecto inserts it brings over and starts the whole apps supervision tree on the function executor but that may or may not be desired for various reasons.

Re: Rethinking serverless with FLAME

#24

Author here. I’m excited to get this out and happy to answer any questions. Hopefully I sufficiently nerd sniped some folks to implement the FLAME pattern in js , go, and other langs :)

This looks great. Hopefully Microsoft are paying attention because Azure Functions are way too complicated to secure and deploy, and have weird assumptions about what kind of code you want to run.

Re: Rethinking serverless with FLAME

#25
This is one reason I really don't like US headline casing as enforced by HN - it looks like Serverless, as in the capital-S company, serverless.com, is what's being rethought, not the small-s principle.

(Aside: I wish someone would rethink Serverless, heh.)

Re: Rethinking serverless with FLAME

#26
post #20

Very interesting concept, however it's a bit soured by the fact that Container-based FaaS is never mentioned, and it removes a decent chunk of the negatives around FaaS. Yeah you still need to deal with the communication layer (probably with managed services such as SQS or Pub/Sub), but there's no proprietary runtime needed, no rewrites needed between local/remote runtime environments.

what are some examples of container-based faas? like you put your docker image onto lambda?

https://knative.dev/ - (CloudRun API is based on this OSS project)

Re: Rethinking serverless with FLAME

#27
This is a very neat approach and I agree with the premise that we need a framework that unifies some of the architecture of cloud - shuttle.rs has some thoughts here. I do take issue with this framing:

- Trigger the lambda via HTTP endpoint, S3, or API gateway ($)

  * Pretending that starting a fly machine doesn't cost the same as triggering via s3 seems disingenuous.
- Write the bespoke lambda to transcode the video ($)

  * In go this would be about as difficult as flame -- you'd have to build a different entrypoint that would be 1 line of code but it could be the same codebase. Node it would depend on bundling but in theory you could do the same -- it's just a promise that takes an S3 event, that doesn't seem much different.
- Place the thumbnail results into SQS ($)

  * I wouldn't do this at all. There's no reason the results need to be queued. Put them in a deterministically named s3 bucket where they'll live and be served from. Period.
- Write the SQS consumer in our app (dev $)

  * Again -- this is totally unnecessary. Your application *should forget* it dispatched work. That's the point of dispatching it. If you need subscribers to notice it or do some additional work I'd do it differently rather than chaining lambdas.
- Persist to DB and figure out how to get events back to active subscribers that may well be connected to other instances than the SQS consumer (dev $)

  * Your lambda really should be doing the DB work not your main application. If you've got subscribers waiting to be informed the lambda can fire an SNS notification and all subscribed applications will see "job 1234 complete"
So really the issue is:

* s3 is our image database

* our app needs to deploy an s3 hook for lambda

* our codebase needs to deploy that lambda

* we might need to listen to SNS

which is still some complexity, but it's not the same and it's not using the wrong technology like some chain of SQS nonsense.

Re: Rethinking serverless with FLAME

#28
post #23

Looks like a great integrated take on carving out serverless work. Curious to see how it handles the server parts of serverless like environment variables, db connection counts, etc. One potential gotcha I'm curious if there is a good story for is if it can guard against code that depends on other processes in the local supervision tree. I'm assuming since it's talking about Ecto inserts it brings over and starts the…

It starts your whole app, including the whole supervision tree, but you can turn on/off services based on whatever logic you want. I talk a bit about this in the screencast. For example, no need to start the phoenix endpoint (webserver) since we aren't serving web traffic. For the DB pool, you'd set a lower pool size or single connection in your runtime configuration based on the presence of FLAME parent or not.

Re: Rethinking serverless with FLAME

#29
post #22

Earlier quoted context omitted.

what are some examples of container-based faas? like you put your docker image onto lambda?

* Google Cloud Run - https://cloud.google.com/run/docs/deploying#command-line * OpenFaaS - https://www.openfaas.com/blog/porting-existing-containers-to... * AWS Lambda - https://docs.aws.amazon.com/prescriptive-guidance/latest/pat... * Scaleway Serverless Containers - https://www.scaleway.com/en/serverless-containers/ * Azure Container Instances - https://learn.microsoft.com/en-us/azure/container-instances/... Probab…

ok yeah so like an image on lambda, totally agree, a lot of the pros of serverless without a lot of the cons

Re: Rethinking serverless with FLAME

#30

Pretty cool idea, and that api is awesome. > CPU bound work like video transcoding can quickly bring our entire service to a halt in production Couldn't you just autoscale your app based on cpu though?

Yes and no: Maybe the rest of your workloads don't require much CPU- you only need this kind of power for one or two workloads, and you don't want them getting crowded out by other work potentially. Or they require a GPU. Or your core service only needs 1-2 servers, but you need to scale up to dozens/hundreds/thousands on demand, for work that only happens maybe once a day.

fair enough.

i think it's cool tech, but none of those things are "hair on fire" problems for me. i'm sure they are for some people.

Post reply on HN