A leading online travel platform, relies heavily on delivering high-quality images of holiday destinations, hotels, and packages to its users. These images are currently stored in an Amazon S3 bucket located in the North Virginia region. However, users accessing the site from regions far from North Virginia, particularly from Asia-Pacific areas, are experiencing significant latency issues. This latency negatively impacts the user experience, as images load slowly, leading to potential customer dissatisfaction and reduced engagement on the platform.
Solution:
To address this latency issue, the management at Travel Triangle decided to implement Amazon S3 Cross-Region Replication (CRR). By replicating the images from the North Virginia S3 bucket to a new S3 bucket in the Mumbai region, users in the Asia-Pacific region will experience faster load times, as the images will be served from a geographically closer location.
The replication setup ensures that any new images uploaded to the North Virginia bucket are automatically replicated to the Mumbai bucket. This solution not only improves the user experience by reducing latency but also provides an additional layer of data redundancy, enhancing the overall availability and resilience of the application.
By implementing S3 Cross-Region Replication, Travel Triangle can now offer a seamless and faster browsing experience to its global user base, thereby maintaining its competitive edge in the travel industry.
Introduction
What’s Cross-Region Replication (CRR) ?
- Cross-Region Replication allows you to automatically replicate data from one S3 bucket to another in a different AWS region. This helps in achieving compliance requirements, minimizing latency for geographically dispersed users, and enhancing disaster recovery capabilities.
- With CRR, you can replicate the entire bucket or just specific objects, and you have control over which objects get replicated.
- Replication is asynchronous, meaning changes to the source bucket are eventually replicated to the destination bucket. However, it’s important to note that replication does not retroactively replicate objects already in the source bucket before replication was enabled.
- You can use CRR to maintain redundant copies of your data in different geographic locations, improving data durability and availability.
[ Good Read: Uploading Files Using Pre-Signed URLs to a Specific Storage Class ]
What’s Versioning ?
- Versioning in S3 allows you to keep multiple variants of an obje
ct in the same bucket and it is essential for CRR in both buckets. Each time you overwrite an object or delete it, a new version is created, which you can retrieve later if needed. - Versioning helps protect against accidental deletion or overwriting of objects. Even if an object is deleted or overwritten, previous versions remain accessible.
- By enabling versioning, you can create a reliable versioned backup system within a single bucket, without the need for additional replication or backup solutions.
- It’s important to note that versioning does not protect against all types of data loss scenarios, such as the accidental deletion of an entire bucket with versioning disabled.
Architecture Diagram
Task Steps
Step 1: Sign in to AWS Management Console
- On the AWS sign-in page ,enter your credentials to log in to your AWS account and click on the Sign in button.
- Once Signed In to the AWS Management Console, Make the default AWS Region as US East (N. Virginia) us-east-1
- Navigate to the Services menu at the top. Click on S3 in the Storage section.
Step 2: Source Bucket
This is the source bucket ” tt-stage-docs ” along with the path “attachments/ pictures/ ” in which images get uploaded . Create the appropriate bucket policy in order to provide required permissions for CRR.
Step 3: Target Bucket
This is the destination bucket ” tt-stage-json-apis ” in which we want to replicate images from source bucket as described above. Here we need to create appropriate bucket policy in order to provide required permissions for CRR.
You can check more info about: Setup Cross Region Replication in S3.