Saltar al contenido

Suggestion: Use RDS Blue/Green deployment to restore a snapshot

0

I regularly restore a prod RDS snapshot to our lower environments so the devs have fresh data to work with. Currently the process is:

  1. Create a snapshot in prod and share with dev account
  2. Create a new database from snapshot with temp name (I use Aurora Serverless v2, but shouldn't matter)
  3. Rename current DB
  4. Set master password of new DB to dev's current password
  5. Rename new DB to match old one and
  6. Confirm dev app works then delete old DB

This works fine, avoids a redeploy but it's slow and multiple manual steps. I would love to pick a database and select "restore from snapshot" and have AWS prompt for the dev password then do steps 2-6.

Is there already a better way? I haven't tried to script it out but maybe worth a shot.

preguntada hace 3 meses74 visualizaciones
1 Respuesta
0

Amazon RDS Blue/Green Deployments could be a good alternative to your current process, though it's not specifically designed for snapshot restoration across environments.

Blue/Green Deployments create a staging environment (green) that mirrors your production environment (blue), keeping them in sync. This approach would allow you to:

  1. Create a Blue/Green deployment of your dev environment
  2. Apply the production snapshot to the green environment
  3. Test that everything works correctly
  4. Switch over with minimal downtime (typically under one minute)

The main advantages would be:

  • Reduced downtime for your dev environment
  • Simplified switchover process
  • No need to manually rename databases
  • Built-in switchover guardrails for safety

However, there are some considerations:

  • Blue/Green Deployments are supported for RDS for MariaDB, MySQL, and PostgreSQL (versions 11.1 and higher)
  • For Aurora PostgreSQL, it's supported for version 11 and higher
  • The feature is designed primarily for database updates rather than cross-environment refreshes

If you're using a supported database engine and version, this approach could streamline your process. Otherwise, scripting your current workflow using AWS CLI or SDK might be your best option to automate the manual steps.
Sources
Using Amazon RDS Blue/Green Deployments for database updates - Amazon Relational Database Service
Upgrade strategies for Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL 12 | AWS Database Blog
Supported Regions and DB engines for Amazon RDS Blue/Green Deployments - Amazon Relational Database Service
Implement a rollback strategy for Amazon Aurora PostgreSQL upgrades using Amazon RDS Blue/Green deployments | AWS Database Blog

respondido hace 3 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.