Follow Datanami:
October 12, 2021

Google Cloud Gives Spanner a PostgreSQL Interface

Google Cloud has developed a PostgreSQL interface for Spanner, its globally distributed relational database. The new interface, which is in preview and which is being officially unveiled tomorrow at Google Cloud’s Next ’21 conference, is designed to lower the barrier of entry for a uniquely scalable database that supports some of the biggest workloads on the planet.

Up until 2021, Spanner has mostly been used by larger companies that not only have the need for a database with 99.999% availability, but also can afford to pay the Spanner fees, which started at $650 per month. That’s not a trivial amount, and it reflects the considerable amount of hardware infrastructure required to support a system that is capable of running one billions queries per second, Google Cloud said.

Remember that Google Cloud uses super-sensitive atomic clocks and GPS systems to deliver the transactional guarantees necessary for a globally distributed relational database, which is no small feat. This is part of the reason why Spanner use has been somewhat restricted, at least up until now. But Google Cloud clearly is looking to take the shackles off Spanner and bolster its usage.

One way it’s doing that is by eliminating cost as a barrier. It did that earlier this year when it announced that customers can get started on just a 10% slice of Spanner for just $65 per month, with the ability to scale up the Spanner deployment incrementally to support full petabyte-scale workloads.


Now, with the revelation that Google Cloud is delivering a PostgreSQL-compatible interface for Spanner, it’s working eliminate the need to rewrite your database application to support Spanner as a barrier, too.

Andi Gutmans, the vice president and general manager of databases at Google Cloud, explained what drove Google Cloud to open up Spanner in an exclusive conversation with Datanami.

“While we’ve been using ANSI SQL–and of course SQL is very familiar to developers–the whole tooling ecosystem, framework ecosystem [for Spanner] we had to develop,” Gutmans said. “So if you want to use like Hibernate or other tools, we had to develop all the adapters. And obviously we’re only a limited size team we can’t do everything.

“So what we [said] is why don’t we go and support a PostgreSQL interface,” Gutmans continued. “Basically, make it very, very easy for people with existing tools, existing skillsets, to come and use Spanner.”

Google Cloud is delivering PostgreSQL support two different ways. For starters, it has started to add native support for PostgreSQL data types and the PostgreSQL grammar on Spanner itself. Spanner doesn’t support all of the data types and grammar that PostgreSQL offers, but the plan is to add more support over time.

The other method involves deployment of a “sidecar” next to the Google Cloud Compute instance that runs Spanner (it’s not an actual sidecar, just a virtual one). The sidecar essentially translates the wire protocol from the PostgreSQL to Spanner.


“For customers who want to use the Postgres wire protocol, that don’t want to make changes, we actually have a sidecar they can deploy on the client side,” Gutmans said. “That way, customers get the best of both worlds. They can still get to use tools like PostgresSQL but they’re still getting the five-nines availability of Spanner, the global network routing benefits and so on.”

The new $65/month entry fee and the capability to scale to petabyte-size deployments has already paid dividends in spurring Spanner interest, and the hope is the new PostgreSQL interface will generate even more interest, Gutmans said.

“Theres’ been a huge spike in new users coming in trying out PostgreSQL, and we haven’t even GA’d yet,” he said.

Gaming companies are among the outfits that could benefit the most. There are many smaller gaming companies that don’t have the resources for a large scale-out infrastructure, which can hobble their ability to scale to meet surging demand.

“With granular instance sizing, they can basically launch a game with almost no cost,” he said. “But if it hit overnight success, they’re basically future-proof. They know that they’re going to be able to scale to whatever size they need to and scale up with zero downtime.”

Google Cloud Next ’21 is taking place today through Thursday. For other company announcements, see “Google Cloud Widens Its Big Data Reach at Next ’21.” Google Cloud CEO Thomas Kurian and Sundar Pichai, the CEO of Google and parent company Alphabet, will be kicking things off with a keynote this morning at 9 a.m. PT. See for more information.

Related Items:

One on One with Google Cloud Product Director Irina Farooq

Google Cloud Tackles Data Unification with New Offerings

Who’s Winning the Cloud Database War