Lakshya

Software Engineering · Chapter 20 of 31

Choosing a database, and the licence histories behind it

Why Postgres won, where 'just use Postgres' is genuinely wrong, and the two licence timelines that get asked about and misreported.

8 min read1 diagramAll 31 chapters

Database choice is where an interview finds out whether you reason from access patterns or from what you used last. And because this market has had five significant licence changes in seven years, it is also where it finds out whether you read primary sources.

Why PostgreSQL won

Not performance, and not features. Extensibility as a distribution channel.

Postgres shipped a stable extension API and an index access-method interface, which means an entire category of database can be delivered as one CREATE EXTENSION rather than as a separate product to procure, staff, back up and be on call for. PostGIS made it the geospatial database. TimescaleDB made it a time-series database. pgvector made it a vector database in about eighteen months. Every specialist engine now has to beat Postgres-plus-an-extension and justify a second system.

The second half of the answer is governance: a permissive licence and no single controlling vendor mean no rug-pull risk — which, after the last seven years, is worth real money. The most recent release added an asynchronous I/O subsystem with large gains on storage reads, which pushes the single-writer ceiling further out than most people assume.

When ‘just use Postgres’ is right

  • Transactional workloads of essentially any shape, at any scale a single writer can serve — far larger than people believe on current hardware.
  • JSON documents. Binary JSON with the right index covers most of what people reach for a document store to do, with transactions and joins.
  • Geospatial. PostGIS is not a compromise; it is the best-in-class answer.
  • Time series at moderate scale, and vector search below roughly ten to fifty million vectors.
  • Full-text search that is genuinely good enough — until someone asks for relevance tuning.
  • Anywhere the deciding factor is one fewer system to operate, which is more places than engineers like to admit.

When it is wrong — and saying so is the mark of a real answer

SituationWhy Postgres losesWhat wins
Petabyte analytical scansIt is row-oriented. A columnar engine wins by one to two orders of magnitude on an aggregate, and no tuning closes that — extensions do not change the storage layoutClickHouse; DuckDB single-node
Genuine multi-region writes with strong consistencySingle writer. There is no extension that fakes thisSpanner, CockroachDB, YugabyteDB, TiDB, Aurora DSQL
Very high-throughput single-key operationsRate limiters, session stores, leaderboards. Using Postgres is a per-request cost you pay foreverRedis / Valkey
Extreme write volume, simple access patternThe constraint is the feature — these engines refuse to let you write a query that will not scaleDynamoDB, Cassandra
Embedded and edgeYou cannot ship Postgres inside an applicationSQLite / libSQL
A serious search productRelevance tuning, faceting, analyzers, a query languageElasticsearch / OpenSearch
Connection-heavy serverlessProcess-per-connection is a genuine architectural mismatchA pooler — and this is precisely the gap the serverless-Postgres companies built businesses in

The licence histories, exactly

TWO LICENCE HISTORIES THAT ARE ROUTINELY REPORTED WRONGLY — BOTH GET ASKED IN INTERVIEWS REDIS up to 7.2BSD 3-Clause. Still BSD, forever — the change was never retroactive20 Mar 2024from 7.4: dual RSALv2 + SSPLv1. Redis conceded this is not open source by the OSI definition28 Mar 2024Valkey forks — from 7.2.4, the LAST BSD release, eight days later, under the Linux Foundation1 May 2025Redis 8.0 ADDS AGPLv3 — a third option. RSALv2 and SSPLv1 both remain So Redis is TRI-licensed and the user picks. “Redis went back to open source” overstates it; nothing was removed. COCKROACHDB 2014–2019Apache 2.0Jun 2019Business Source Licence, from 19.2 — converting to Apache 2.0 after three years18 Nov 2024CockroachDB Software Licence. Core is RETIRED. The Apache conversion is GONE. Competitors’ comparison pages still say “BSL, converts to Apache after three years”. That has been false since November 2024, and it survives precisely because rivals keep publishing it. Free tier now: companies under $10M revenue, renewed annually. The general habit: read the LICENSE file in the repository, not a vendor’s comparison table.
Neither of these is the story people tell. Redis added a licence rather than replacing one; CockroachDB removed the conversion that competitors still advertise.

Four things people get wrong about Redis, in order of how often.

