MMS • RSS
Article originally posted on InfoQ. Visit InfoQ
In its Building With Workers KV blog post Cloudflare provides a number of examples for what can be done with the technology. These include implementing an API Gateway that uses access tokens, dynamic data in pages (e.g. for translations), configuration such as feature flags, and stateful cloud functions. They also detail limits and pricing:
- Up to 1 billion keys per namespace
- Keys of up to 2 kB
- Values of up to 64 kB
- Eventually consistent, global consistency within 10 seconds
- 100k+ reads per second per key
- Up to one write per second per key
$5 monthly Workers compute minimum includes 1 GB of KV storage and up to 10 million KV reads. If you use less than the 10 million included Worker requests now, you can use KV without paying a single cent more.
Beyond the minimums, Workers KV is billed at $0.50 per GB-month of additional storage and $0.50 per million additional KV reads.
Cloudflare compares Workers to Amazon’s Lambda functions, though possibly a fairer comparison would be Lambda@Edge, which runs functions in the AWS CloudFront Content Delivery Network (CDN). In both cases the services are providing a third place (at the edge of a global CDN) to do processing so that it doesn’t have to take place in the browser (or API client) or at the origin. The purpose of such edge hosting is to provide low latency by having points of presence close to the client, whilst at the same time taking the compute overhead (and accompanying security concerns) away from the client. By enabling stateful services Cloudflare has opened up the possibility of ‘originless’ services that exist purely at the edge with no centralised point of origin.
Prior to the announcement of Workers support for WebAssembly Cloudflare’s CEO Matthew Prince tweeted, ‘Long term, it may well be the biggest industry-changing announcement we’ve made all month.’ Given the pressure other Functions as a Service (FaaS) platforms have come under to provide polyglot language support WebAssembly might turn out to be an easy way to keep developers happy; so long as today’s tool chain issues erode under the pressure of broader adoption.