Hello Everyone, in this article we are going to discuss the benefits of S3’s cross-region replication.\n\nAs you may already know from our previous discussion that S3 stores data by making copies across multiple availability zones in a single region.\n\nIn cross-region replication, the data stored in a bucket is replicated automatically and asynchronously across a bucket in a different region.\n\nFor example — Let’s say you have two buckets A and B. Bucket A is present in us-east-1 (Northern Virginia) region while bucket B is present in ap-south-1 (Mumbai) region. \nBucket A is set up to cross-region replicate to bucket B. Now if you store a file in bucket A, that file will automatically be copied to the bucket B.\n\nCross-region replication can be used to back up your data in another region.\n\n#### Conditions for enabling Cross-region replication\n\n1. Versioning must be enabled on both the source and destination buckets.\n2. Regions must be unique.\n3. Amazon S3 must have permissions to replicate objects from the source bucket to the destination bucket on your behalf.\n\n#### Facts about Cross-region replication\n\n1. Files in an existing bucket are not replicated automatically but all the subsequent updated files will be automatically replicated.\n2. You cannot replicate to multiple buckets or use daisy chaining (from bucket A to bucket B to bucket C).\n3. Delete markers are replicated.\n4. Deleting individual versions or delete markers will not be replicated.\n\n**What is Versioning? \n**If you store multiple objects with the same name, that object is overwritten and you only get the latest object.\n\nWhen versioning is enabled multiple versions of the object with the same name are created. This can be used to prevent accidental overwriting of objects.\n\n**What are delete markers? \n**When you delete an object in a versioning enabled bucket, that object is not deleted from the bucket, but instead, a delete marker is created.\n\nYou can use this delete marker to recover the deleted object. Once you delete this delete marker, that object cannot be recovered.\n\n### Let’s get Practical\n\nNow it’s time to see cross-region replication in action. Login to your AWS console and click on S3.\n\n!(https://hackernoon.com/hn-images/1*hRnJzrTSfWs15J6N6AKTCg.png)\n\n1\\. Create two buckets in **different** regions. Here I am creating the source bucket **jca-source** in the US East (N. Virginia) region and destination bucket **jca-destination** in the Asia Pacific (Mumbai) region. \nYou can choose any regions you want but they must be different.\n\n!(https://hackernoon.com/hn-images/1*hfqBpAQlB10e07G-A3xOqw.png)\n\n2\\. Select the source bucket, click on properties tab and enable versioning.\n\n!(https://hackernoon.com/hn-images/1*CMV1oCS7gg9-mbAvSdCn9w.png)\n\n3\\. Click on the Management tab, select Replication and click on the Add Rule button.\n\n!(https://hackernoon.com/hn-images/1*V8eDBGbq_ty6ebvx6qkOvA.png)\n\n4\\. We would like to set the entire bucket as the source so leave the default settings and click Next. Now select your destination bucket, since we have not enabled versioning on the destination bucket yet we see the Enable Versioning button. Click on it and click Next. \nYou can also see that at this point you have the option to change the storage class for the replicated objects. You can optimize your costs by choosing the option most appropriate for your use case, but here I am leaving it unchecked.\n\n!(https://hackernoon.com/hn-images/1*mBDwmOjlupYep9oYuBvHpw.png)\n\n5\\. Now you have to give S3 permissions to replicate objects. Just select **Create new role** in the IAM role field and give a name to your rule. Make sure enabled is selected and click Next.\n\n!(https://hackernoon.com/hn-images/1*3Fu0_trr0Nx6146Q6JpN_g.png)\n\n6\\. Review your Replication rule and click Save to enable cross-region replication.\n\nNow, you can test your cross-region replication. Upload a file to your source bucket. When it’s done uploading, you should see the same file in your destination bucket.\n\nI hope you got something better out of this article.\n\nIf you liked it, please give a few claps so it reaches more people who would love it!