pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Julie Nishimura <juliezain@hotmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: automated refresh of dev from prod
Date: Thu, 28 Feb 2019 11:04:32 -0500
Message-ID: <20190228160432.GA6197@tamriel.snowman.net> (raw)
In-Reply-To: <BYAPR08MB501441722BD39A2BD488AD00AC740@BYAPR08MB5014.namprd08.prod.outlook.com>
References: <BYAPR08MB501441722BD39A2BD488AD00AC740@BYAPR08MB5014.namprd08.prod.outlook.com>

Greetings,

* Julie Nishimura (juliezain@hotmail.com) wrote:
> Hello everybody, I am new to postgresql environment, but trying to get up to speed.
> Can you please share your experience on how you can automate refreshment of dev environment on regular basis (desirably weekly), taking for consideration some of prod dbs can be very large (like 20+ TB
> 
> Any suggestions?

The approach that I like to recommend is to have your backup/restore
solution be involved in this refreshing process, so that you're also
testing that your backup/restore process works correctly.  For dealing
with larger databases, using a backup tool which has parallel backup,
parallel restore, and is able to restore just the files which are
different from the backup can make the restore take much less time (this
is what the 'delta-restore' option in pgbackrest does, and it was
specifically written to support exactly this kind of prod->dev periodic
refresh, though other tools may also support that these days).

As mentioned elsewhere on this thread, using snapshots can also be a
good approach though you have to be sure that the snapshot is completely
atomic across all filesystems that PostgreSQL is using, or you have to
deal with running pg_start/stop_backup and putting a backup_label into
place for the restored snapshot and a recovery.conf to provide a way for
PG to get at any WAL which was generated while the snapshot (or
snapshots) was being taken.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (5+ messages)  latest in thread

Message-ID: <20190228160432.GA6197@tamriel.snowman.net>
Permalink:  ../20190228160432.GA6197@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20190228160432.GA6197@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sfrost@snowman.net, juliezain@hotmail.com
  Subject: Re: automated refresh of dev from prod
  In-Reply-To: <20190228160432.GA6197@tamriel.snowman.net>
  References: <BYAPR08MB501441722BD39A2BD488AD00AC740@BYAPR08MB5014.namprd08.prod.outlook.com> <20190228160432.GA6197@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox