Why we’re excited about Google Cloud Spanner

Pierre Dubouilh
Greta.io
Published in
2 min readMar 9, 2017

At Greta, we’ve been very excited about Google Cloud Spanner for a long time — we read the paper about the ideas behind Spanner many years ago, and have been waiting for it to materialise ever since. For those of you not familiar with Spanner yet, it is Google’s new relational database service that they are now commercially launching during Google Next 2017. Eric Schmidt even said the following during his keynote on day 1:

“Cloud Spanner is a piece of art in computer science” Eric Schmidt

One of the things that makes Spanner a pretty unique and exciting database is that it scales horizontally to thousand of servers with extremely low latency, meaning that it is capable of handling extremely high workloads. In combination with synchronous data replication it makes it the service very appealing for us at Greta as it enables us to do data replication in no time. However, what we’re truly thrilled about is the global version of Cloud Spanner which Google have announced will be out later during 2017, as that will enable us to do global data replication with close to no latency. In the sections below we’ll quickly outline some of the ways we’re looking to use the service.

The infrastructure we’ve used whilst waiting for Spanner relied on distributed local cache with one persistent datastore. While this solution allowed us to scale quickly, we ended up having to make a compromise when accessing the data;
— A short TTL on the cache allows for data to always be at the latest state, but it is at the expense of frequent requests to our persistent datastore which requires more time
— A longer TTL on the cache enables fewer requests to the persistent store, and hence is faster. However, a new state takes longer to be adopted.

It is difficult to find a right balance in the trade-off between speed and always having the correct state — which is why Spanner is such a compelling service. Spanner manages to provide both these aspects: globally distributed data that’s fast to access, and that is persistent. A bonus is that it allows us to use the same SQL version between BigQuery and Spanner.

The set-up was very fast, and as we were already using the Node.js Google Cloud Library, we had no further login to handle. We could use our new Spanner datastore directly, without having to handle any connection parameter. The web user interface is accessible throughout the console and that also ended up being very useful as we could perform live queries both for testing and for actual data.

Learn more about Spanner here: https://www.youtube.com/watch?v=IjqDC4WrAIQ

--

--