Database in the cloud: All about Google Cloud Spanner

Databases are an essential part of any application, whether hosted on-premises or on the cloud. The growing adoption of cloud hosting has necessitated cloud-based relational databases that provide consistency, reliability, and availability besides supporting online deployments. One such cloud-based database is Google Cloud Spanner. Let’s take a detailed look at this database in this article.

What is the Google Cloud Spanner?

Google Cloud Spanner is a distributed relational database that runs on Google Cloud. Initially, Google used it for running its services and made it public only in early 2017.

google cloud spanner
Shutterstock

It started off as a NoSQL database, but as requirements evolved, it included a SQL processor backed by a well-typed schema. Today, Google Cloud Spanner supports distributed SQL queries, query restarts, and a form of SQL standardized by Google’s engineers. In short, it is a relational database built to scale well for your growing needs.

What do these mean to you?

As a business, you can use the Google Cloud Spanner for global online transactions, horizontal scaling, SQL semantics, consistency in transactions, high availability, and more.

[tg_youtube video_id=”bUSU1e9j8wc”]

Features of Google Cloud Spanner

Here’s a look at some of the key features of Google Cloud Spanner.

  • Combines GPS technology and atomic clocks for time synchronization, and hence its accuracy is extremely high.
  • Scales well horizontally with just minimal interference. The advantage of horizontal scaling is that the performance of the system increases greatly when more servers are added.
  • Supports both NoSQL and SQL, and this is why it can be categorized as a NewSQL database, a category of SQL database products that overcome the scalability and performance issues of regular SQL databases.
  • Easy to develop, integrate, and test on most applications.
  • Comes with advanced support for administration and management such as backup, recovery, creating SLA instances, and more.
  • Supports cross-table transactions.
  • Delivers 99.999% availability for local and multi-regional instances.
  • Provides transparent replication across multiple regions and configurations.
  • Automatically shards data based on request load and data size.
  • Supports querying big data in real-time to create a unified data lifecycle.
  • Comes with enterprise-grade security controls that include Customer-Managed Encryption Keys (CMEK), IAM integration, data-layer encryption, and more.
  • Provides Point-In-Time-Recovery (PITR) for continuous data recovery. You can also recover your data to microsecond granularity.
  • Synchronizes data across applications and storage systems.
  • Offers advanced statistics and metrics.
  • The tables in the database can have a physical dependency on each other.
  • Though it supports secondary indexes, it doesn’t choose one automatically.

Thus, these are the salient features of Google Cloud Spanner. While it’s not exhaustive, it gives an idea of its capabilities, so you can decide if this is the right fit for your business. This discussion also begets another important question. Who is Google Cloud Spanner for? The simple answer is anyone looking to host applications on the cloud and needs a database to support its operations.

Google Cloud Spanner use-cases

To give more clarity on where and how Cloud Spanner can be used, here are some use-cases.

Disaster recovery

Many industries today have data restrictions. For example, some countries have legislation that requires companies to store and process the data about a country or its residents within its geographical boundaries only. Further, the workloads must be accessible from specific predetermined locations. Setting up disaster recovery for such restrictive environments is anything but easy.

Google Cloud Spanner can be a good choice for this scenario because its resources are divided across different regions in the world, so you can choose to run the database within that specified region, without impacting performance or availability. Also, multi-regional resources are redundant and spread across neighboring regions for greater flexibility.

Reducing response time with minimal manual intervention

google cloud spanner

When the number of users in a traditional database exceeds the established threshold levels, its performance dips.

Restoring the performance requires multiple steps ranging from analyzing the performance metrics to scaling the database vertically or horizontally as required. While vertical scaling is easy, horizontal scaling is not because there’s a limit on the maximum size of a server.

Google Cloud Spanner handles horizontal scaling with minimal interference, and hence, can be a convenient option in such scenarios.

Online analytical processing

Google Cloud Spanner comes with many advanced features that support analytical processing. Some of those features include data loading, improved query performance, partitioning indexes, and more.

This is why this RDBMS is a good choice for a global analytical processing system that runs entirely on the cloud.

Gaming database

Online games, especially multiplayer games, require complex database structures for tracking player performances and data. Many organizations find it hard to scale and manage this complexity, as it often requires sharding. Also, NoSQL databases are a better choice for gaming because they can change when the underlying data model changes. Further, redundancy is a key part of gaming software. Since Google Spanner supports all these features, it can be a good choice for a gaming database.

We hope these use-cases give an idea of the versatility of Google Cloud Spanner and can help you decide if this is the right fit for your organization.

Pricing

The cost of Google Cloud Spanner depends on the compute capacity of your instance, the amount of storage your database and backups use, and the amount of network bandwidth consumed. The computing capacity is measured in nodes, where one node is equal to 1,000 processing units. Storage and bandwidth, on the other hand, are calculated in GB.

The cost per node depends on the region. For example, it’s $0.99 per node per hour in Eastern and Central North America and $1.08 in Los Angeles and Salt Lake City. Likewise, the cost is $1.26 per node per hour in Hong Kong and New Delhi.

When it comes to storage, it is $0.30 per GB per month in Eastern and Central North America and $0.42 in Mumbai.

A highlight of Google Cloud Spanner is that you can plan your infrastructure and budget for it accordingly. There are no surprises as the pricing is transparent. In all, the Google Cloud Spanner is a good choice for hosting a cloud database for your applications due to its high performance, reliability, and availability.

That said, it comes with certain limitations, too, as it does not offer support for database views, offers limited community support, no granular permission or role setting, and requires a few workarounds to effectively use all the nodes. Consider these limitations too while making a decision.

Now that you know everything about a Google Cloud Spanner, will you use it? Why and why not? Please share your thoughts with us by posting in the comments section.

Featured image: Shutterstock

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top