Search code examples
databasestaging

Staging database predicament


Suppose that there are 3 databases for

  • Production
  • Staging
  • Dev

As far as I know, Staging database need to be in sync with Production database But,

When we are developing, we can do whatever we want with Dev database and change schema. Now here comes the Chicken & Egg problem.

To test in Staging, Staging database schema need to be changed according to changes made in Dev database. But the Staging database need to be in sync with Production.

How do you guys get around this problem?


Solution

  • Staging needs to be in sync with production, only up to the point where you are deploying new changes.

    That or make a 4th environment called Test where new upgrades are validated. We call ours UAT/Test, and it is typically a second database on the Staging server.

    Exact methodology will depend on how you are keeping things in sync. Are you actually using replication? Or just a backup/restore of Prod to Stage?