CodePark/ questions / S3 & object storage
START PRACTICINGPRACTICE
Backend question · Cloud & AWS › S3 & object storage

Your service overwrites reports/today.json in S3 and the PUT succeeds. Immediately afterwards another process GETs the same key. What does it receive?

The new version, because S3 provides strong read-after-write consistency

It receives the new version. Since December 2020, S3 gives strong read-after-write consistency. This means a read right after a successful write always sees that write. It applies to PUTs and DELETEs of objects, and to list operations.

"Possibly the old version for a few seconds, because S3 is eventually consistent for overwrites" is outdated information that people still repeat.


One caveat: if two writers write the same key at the same time, the last write wins.