We used to have some specific problems…
- "We’re expecting requests per second to fluctuate between 2 and 30,000."
- Oops, we put the wrong instance in the load balancer.
- Oops, beanstalk crapped its pants.
But in 2015, we discovered AWS Lambda and it changed the frame of reference for a lot of problems.
We went from bare metal, to VPS setups, to Platform as a Service (Heroku), to containers (Docker), to FaaS – Function as a Service, currently best represented by AWS Lambda.
AWS Lambda lets you run Python (or Node.js or Java) code in a transient environment that has a minimum lifetime of a split second.
An instance of your code (function) spins up as a response to an event:
- HTTP request (via AWS API Gateway)
- S3 bucket change
- Database change (limited to AWS databases)
- Time schedule
and in turn performs an action that can also manipulate these sources.
The AWS Lambda page has a few good examples to explain this.
- No need to manage system resources
- Infinitely scalable, highly available
- Pay only for execution time in 0.1 second increments
- Less devops work
- Full integration with AWS ecosystem
- No way to manage system resources (apart from memory size, I guess)
- Cannot serve files or data internally
- Stateless and untraceable after it runs
- Lock-in to AWS ecosystem
- Manage user thumbnails (nikashitsa/aws-lambda-thumb)
- Chatbots / tweetbots (Check out this blog post)
- Scheduled database processes
- Serverless Django (Miserlous/django-zappa)
- Machine learning (here's a simple tutorial)
- DDoS cluster (just don't do it)
- SSH certificate authority (Netflix/bless)
- Optical Character Recognition / Visual Identity matching over at Parkour, soon
- 50 MB max. deployment package (zipped)
- 512 MB max. disk space use per function (unzipped)
- 1024 processes / threads per runtime
- 5 minute maximum execution time
- 6 MB max. invocation / response payload The official suggestion is, if you exceed these limits, it can probably be split into multiple microservices.
About me
- @yesokayawesome / [email protected]
- former product manager at OnePlus
- seeking experienced developers to join my startup, Parkour
Parkour turns your car into a giant credit card via its visual identity. Never get out of your car to pay for parking, gas, or your McDrive meal again!
Join us: [email protected]