Get startedGet started for free

Spanner

1. Spanner

If Cloud SQL does not fit your requirements because you need horizontal scalability, consider using Spanner. Spanner is a service built for the cloud, specifically to combine the benefits of relational database structure with non-relational horizontal scale. This service can provide petabytes of capacity and offers transactional consistency at global scale, schemas, SQL, and automatic synchronous replication for high availability. Use cases include financial applications and inventory applications, traditionally served by relational database technology. Depending on whether you create a multi-regional or regional instance, you'll have different monthly uptime SLAs. For up-to-date numbers, you should always refer to the documentation. Let's compare Spanner with both relational and non-relational databases. Like a relational database, Spanner has schema, SQL, and strong consistency. Also, like a non-relational database, Spanner offers high availability, horizontal scalability, and configurable replication. As mentioned, Spanner offers the best of the relational and non-relational worlds. These features allow for mission-critical use cases, such as building consistent systems for transactions and inventory management in the financial services and retail industries. To better understand how all of this works, let's look at the architecture of Spanner. A Spanner instance replicates data in N cloud zones, which can be within one region or across several regions. The database placement is configurable, meaning you can choose which region to put your database in. This architecture allows for high availability and global placement. The replication of data will be synchronized across zones using Google's global fiber network. Using atomic clocks ensures atomicity whenever you are updating your data. That's as far as we're going to go with Spanner. Because the focus of this module is to understand the circumstances when you would use Spanner, let's look at a decision tree. If you've outgrown any relational database, are sharding your databases for throughput high performance, need transactional consistency, global data and strong consistency, or just want to consolidate your database, consider using Spanner. If you don't need any of these, nor full relational capabilities, consider a NoSQL service, such as Firestore, which we will cover next. If you're now convinced that using Spanner as a managed service is better than using or re-implementing your existing MySQL solution, refer to the documentation for a solution on how to migrate from MySQL to Spanner.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.