Amazon S3 Replication: Key Concepts and Best Practices
Amazon S3 Replication enables automatic copying of objects from one bucket (source) to another bucket (destination). This feature is useful for backup, disaster recovery, compliance, and data synchronization across AWS regions or within the same region.
1. How S3 Replication Works
- Once replication is enabled, only new objects are replicated.
- Existing objects are not automatically copied—you must use S3 Batch Replication to replicate them.
- Replication rules can be configured at the bucket level or for specific prefixes/tags.
2. Handling Existing and Failed Objects
A. Replicating Existing Objects
If you need to replicate pre-existing objects, use S3 Batch Replication:
- It allows replication of objects that existed before enabling replication.
- It also retries and replicates objects that previously failed replication.
B. Replicating Delete Markers
- Optional: You can choose to replicate delete markers from the source to the target bucket.
- Permanent deletes (with version ID) are NOT replicated to prevent accidental or malicious deletion from propagating.
🚀 Example:
If an object is soft deleted (a delete marker is added), this can be replicated.
However, if an object is permanently deleted (with version ID), it will not be replicated.