Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Built a Multi-Region Pilot Light on AWS. The Diagram Was the Easy Part.

Most disaster recovery write-ups stop at the diagram. You get two boxes, an arrow labelled "replicate", and an RTO that was never measured. I wanted the rest of the story: real Terraform, a failover you can time, and a written answer for every trade-off including the ones that only look smart at demo scale. So I built a notes API across two AWS regions in the pilot light pattern, then reviewed…

The article describes a multi-region disaster recovery setup on AWS using the "pilot light" pattern, which aims to minimize downtime and costs during a failure event. The key aspects of this implementation are:

1. Primary region (eu-west-1) serves all production traffic, while the secondary region (eu-west-3) holds a standby configuration with no active application instances.

2. Route 53 monitors the health of the primary region every 10 seconds. If the primary region fails the health check, DNS is automatically switched to the secondary region, allowing the client to continue accessing the application without any changes to their configuration.

3. The failover process involves promoting the read replica database in the secondary region and scaling up the Auto Scaling group in both regions. This is achieved through a simple script that runs in parallel, minimizing the downtime.

4. The system uses PostgreSQL for the database, Amazon S3 for object storage, and AWS Secrets Manager to securely store the database password. The same infrastructure is mirrored in both regions, with the only difference being the writable database and desired ASG capacity (2 instances in Ireland and 0 in Paris).

5. The pattern is chosen based on recovery objectives, specifically targeting an RPO (Recovery Point Objective) of under 1 minute and an RTO (Recovery Time Objective) of under 30 minutes. This approach offers a cost-effective solution compared to other patterns like warm standby or active-active setups.

6. The Terraform setup is used to provision the infrastructure in both regions, ensuring consistency between them. The design is simple, with a focus on the architecture rather than the specific application logic.

In summary, this AWS multi-region implementation utilizes the pilot light pattern to achieve fast failover and minimal downtime, with a focus on cost-efficiency and measurable recovery objectives. The setup is fully automated, relying on Terraform for provisioning, Route 53 for DNS management, and AWS services like RDS, S3, and Secrets Manager for data storage and security.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How Databricks Serverless Compute Cost My Team $14k in One Weekend

It’s Sunday, 2:14 AM. The PagerDuty alert hits my phone with that specific, jarring frequency that makes your stomach drop before you’ve even opened your eyes.

  • PagerDuty alert revealed 80% of monthly cloud spend in 48 hours
  • Auto-stop setting at 10 minutes failed to stop warehouse due to heartbeat
  • Issue resolved by killing connection, updating settings, and implementing Budget Alarm

More from Monday 21 September →