Search code examples
serverlessserverless-architecture

How serverless like aws lambda and google cloud function work on infrastructure level


I want to get a little deep in the serverless architecture(like aws lambda and google cloud function) How they deploy and run the function, I heard for each request they will set up an instance for that request. Isn't that really expensive and inefficient? Or if they reuse the instance or container, how they handle or manage the concurrency, auto scale and instance management?


Solution

  • Different clouds use different technologies for load balancing the workers. Based on what I learnt, cloud providers learn how it is used and optimize them to their customers removing unwanted complexities in the infrastructure.

    With dockers the balancing it done with,

    https://rominirani.com/docker-swarm-tutorial-b67470cf8872

    With Kubernetes (Google Cloud) it is done with External load balancer (for external access),

    https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/

    These are just out for public.

    Cloud providers will do all possible optimizations so that they can run your code quickly. I would really consider them proprietary rather than a open source technology.

    Hope it helps.