Skip to content

S3 Replication - Replica Modification Sync

0

Two regions, us-east-1 and us-east-2. I have one bucket in each region and they are configured with replica modification sync. I have a process that may write the same object at the same time to both us-east-1 and us-east-2 buckets. What does S3 replication do in this scenario? Does it do anything or take no action?

asked a year ago676 views
1 Answer
2
Accepted Answer

The "Modification Sync" feature ensures that changes made to replica objects are propagated back to the source object, creating a two-way synchronization. It maintains consistency between the source and destination buckets by syncing metadata changes and overwriting objects with the most recent version.

When you write the same object simultaneously to both buckets:

1. Write Operations: Each bucket (us-east-1 and us-east-2) will receive the write operation independently.

2. Replication Process: Both buckets will trigger replication for the new or modified objects as per their replication configuration. If an object with the same key is written to both buckets simultaneously, each bucket will initiate a replication operation to the other bucket.

3. Conflict Resolution: Amazon S3 does not inherently provide conflict resolution for simultaneous writes. Each bucket will try to replicate the object to the other bucket. The final state of the object will depend on which replication operation completes last. The last write wins, meaning the object version with the latest timestamp will be the final state in both buckets. S3 uses timestamps to determine the most recent version of an object, and the object with the latest timestamp will overwrite the older version.

In this scenario, S3 replication will attempt to replicate the objects, and the final version of the object will be determined by the latest timestamp. The replica modification sync feature will ensure that both buckets eventually have the same latest version of the object. However, this behavior might lead to an unintended overwrite of the object if simultaneous writes occur frequently.

To avoid conflicts, consider using mechanisms to ensure that writes are not performed simultaneously or implement application-level logic to handle such scenarios.

EXPERT
answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.