Live data from Hacker News

Instant database clones with PostgreSQL 18

boringsql.com

121–130 of 168 posts

Re: Instant database clones with PostgreSQL 18

#121
we just build the database, commit it to a container (without volumes attached), and programmatically stop and restart the container per test class (testcontainers.org). the overhead is < 5 seconds and our application recovers to the reset database state seamlessly. it's been awesome.

Re: Instant database clones with PostgreSQL 18

#122

Earlier quoted context omitted.

Let's say there is an architect and he also owns a construction company. This architect, then designs a building and gets it built from of his employees and contractors. In such cases the person says, I have built this building. People who found companies, say they have built companies. It's commonly accepted in our society. So even if Claude built for it for GP, as long as GP designed it, paid for tools (Claude) to…

Every single commit is Claude. No human expert involved. Would you trust your company database to an 25 dollars vibe session? Would you live in a 5 dollars building? Is there any difference from hand tailored suit, constructed to your measurements, and a 5 dollars t-shirt? Some people don't want to live in a five dollars world.

Most of the OSS projects on HN are not worthy for you to base your company on, especially sight unseen. Using an agent has nothing to do with it.

Re: Instant database clones with PostgreSQL 18

#123

For anyone looking for a simple GUI for local testing/development of Postgres based applications. I built a tool a few years ago that simplifies the process: https://github.com/BenjaminFaal/pgtt

Is this basically using templates as "snapshots", and making it easy to go back and forth between them? Little hard to tell from the README but something like that would be useful to me and my team: right now it's a pain to iterate on sql migrations, and I think this would help.

Thats exactly what it is, just try it with the provided docker-compose file you will get it then.

Re: Instant database clones with PostgreSQL 18

#124

PostgreSQL seems to have become the be-all, end-all SQL database that does everything and does it all well. And it's free! I'm wondering why anyone would want to use anything else at this point (for SQL).

“does it all well” is a stretch.

Any non-trivial amount of data and you’ll run into non-trivial problems.

For example, some of our pg databases got into such state, that we had to write custom migration tool because we couldn’t copy data to new instance using standard tools. We had to re-write schema to using custom partitions because perf on built-in partitioning degrades as number of partitions gets high, and so on.

Re: Instant database clones with PostgreSQL 18

#125

PostgreSQL seems to have become the be-all, end-all SQL database that does everything and does it all well. And it's free! I'm wondering why anyone would want to use anything else at this point (for SQL).

Postgres is wonderful, and has great many useful extensions. But:

* MySQL has a much easier story of master-master replication.

* Mongo has a much easier story of geographic distribution and sharding. (I know that Citus exists, and has used it.)

* No matter how you tune Postgres, columnar databases like Clickhouse are still faster for analytics / time series.

* Write-heavy applications still may benefit from something like Cassandra, or more modern solutions in this space.

(I bet Oracle has something to offer in the department of cluster performance, too, but I did not check it out for a long time.)

Re: Instant database clones with PostgreSQL 18

#126

Earlier quoted context omitted.

This is typical for analytical databases, e.g., ClickHouse (which I'm the author of) uses immutable data parts, allowing table cloning: https://clickhouse.com/docs/sql-reference/statements/create/...

`ClickHouse (which I'm the author of)` just casually dropped that in the middle

It was so casual I didn't even notice it until you pointed it out XD

Re: Instant database clones with PostgreSQL 18

#127

Earlier quoted context omitted.

This is typical for analytical databases, e.g., ClickHouse (which I'm the author of) uses immutable data parts, allowing table cloning: https://clickhouse.com/docs/sql-reference/statements/create/...

`ClickHouse (which I'm the author of)` just casually dropped that in the middle

This is typical HN: everyone is here. I've seen a number of threads that unflod like this: "Lately I hacked up a satellite link to..." → "As an engineer who built the comm equipment of that satellite,.." → "As the astronaut who launched the satellite from ICS,..", etc.

Re: Instant database clones with PostgreSQL 18

#128

Earlier quoted context omitted.

Let's say there is an architect and he also owns a construction company. This architect, then designs a building and gets it built from of his employees and contractors. In such cases the person says, I have built this building. People who found companies, say they have built companies. It's commonly accepted in our society. So even if Claude built for it for GP, as long as GP designed it, paid for tools (Claude) to…

I agree that it's ultimately about the product. But here's the problem. Five years ago, when someone on here said, "I wrote this non-trivial software", the implication was that a highly motivated and competent software engineer put a lot of effort into making sure that the project meets a reasonable standard of quality and will probably put some effort into maintaining the project. Today, it does not necessarily impl…

> Today we just don’t know

You never knew. There are plenty of intelligent, well-intentioned software engineers that publish FOSS that is buggy and doesn’t meet some arbitrary quality standards.

Re: Instant database clones with PostgreSQL 18

#129
post #17

For those who can't wait for PG18 or need full instance isolation: I built Velo, which does instant branching using ZFS snapshots instead of reflinks. Works with any PG version today. Each branch is a fully isolated PostgreSQL container with its own port. ~2-5 seconds for a 100GB database. https://github.com/elitan/velo Main difference from PG18's approach: you get complete server isolation (useful for testing migrat…

Despite all of the complaints in other comments about the use of Claude Code, it looks interesting and I appreciated the video demo you put on the GitHub page.

Agentic coding detractors: "If AI is so great, where all the thriving new open source projects to prove it?"

Also agentic coding detractors: "How dare you use AI to help build a new open source project."

I'm joking and haven't read the comments you're referring to, but whether or not AI was involved is irrelevant per se. If anyone finds themselves having a gut reaction to "AI", just mentally replace it with "an intern" or "a guy from Fiverr". Either way, the buck stops with whomever is taking ownership of the project.

If the code/architecture is buggy or unsafe, call that out. If there's a specific reason to believe no one with sufficient expertise reviewed and signed off on the implementation, call that out. Otherwise, why complain that someone donated their time and expertise to give you something useful for free?

Re: Instant database clones with PostgreSQL 18

#130

PostgreSQL seems to have become the be-all, end-all SQL database that does everything and does it all well. And it's free! I'm wondering why anyone would want to use anything else at this point (for SQL).

PostgreSQL has no mature Vitess alternative. Hence, the largest oss OLTP database deployments tend to be MySQL. Like YouTube and Uber for example.
Post reply on HN