PostgreSQL (aka Postgres) is old as dirt, yet over the past five years it has panned out as pure gold. MongoDB got the billion-dollar IPO and AWS launched the mind-bendingly cool Aurora Serverless, but it’s PostgreSQL that keeps having its moment—again and again and again.
Now the world’s fourth most popular database, according to DB-Engines’ multicomponent ranking, PostgreSQL has a ways to go before it surpasses Oracle, MySQL, and Microsoft SQL Server. Yet at its current pace, there’s every reason to expect it could get there.
The question is why? Why is PostgreSQL not just the hottest tenant in the database old folks home but also hot with the hipsters?
PostgreSQL now scales, thanks to Citus
Arguably, one of the biggest innovations to hit PostgreSQL in years made it look a bit less frumpy: native JSON support in PostgreSQL 9.2. Originally it wasn’t very good, but by Version 9.4 JSONB gave the venerable database significant mojo (and heavy-duty indexing).
Also, as Redmonk analyst James Governor has pointed out, “there’s some NoSQL and big data fatigue,” so suddenly developers stuck with their tried-and-true PostgreSQL as a viable alternative to MongoDB and Apache Cassandra for some key workloads.
Well, almost. One thing that PostgreSQL (and RDBMS, generally) hasn’t done well is scale. Sure, you could mortgage a residential neighborhood’s homes and get Oracle’s entry-level vertical scale, but that’s not how the world works anymore. As Google, Facebook, and others have shown, real scale is horizontal—and PostgreSQL was hamstrung there.
“Was” being the operative term.
With Citus, an open source extension to PostgreSQL, it’s now easy to scale out PostgreSQL across multiple nodes and intelligently distribute transactions and SQL queries to get massive parallelism, as well as a much bigger compute, memory, and disk footprint for the database. The company behind Citus provides commercial tools (as well as a fully managed Citus database), but the tools simply make it easier to manage the scaling. In this way, as Craig Kerstiens, Citus’s head of cloud, says, SaaS startups or established enterprises that start with PostgreSQL can do so without worrying that they’ll later need to rearchitect for NoSQL to get scale. With Citus, scale comes natively to PostgreSQL.
Making the boring things boring
Beyond this newfangled scale and NoSQL-y functionality, PostgreSQL has always done the essentials of a database well. You know: Store (and not lose) data. In fact, when I asked why PostgreSQL is experiencing such a renaissance, most respondents focused on the impressive (if boring) aspects of the database: its focus first on data integrity and correctness, ability to extend the database through runtime extension hooks, and the opportunity to query other systems within PostgreSQL through foreign data wrappers.
Not only that but, as Elijah Zupancic, Joyent’s director of solutions engineering, put it to me, PostgreSQL also gets developer essentials right: “From a developer perspective, it is a pleasure to use. The documentation is wonderful, the data types reflect the types developers work with, and there is little surprising.” Unlike every other Top 10 database, PostgreSQL doesn’t depend on any single vendor. It’s a true, vendor-neutral open source community.
This last point is telling, because it’s very possible that over time PostgreSQL will displace MySQL. Why? Because MySQL has one primary contributor: Oracle. OpsCompass CTO John Grange indicates that his clients prefer PostgreSQL in significant part because it’s not Oracle. His customers are not alone.
That said, neither MySQL nor Oracle are going to lose their places as the Top 2 most popular database technologies in the world anytime soon, to PostgreSQL or anything else. The trends, however, favor PostgreSQL. In part, this is because oldsters appreciate its steady reliability. Hipsters, however, are also glomming onto the virtue of boredom: As one person posted at Hacker News, “It’s not hip and takes a bit to set up, but after you are done, you have a reliable workhorse with all the stuff you need.”