tags: engineering, cloudflare, worker
What
- serverless computation .eg "lambda function"
- create & deploy directly on Cloudflare
- arguably the most accessible serverless platform
Why
- No cold start 🚀
- Cheap & fast 💸
- 100k free reqs, reset daily
- Aim to get you started & deploy quickly (workers.new)
- Perfect deploy platform for SSR apps
Simple yet smartly made api 🎯
- CF worker api is implemented after the standard Service worker api, hence the name "Worker"
- Request routing made easy, just inspect incoming
request
url/method/.etc like you normally did on browser
- for AWS you'll have to mess with Route53 to get the right behavior (and eventually got slapped with CORS issues)
- Service worker is a web standard created specifically for intercepting request/response, and has been around for some times
- By implementing CF Worker after Service worker api, Cloudflare made it familiar for JS web devs to easily get used to the api, while avoid re-inventing yet another serverless api like AWS Lambda or Google Cloud functions .etc
Batteries included
- built-in fast KV store with async api
- in contrast AWS/Google/Azure require you to use their platform services .eg RDS, SQS bla bla with their own setup ceremonies to further complex your setup
- ScheduledEvent, WebSocket, Stream, HTML rewriter, rate limit
- Durable objects: a transactional, key-value storage API