Quantcast
Channel: Joab Jackson, Author at The New Stack
Viewing all articles
Browse latest Browse all 697

PostgreSQL 17 Gets Incremental Backup, SQL Queries for JSON

$
0
0

The latest version of the open source PostgreSQL relational database system was released today, and with it comes a number of improvements geared to make high-end users and developers happy.

PostgreSQL gets updated quarterly with bug fixes and assorted other patches, but around this time of the year — in the September/October timeframe — comes the major release with the new major features, and this year is no different.

“I find this particular release really compelling, compared to the last several,” enthused Tom Kincaid, vice president of database development at PostgreSQL support provider EnterpriseDB, or EDB, in an interview with The New Stack.

The chief reason? Incremental backup. It’s a game-changer, he said.

Incremental Backup

With incremental backup, only changes since the previous backup are copied over. This is good for saving bandwidth and storage costs.

PostgreSQL has long had third-party providers with incremental backup capability and even offered something similar itself, called WAL Archiving, where the write-ahead log is replayed to the required section.

But now, PostgreSQL 17 has a proper backup mechanism, which offers minimal disruption during operation. It also features significantly faster recovery times, which is “what people care more about,” given the typically slow nature of recovery from a backup.

In early EBD testing, supported by EDB, PostgreSQL recovery times saw a significant improvement with this update, dropping from 78 minutes to just 4 minutes in one test.

As a result, “Postgres will be much more appropriate for larger databases with this in place,” Kincaid said. Think large data AI workloads or time-series processing.

Sturdier Replication

Here’s another new feature that big data shops will enjoy: an update to replication slots, which would ensure database consistency even during a failover.

Logical replication is different from simple physical replication, which makes an exact copy of the database server on the exact same database version and underlying hardware. But logical replication copies all the database commands, one by one, to the secondary location, which can have its own, completely separate architecture. In fact, many data warehouses use logical replication to pull data from the source database.

With previous versions of PostgreSQL, replication slots ensured that if a backup server went down, the primary server retained a copy of the write-ahead log until the replacement backup could be re-established.

However, if a primary server fails, the replication stream for the logical replication will die along with it, and the new primary server will have to reseed a new replication stream, which could result in a gap of lost data for the backup.

With release 17, a replication stream would automatically continue with the standby server.

“You don’t have any operational loss,” Kincaid said.

Hella JSON Support

“The way Postgres is built, it is very easy to add new data types,” Kincaid noted. This easy extensibility in part accounts for the open source database system’s runaway popularity, namely by allowing users and software builders to build queries on multiple data types (“give the 10 cheapest places to live within a 100 miles of Boston.”)

One such data type is JSON, which gets a big helping hand in this release.

For one, users can now query json data types with standard SQL statements. Thanks to the fresh json table, which renders JSON data into a table that then can be queried through SQL FROM clause, with the being data returned in a relational view.

There are also many other JSON compatibility improvements in this release as well.

Kincaid noted that to implement this JSON compatibility the PostgreSQL core dev team worked very diligently from the SQL 2023 standard, which specified the JSON types for the query language.

“Postgres, over the years, has become very popular with developers. And so we felt, this kind of JSON functionality is very important to build on that popularity,” Kincaid said.

Hardier Subtransactions

EDB contributed a bit of code to fix the previously-mentioned Replication Slot expansion via a prior plug-in it had created for its own customers.

A premium support provider, EDB has developed a rich set of tooling around this open source database system, as well as advanced features needed by high-end users not available in PostgreSQL itself, such as transparent data encryption.

And it has a strong technical support team, which can fix the most obscure bugs, sometimes right at the source.

One such bug fix showed up in PostgreSQL 17 solved a problem that had bothering users for years, including a customer of EDB’s in the financial industry, Kincaid reported.

During some customer migrations, PostgreSQL would have difficulty moving large numbers of transactions with many sub-transactions, or nested transactions. Nested transactions are used a lot in the financial industry, not surprising given its highly transactional nature. For this fix included in v17, an EDB engineer redesigned the sub-transaction cache, resulting in an 100x performance improvements for these types of migrations.

For a full rundown of features in PostgreSQL 17, view the release notes.

The post PostgreSQL 17 Gets Incremental Backup, SQL Queries for JSON appeared first on The New Stack.

EDB's VP of database development, Tom Kincaid, reveals his favorite features of the newly released PostgreSQL 17.

Viewing all articles
Browse latest Browse all 697

Trending Articles