INTEGRITY Cloudflare Docs

Consistency model

This page details R2's consistency model, including where R2 is strongly, globally consistent and which operations this applies to.

R2 can be described as "strongly consistent", especially in comparison to other distributed object storage systems. This strong consistency ensures that operations against R2 see the latest (accurate) state: clients should be able to observe the effects of any write, update and/or delete operation immediately, globally.

Terminology

In the context of R2, strong consistency and eventual consistency have the following meanings:

Operations and Consistency

Operations against R2 buckets and objects adhere to the following consistency guarantees:

Action Consistency
Read-after-write: Write (upload) an object, then read it Strongly consistent: readers will immediately see the latest object globally
Metadata: Update an object's metadata Strongly consistent: readers will immediately see the updated metadata globally
Deletion: Delete an object Strongly consistent: reads to that object will immediately return a "does not exist" error
Object listing: List the objects in a bucket Strongly consistent: the list operation will list all objects at that point in time
IAM: Adding/removing R2 Storage permissions Eventually consistent: A new or updated API key may take up to a minute to have permissions reflected globally

Additional notes:

Caching

When connecting a custom domain to an R2 bucket and enabling caching for objects served from that bucket, the consistency model is necessarily relaxed when accessing content via a domain with caching enabled.

Specifically, you should expect:

The cache does not affect access via Worker API bindings or the S3 API, as these operations are made directly against the bucket and do not transit through the cache.