What is Cross Region-Replication?
There are many other ways that Amazon S3 has been put to use. Cross-region replication was conceptualized in response to customer feedback on Amazon’s service. You can use AWS Backup to automatically replicate backups as part of a scheduled backup plan or on demand to several AWS Regions. CRR is beneficial if your business continuity or compliance mandates that backup data be kept at least a certain distance from production data.
You may easily copy or replicate your data in two separate AWS regions using the AWS S3 cross-region replication (CRR) feature.
Over the current versioning functionality of S3, this feature has been developed. When CRR is enabled, any object uploaded to an S3 bucket at one AWS site automatically duplicates itself at another AWS location in another geographical area.
Amazon S3 Introduces Cross-Region Replication
Cross-region replication is a function that automatically replicates data between AWS regions supported by Amazon S3. Every object uploaded to an S3 bucket is automatically duplicated with CRR to a destination bucket in your chosen AWS region. CRR can be used to offer lower-latency data access in several geographical locations.
It can also be helpful if you must store data copies hundreds of kilometers apart for regulatory reasons. The use of CRR is free of charge. The replicated copy of the data is subject to the standard fees for requests, inter-region data, and storage transmission imposed by Amazon S3.
How to Set Up AWS Cross-Region Replication?
Minimum Requirements
● Understanding of Amazon S3.
● An active IAM-permitted Amazon S3 account.
● A basic understanding of data replication.
Steps to set up CRR in S3:
– Create two buckets in the AWS S3 console.
– Keep the source bucket in the Asia Pacific- (Mumbai) ap-south one region and give it a name like source1. Remember to turn on versioning. Also, remember that the S3 bucket name must be globally distinct; as a result, try adding random digits after the bucket name.
– Now, create a destination bucket using the same procedures. Name it destination1 with versioning turned on, but select a new region this time.
– Go to the management tab after selecting your source bucket from the menu.
– Give your replication rule the name “replicate1” and then click “Create a replication rule.”
– Select “destination1” as the destination bucket.
You may have seen that you can select a destination bucket in another account.
– You must create an IAM role to replicate objects from the source bucket to the destination bucket. So simply click “create a new role” to do so.
– Check the “Replication Time Control (RTC) option if you want the S3 objects to be copied in under 15 minutes. However, there will be a fee for this. So let’s continue without enabling it for the time being and click save.
– A box will appear asking if you want to duplicate existing objects in the S3 bucket as soon as you click on save. However, doing so would result in fees, so we will continue without reproducing already-existing objects and click on submit.
– You will get a screen displaying “Replication configuration successfully updated” once this setup is complete.
– Now is the moment to test! Now upload a file to the source bucket: source1.
– Visit the destination bucket at destination1 to see if the uploaded file has been copied. Notice that the target bucket has received a successful copy of the submitted file.
– A box will appear asking if you want to duplicate existing objects in the S3 bucket as soon as you click on save. However, doing so would result in fees, so you can continue without replicating already-existing objects and click on submit.
– You will get a screen stating, “Replication configuration successfully updated” once this setup is complete.
– Now is the moment to test! Upload a file to the source bucket: source1.
Note: Remember to empty your buckets and remove them if you finish using them. Additionally, if a bucket is not empty, you cannot delete it.
Features of AWS Cross-Region Replication
● It facilitates the effortless transfer of objects from one S3 bucket to another S3 bucket in different locations.
● Only when both buckets’ versioning features are enabled can it be used.
● Data is encrypted to safeguard an object from SSL attacks when copied from one bucket to another.
● Data is not replicated even if the operation is carried out if the copied data from the source bucket already exists in the destination bucket. This prevents redundant data from being saved.
Points to Remember during Cross-Region Replication
The following is necessary for replication.
– The source and destination AWS Regions must be enabled for the source bucket owner’s account. The destination Region must be enabled for the account of the owner of the destination bucket.
– Versioning must be turned on in both the source and destination buckets. Use the section Using versioning in S3 buckets for additional details on versioning.
– To replicate objects on your behalf from the source bucket to the destination bucket or buckets, Amazon S3 needs permission.
– The object owner must provide the bucket owner READ ACP and READ permissions with the object ACL (access control list) if the source bucket’s owner does not own the item in the bucket.
– The destination buckets must have S3 Object Lock enabled if it is enabled on the source bucket.
In a cross-account context, when distinct AWS accounts on the source and destination buckets, the following additional criterion applies:
– To replicate items using a bucket policy, the owner of the destination buckets must provide the owner of the source bucket permissions.
– It is not possible to set up the destination buckets as Requester Pays buckets.
When can Cross Region Replication be Used?
It applies in the following cases:
● Comply with regulations – Although Amazon S3 stores your data across several geographically remote Availability Zones by default, compliance regulations may mandate that you store data further away. Use CRR to duplicate data between distant AWS Regions to meet these requirements.
● Reduce latency – If your users are spread over two different regions, you can reduce the time it takes to access objects by keeping copies of them in the AWS Regions closest to them.
● Improve operational efficiency – If you have to compute clusters analyzing the same set of objects in two separate AWS Regions, you could decide to keep object copies in those Regions.
Bottomline
This post explains AWS features, such as the CRR, which enables seamless object data copying from one S3 bucket in one AWS region to another in a different region.