“Redis went back to open source.” It added AGPLv3 as a third option in 2025. It did not remove the two source-available licences. The user picks — and taking the AGPL grant means taking AGPL obligations.

“Valkey forked from 7.4.” No — from 7.2.4, the last BSD release. 7.4 was the first source-available release and could not have been forked under BSD.

“Redis switched to SSPL.” It switched to a dual licence. The two instruments have different obligations — one restricts offering it as a managed service, the other is copyleft over the whole service.

“The change broke my old deployment.” It was never retroactive. Everything up to 7.2 is BSD forever.

And the strategic read: the hyperscalers and most Linux distributions moved to the fork within a year, and Redis got neither the licensing revenue nor the community. Adding AGPL was an admission that the strategy failed. The question worth asking is not which is faster — it is which one your distribution, your cloud provider and your compliance team will be shipping in three years.

CockroachDB is the sharper case, because the wrong version is actively propagated. Comparison pages published by competitors today still describe it as source-available with a three-year conversion to Apache. That stopped being true in November 2024: the Business Source Licence and the enterprise licence were both replaced by a single proprietary licence, the free Core edition was retired, and the Apache conversion was removed. There is a free tier — for companies under ten million dollars of revenue, counted including parents and affiliates, renewed annually.

Two more to have straight. A well-known document database has been on a source-available licence since 2018, was AGPL before that, submitted the licence to the Open Source Initiative and withdrew it, and has never reverted — so “it went back to open source like Redis did” is wrong twice over. And Elasticsearch followed the same add-a-third-licence pattern as Redis, which is why its fork also did not go away.

What actually decides an engine

1 — Access pattern, not “SQL versus NoSQL”. Do you read by known key or query by predicate? One row or an aggregate over a billion? Single-row writes or batches? Is the working set larger than memory? A key-value store and a columnar engine are not competitors; they answer different questions.

2 — Consistency and failure requirements, stated honestly. What is your actual recovery point objective? Do you need multi-region writes, or multi-region reads with a single write region — because the second is far cheaper and covers most stated requirements. Distributed SQL's price is coordination latency on every write, and you should be able to say what you are buying with it.

3 — The operational skill you actually have. The engine you can operate at three in the morning beats the one that benchmarks better. This is the most under-weighted factor and the one most often missing from a candidate's answer.

4 — Existing gravity. A second engine is not a technology decision, it is a permanent tax: another backup story, another upgrade cadence, another on-call runbook, another set of consistency semantics to hold in your head, and a distributed transaction problem you did not have yesterday. The bar for adding one should be far higher than “it would be faster for this query”.

The vector database question

The category is surviving as a set of engines, not as a set of companies. The workload is real and at high scale genuinely needs specialised indexing and memory layout that cannot be reproduced as a Postgres extension. But it was never a standalone market, because a vector index is a feature, and features get absorbed.

What ended the venture thesis was not a competitor. It was pgvector gaining iterative index scans, which fixed filtered vector search — the one thing that used to force people off Postgres. The independents with real open-source distribution will persist; expect the rest to end up owned by data platforms.

The recommendation: start on pgvector, and move when you can name the number it fails to hit — vector count, recall target, latency budget, filter cardinality. “We might need scale” is not that number.

Check yourself

Why did Postgres win?Extensibility as a distribution channel. A whole category of database ships as one CREATE EXTENSION rather than a second system to procure, staff and back up.
Name three places 'just use Postgres' is wrong.Petabyte columnar scans, genuine multi-region writes with strong consistency, and very high-throughput single-key operations. Also embedded, and serious search.
Did Redis go back to open source?It added AGPL as a third option in 2025 without removing the two source-available licences. It is tri-licensed and the user picks.
What version did Valkey fork from?7.2.4 — the last BSD-licensed release. 7.4 was the first source-available one and could not have been forked under BSD.
What is wrong with 'CockroachDB is BSL, converting to Apache after three years'?It stopped being true in November 2024. Core was retired, the conversion removed, and both licences replaced by a proprietary one. Competitors' pages still say it.
When should you leave pgvector?When you can name the number it misses — vector count, recall, latency, filter cardinality. 'We might need scale' is not that number.
← Testing tools: two races that are overWhich language, and what the interview actually tests in each →