4 ms·
Docker can also be serverless and gets rid of all the limitations of lambda - Fargate.
by scarface74 7y ago
Docker can also be serverless and gets rid of all the limitations of lambda - Fargate.
- dragonelite 7y agoI tried using google cloud run, with a rust web server. I think google only counts request processing time and rounds up to the nearest 100ms. All i had to do was provide a container with a web service that reads a environment variable to listen to a specific port.
- snisarenko 7y agoI am considering using g cloud run for my next project. How did you like it ?
- dragonelite 7y agoToo be honest it was really just a small project to get used with Actix web a rust web frame work and to setup a google cloud build ci/cd that would build a container i could host somewhere. I only used cloud run because i saw a youtube suggestion about it xD So there was no load except me and some friends pushing f5 a couple of times. You can create a web service in whatever language and framework you want, all you need to do is read a PORT environment variable for incoming messages. The freedom was really awesome, instead of being confined to supported languages and frameworks you get in the functions landscape. Only confinement was that you're pretty much limited to HTTP calls, unless that has changed. Personally i find the freedom of pick your own language and framework a big positive, and billing is finer on cloud run compared to AWS Fargate(rounded up to next sec) if im not mistaken. I do wish they would make billing even more finer instead of rounding up to the next 100 ms, rounding up to the next 10ms would be nicer when you use non GC or Runtimed languages, like Rust.
- mywittyname 7y agoFargate is not a replacement for Lambda. While there's some capability overlap, each have their own respective niches.
- scarface74 7y agoThere is no reason that Fargate can not be a replacement for lambda. There are three use cases for lambda: 1. Event based triggers where something happens externally that you want to process. You can do the same thing with Fargate by either having a continuously running process that reads from a queue or responds to an API request (AWS Event -> SNS -> API). 2. Timed events. You can do this with Fargate directly (https://aws.amazon.com/about-aws/whats-new/2018/08/aws-fargate-now-supports-time-and-event-based-task-scheduling/ https://aws.amazon.com/about-aws/whats-new/2018/08/aws-farga...) 3. APIs. Fargate supports autoscaling. Fargate can do anything that lambda can do without the limitations - request and response payload size, a 10GB temporary storage drive instead of a half megabyte, and no 15 minute runtime limit. Of course no cold start times since you can have a minimum number of instances always running without Ping hacks.
- TheCoelacanth 7y agoAnd bare-metal servers can do everything Fargate can without limitations. The point of both is to sacrifice some capabilities in order to remove operational complexity. Lambda just goes farther along that spectrum than Fargate does.
- scarface74 7y agoHow so? With lambda you give AWS a zip file with your code in it and with Fargate you give AWS a Docker Container. The only difference is that AWS doesn’t support the event triggers with Fargate out of the box.
- TheCoelacanth 7y agoA docker container is not just your code. It's basically the entire userspace portion of an OS plus your code.
- scarface74 7y agoIt’s not any more “operationally complex”. The fact that Docker containers include the OS doesn’t make it more complex to run. My Docker file that I used to convert my Node/Express API that was running in lambda consisted of... - setting environment variables (I had to do the same thing in my CF template for lambda) - retrieving the Node Docker image (one line of code - I had to specify one line of code in my CF template with lambda to specify that is was using the Node runtime) - copying the files from the directory to the container (as opposed to specifying the locsl path of the source code in the CF Template) - Specifying the Docker Run command (as opposed to specifying the lambda handler). - running “Docker build” as opposed to “CloudFormation package”. How it does it is an implementation detail. In fact, if you use lambda layers, it’s almost equivalent to building Docker images.