Need advice about which tool to choose?Ask the StackShare community!
AWS Lambda vs Docker: What are the differences?
- Execution Environment: AWS Lambda is a serverless computing service, where the code is executed on demand in response to events without the need to provision or manage servers. On the other hand, Docker requires the creation of a container that encapsulates the application along with its dependencies, allowing it to be run consistently across different environments.
- Scalability: AWS Lambda automatically scales based on the incoming traffic and events, allowing for high availability and efficient resource utilization. In contrast, Docker containers need to be managed and scaled manually, requiring more hands-on configuration and monitoring for achieving scalability.
- Billing Model: AWS Lambda follows a pay-per-use pricing model, where users are charged based on the number of invocations and the resources consumed during the execution of functions. Docker, being a containerization platform, does not have a distinct billing model as it can be used on various hosting services with different pricing structures.
- Isolation: AWS Lambda provides a high level of isolation between function executions by spinning up a new container for each function, ensuring security and preventing interference between different invocations. Docker also offers isolation through containers, but the level of isolation can vary depending on the configuration and setup of the containers.
- Deployment Flexibility: AWS Lambda functions can be easily deployed and managed through the AWS Management Console or command-line tools, allowing for quick updates and version control. On the other hand, Docker containers provide more flexibility in deployment options, as they can be deployed on different hosting platforms and managed using container orchestration tools like Kubernetes or Docker Swarm.
- Startup Time: AWS Lambda functions have a cold start problem where the first execution of a function may experience a delay due to the initialization of resources. Docker containers, once created, have faster startup times as they do not incur the overhead of spinning up a new environment for each execution.
In Summary, the key differences between AWS Lambda and Docker lie in their execution environment, scalability, billing model, isolation, deployment flexibility, and startup time.
lxd/lxc and Docker aren't congruent so this comparison needs a more detailed look; but in short I can say: the lxd-integrated administration of storage including zfs with its snapshot capabilities as well as the system container (multi-process) approach of lxc vs. the limited single-process container approach of Docker is the main reason I chose lxd over Docker.
When adding a new feature to Checkly rearchitecting some older piece, I tend to pick Heroku for rolling it out. But not always, because sometimes I pick AWS Lambda . The short story:
- Developer Experience trumps everything.
- AWS Lambda is cheap. Up to a limit though. This impact not only your wallet.
- If you need geographic spread, AWS is lonely at the top.
Recently, I was doing a brainstorm at a startup here in Berlin on the future of their infrastructure. They were ready to move on from their initial, almost 100% Ec2 + Chef based setup. Everything was on the table. But we crossed out a lot quite quickly:
- Pure, uncut, self hosted Kubernetes — way too much complexity
- Managed Kubernetes in various flavors — still too much complexity
- Zeit — Maybe, but no Docker support
- Elastic Beanstalk — Maybe, bit old but does the job
- Heroku
- Lambda
It became clear a mix of PaaS and FaaS was the way to go. What a surprise! That is exactly what I use for Checkly! But when do you pick which model?
I chopped that question up into the following categories:
- Developer Experience / DX 🤓
- Ops Experience / OX 🐂 (?)
- Cost 💵
- Lock in 🔐
Read the full post linked below for all details
Pros of AWS Lambda
- No infrastructure129
- Cheap83
- Quick70
- Stateless59
- No deploy, no server, great sleep47
- AWS Lambda went down taking many sites with it12
- Event Driven Governance6
- Extensive API6
- Auto scale and cost effective6
- Easy to deploy6
- VPC Support5
- Integrated with various AWS services3
Pros of Docker
- Rapid integration and build up823
- Isolation692
- Open source521
- Testability and reproducibility505
- Lightweight460
- Standardization218
- Scalable185
- Upgrading / downgrading / application versions106
- Security88
- Private paas environments85
- Portability34
- Limit resource usage26
- Game changer17
- I love the way docker has changed virtualization16
- Fast14
- Concurrency12
- Docker's Compose tools8
- Fast and Portable6
- Easy setup6
- Because its fun5
- Makes shipping to production very simple4
- It's dope3
- Highly useful3
- Does a nice job hogging memory2
- Open source and highly configurable2
- Simplicity, isolation, resource effective2
- MacOS support FAKE2
- Its cool2
- Docker hub for the FTW2
- HIgh Throughput2
- Very easy to setup integrate and build2
- Package the environment with the application2
- Super2
- Asdfd0
Sign up to add or upvote prosMake informed product decisions
Cons of AWS Lambda
- Cant execute ruby or go7
- Compute time limited3
- Can't execute PHP w/o significant effort1
Cons of Docker
- New versions == broken features8
- Unreliable networking6
- Documentation not always in sync6
- Moves quickly4
- Not Secure3