Is this advocating the use of production data in dev/test/qa environments? I am struggling to come up with scenarios where that would be a good idea.
Thin PostgreSQL Clones
11–20 of 37 posts
Re: Thin PostgreSQL Clones
#12Is this advocating the use of production data in dev/test/qa environments? I am struggling to come up with scenarios where that would be a good idea.
I have always made clones of production data on my dev machine for testing -- it has the added benefit of also regularly testing my DB backup restoration process. How else do you test and optimize SQL queries that are only slow with production-size data? If the data is too big to fit on my machine, I might clone to a nearby colocated server. Testing your DB backup and restoration mechanism becomes even MORE important…
With something like this https://www.getsynth.com/docs/blog/2021/03/09/postgres-data-... (disclaimer: no affiliation with them, I've not used their product but it appears to be fully open source)
Re: Thin PostgreSQL Clones
#13Earlier quoted context omitted.
I have always made clones of production data on my dev machine for testing -- it has the added benefit of also regularly testing my DB backup restoration process. How else do you test and optimize SQL queries that are only slow with production-size data? If the data is too big to fit on my machine, I might clone to a nearby colocated server. Testing your DB backup and restoration mechanism becomes even MORE important…
> How else do you test and optimize SQL queries that are only slow with production-size data? With something like this https://www.getsynth.com/docs/blog/2021/03/09/postgres-data-... (disclaimer: no affiliation with them, I've not used their product but it appears to be fully open source)
Random data may give incorrect results when optimizing a query.
Re: Thin PostgreSQL Clones
#14Re: Thin PostgreSQL Clones
#15Re: Thin PostgreSQL Clones
#16This looks like a really useful tool for staging and development environments, and it's even OSS that can be self-hosted! Does anybody here have any real-life experiences with it they could to share?
For more real-life feedback, welcome to the Database Lab Community Slack: https://slack.postgres.ai/
Re: Thin PostgreSQL Clones
#17It’s a tool that clones Postgres databases. It’s not a clone of Postgres the application.
Re: Thin PostgreSQL Clones
#18Is this advocating the use of production data in dev/test/qa environments? I am struggling to come up with scenarios where that would be a good idea.
Not sure about webapps but in analytics, this is a common practice. Real data has too many exceptions and edge cases. If you dont develop and test with real data, you will end up effectively developing or testing on production.
Re: Thin PostgreSQL Clones
#19The shell script that implements the idea with LVM snapshots (relies on an existing Postgres physical replica) is not too long. It's used over SSH.
$ wc -l /usr/local/bin/snapshot-*
164 /usr/local/bin/snapshot-create
16 /usr/local/bin/snapshot-drop
180 total
Had this tool existed at the time, I'd have probably used it (monitoring and REST API might be handy). Still, the core idea can be implemented very easily.[1]: https://www.sedlakovi.org/blog/2019/03/fast-postgres-snapsho...