fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

Support creating a snapshot from a DB dump #78

Open oyamauchi opened 5 years ago

oyamauchi commented 5 years ago

We have a scheduled job to create a snapshot of our prod Postgres database on a scratch server, to allow devs to work with the prod data and quickly restore to a clean state:

  1. pg_dump the prod database
  2. pg_restore it on the scratch DB server
  3. stellar snapshot the restored DB on the scratch server
  4. Devs have their own DBs on the scratch server and can restore that snapshot to them

Steps 2 and 3 seem redundant: there's the restored copy and Stellar's copy, both of which take a long time to create (this database is pretty large). It doesn't seem like a stretch for Stellar to support creating a snapshot directly from a dump file. Do you think this is feasible?