Let me give an example use case that
Let me give an example use case that demonstrates the issue then.
Let's say we are building a cloud storage product, where customers can upload files, and each customer is billed for the total size of all their uploads.
Let's build this with DO, where each customer has their own DO which stores the information of total size in SQLite storage. On a request for uploading a file, the DO would:
- Upload the file to R2.
- Increase the total size in storage.
- Return a success response.
Now here's an example where this would fail:
- The upload to R2 goes through.
- The total size increment goes through.
- The success response is returned.
- DO holds the response until the increment write gets confirmed (output gate).
- The write confirmation failed.
- SQLite storage does not get changed, an error response is returned instead, yet the R2 upload has already gone through, and at this point the DO code has no opportunity to undo the upload.
Let's say we are building a cloud storage product, where customers can upload files, and each customer is billed for the total size of all their uploads.
Let's build this with DO, where each customer has their own DO which stores the information of total size in SQLite storage. On a request for uploading a file, the DO would:
- Upload the file to R2.
- Increase the total size in storage.
- Return a success response.
Now here's an example where this would fail:
- The upload to R2 goes through.
- The total size increment goes through.
- The success response is returned.
- DO holds the response until the increment write gets confirmed (output gate).
- The write confirmation failed.
- SQLite storage does not get changed, an error response is returned instead, yet the R2 upload has already gone through, and at this point the DO code has no opportunity to undo the upload.

