# Serverless Deployment

> Deploy functions not servers — pay per invocation, scale to zero automatically.

- **Category**: Microservices
- **Subcategory**: Deployment
- **Canonical URL**: https://designpattern.fyi/patterns/serverless_deployment/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Image processing service deployed as a Lambda. S3 upload triggers the function. AWS scales from 0 to 1000 concurrent executions automatically. No EC2 instances, no capacity planning, billed per image processed.





## Trade-offs


### Advantages

- Zero server management — platform handles everything

- Automatic scaling from 0 to massive concurrency

- Pay-per-use billing — no idle server costs

- Fast to deploy and iterate




### Considerations & Drawbacks

- Cold starts add latency (first invocation after idle period)

- Execution limits — max 15 min for Lambda, limited memory

- Vendor lock-in — Lambda code doesn't run cleanly on-prem

- Local development and testing is harder

- Stateless-only — no persistent connections or shared memory







---
**Reference**: [Original Source](https://microservices.io/patterns/deployment/serverless-deployment.html)

