We used Cloudflare's workers platform to build a serverless system that can scale up to billions of events per day, and scale down to zero, while minimizing infrastructure costs and maintenance. Workers Analytics Engine allows for immediate reads at high rps, while enabling efficient queries across massive datasets.

Sequence diagram showing the flow of data and operations in our architecture.
These estimates are based on current Cloudflare pricing. Batching 2000 events per call significantly reduces costs. Actual monthly costs may vary based on processing complexity and event volume.
Note: Analytics Engine is currently free, which further reduces the overall cost of the system ($1.50 to handle 1 billion events per day.).
Cost Reduction: