top | item 18305939

(no title)

MuppetMaster42 | 7 years ago

I used to work at a startup which transitioned to lambda from ec2.

We rewrote our backend from rest php to graphql typescript.

I can tell you that it is amazing operationally. You push code to aws and it just runs.

A comparison with manually managed ec2:

- push code to lambda and lambda automatically handles the dns updates and VIP swaps. No need to worry about configuring multi region blue-green deployments and health checks.

- no chance of a server needing manual intervention because of an errored state - because you can't store state between requests (not entirely true, but true enough). But failing that you know that the container will die soon anyways.

- automatic scaling instantly. Our platform was b2b, so most of the traffic was 7-7. Instead of running load balancers and scaling the servers, we needed to do nothing. AWS starts and kills new instances to handle the load automatically.

- no need to worry about the server config. Only need to specify a node version and a CPU size. It's a godsend from a dev standpoint because ultimately you don't care about that. Why bother managing the OS config, drivers, installed software + libraries. Sure it me as you can't squeeze every cycle of perf out a box, but chances are you aren't in a position to need to.

- pay per call, not per second. We were serving hundreds of thousands of calls via lambda every month, and the bill came out just over a single digit. I've read articles about the crossover point cost wise but it takes some decent scale to get there.

Theres no rules about how you architect a lambda function, just rules about how long it runs for.

Like I said, we ran our entire graphql api via a single lambda function and it worked great.

Things get a little more complicated when you need to kick off background processes, but again that can be pretty simple if you want it to be.

We just pushed messages to an sns queue which triggered a different lambda off. Note though that all this code was in the same repo, sharing code within everything.

The tldr of this really is: imagine running a service was as simple as pushing code to aws. That is what lambda enables.

discuss

order

No comments yet.