skip to Main Content

I read S3 doc that PUT is atomic, in the sense there is never a partial write to an object. My naive intuition is that, there might be some underlying locking mechanism that assures the atomicity. Does that mean that during an object is being updated, reads for the object with the same key will be rejected? (I searched around the S3 documentation but did not find a good answer)

2

Answers


  1. Does that mean that during an object is being updated, reads for the object with the same key will be rejected?

    No. It means that you will get a current version, until the update fully finishes.

    Login or Signup to reply.
  2. @marcin has already answered and his answer should be the accepted answer

    Do note there will be an exception in single case as stated in the docs

    Updates to a single key are atomic. For example, if you make a PUT request to an existing key from one thread and perform a GET request on the same key from a second thread concurrently, you will get either the old data or the new data, but never partial or corrupt data.

    Just for the sake of documentation to validate. what Marcin said https://aws.amazon.com/s3/consistency/

    After a successful write of a new object, or an overwrite or delete of an existing object, any subsequent read request immediately receives the latest version of the object. S3 also provides strong consistency for list operations, so after a write, you can immediately perform a listing of the objects in a bucket with any changes reflected.

    For all existing and new objects, and in all regions, all S3 GET, PUT, and LIST operations, as well as operations that change object tags, ACLs, or metadata, are now strongly consistent. What you write is what you will read, and the results of a LIST will be an accurate reflection of what’s in the bucket.

    This clearly means you will always get the latest version of the bucket. if the latest version is ( old that is update is in progress) you will get the current version. Once updated then only you will get the latest version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search