Cloud BigTable, Cloud SQL and Cloud Spanner: Google Cloud and its Intricacies V5(Cloud Storage)

Shola Slick Akinrolie
Shades of Cloud
Published in
6 min readAug 31, 2021

The importance of choosing the appropriate storage type in cloud computing can’t be overemphasized. Ranging from Cost to Storage capacity, Latency, Security, Scalability, Data encryption, Backup and Failover, Optimization and Best practices.

In this module, we will discuss extensively Cloud Bigtable, Cloud Database(Relational Database), Cloud SQL and Cloud Spanner.

Flashback to the previous module on Cloud Storage!

Consider using Cloud Storage if you need to store immutable blobs larger than 10 megabytes such as large images or movies. This storage service provides petabytes of capacity with a maximum unit size of five terabytes per object.

Cloud Bigtable

Cloud Bigtable is Google’s NoSQL, big data database service. Let's talk about what NoSQL means? Think first of a relational database as offering you tables in which every row has the same set of columns, and the database engine enforces that rule and other rules you specify for each table. That’s called the database schema. An enforce schema is a big help for some applications and a huge pain for others. Some applications call for a much more flexible approach. For example, a NoSQL schema. In some applications, not all the rows might need to have the same columns. And in fact, the database might be designed to take advantage of that by sparsely populating the rows. That’s part of what makes a NoSQL database what it is.

This brings us to Bigtable, your databases in Bigtable are sparsely populated tables that can scale to billions of rows and thousands of columns allowing you to store petabytes of data.

GCP helps you to fully manage the surface, so you don’t have to configure and tune it. It’s ideal for data that has a single lookup key. Some developers think of Bigtable as a persistent hatch table. Cloud Bigtable is ideal for storing large amounts of data with very low latency. It supports high throughput, both read and write, so it’s a great choice for both operational and analytical applications including the Internet of Things, user analytics and financial data analysis.
Cloud Bigtable is offered through the same open-source API as HBase, which is the native database for the Apache Hadoop project.

You might ask yourself, why should I choose Bigtable? Here are a few reasons why you might.

First, Scalability: If you manage your own Hbase installation, scaling past a certain rate of queries per second is going to be tough, but with Bigtable you can just increase your machine count which doesn’t even require downtime.

Secondly, Handled Administration Tasks Easily: Cloud Bigtable handles administration tasks like upgrades and restarts transparently.

Thirdly, Data Encryption: All data in Cloud Bigtable is encrypted both in-flight and at rest. You can even use IAM permissions to control who has access to Bigtable data.
Lastly, Interoperability and Flexibility: Bigtable is actually the same database that powers many of Google’s core services including search, analytics, maps and Gmail. As Cloud Bigtable is part of the GCP ecosystem, it can interact with other GCP services and third-party clients. From an application API perspective, data can be read from and written to Cloud Bigtable through a data service layer like Managed VMs.

Note that Cloud Bigtable does not support SQL’s queries nor does it support multi-row transactions.

Cloud Database (Relational Database)

Relational database services, these services use a database schema to help your application keep your data consistent and correct. Another feature of relational database services is that it helps with the same goal transactions.

Your application can designate a group of database changes as all or nothing. Either they all get made, or none do. Without database transactions, your online bank wouldn’t be able to offer you the ability to move money from one account to another. Do thought of how money is moved from one bank to another and it reflects in a single database easily. This is because all the bank’s databases are connected, so it designates a group of database changes as all or nothing, hence once you move money from one account/bank to another, all changes will be made at once.

Relational databases are a lot of work to set up, maintain, manage, and administer.

Cloud SQL

It offers you your choice of the MySQL or PostgreSQL database engines as a fully managed service. Cloud SQL offers both MySQL and PostgreSQL databases that are capable of handling terabytes of storage.

You could always run your own database server inside a Compute Engine virtual machine, which a lot of GCP DevOps do.
But there are some benefits of using the Cloud SQL managed service instead.

First, Cloud SQL provides several replica services like read, failover, and external replicas. This means that if an outage occurs, Cloud SQL can replicate data between multiple zones with automatic failover.

Secondly, Cloud SQL also helps you backup your data with either on-demand or scheduled backups. It can also scale both vertically by changing the machine type, and horizontally via read replicas.

Lastly, Security perspective, Cloud SQL instances include network firewalls, and customer data is encrypted when on Google’s internal networks, and when stored in database tables, temporary files, and backups.

SQL is best for web frameworks and in existing applications like storing user credentials and customer orders.

Cloud Spanner

Cloud Spanner offers transactional consistency at a global scale, schemas, SQL, and automatic synchronous replication for high availability.
It can provide petabytes of capacity. Consider using Cloud Spanner if you have outgrown any relational database, or sharding your databases for throughput high performance, need transactional consistency, global data and strong consistency, or you just want to consolidate your database.

Natural use cases include financial applications and inventory applications.

Cloud Spanner is best for large scale database applications that are larger than two terabytes; for example, for financial trading and e-commerce use cases.

CLOUD SQL VS CLOUD SPANNER

In Conclusion

Consider using Cloud SQL or Cloud Spanner if you need full SQL support for an online transaction processing system. Cloud SQL provides terabytes of capacity, while Cloud Spanner provides petabytes. If Cloud SQL does not fit your requirements because you need horizontal scalability not just through reading replicas, consider using Cloud Spanner.

Consider using Cloud BigTable if you do not need SQL Queries, Cloud Bigtable is ideal for storing large amounts of data with very low latency.
so it’s a great choice for both operational and analytical applications including the Internet of Things, user analytics and financial data analysis.

Looking at where to store your stuff with best practices? check this image.

In the next module, we will talk about other Google Cloud Storage like Cloud Datastore, Cloud Database (Relational Database), Nano and more. Stay tuned as we continue to give you the best insight and in-depth knowledge of cloud computing.
See you in the cloud!!

Follow Shades of Cloud Publication for more insightful stuff on cloud computing.
YouTube Channel: @Shadesofcloud
Medium: Shades of Cloud Publication.
Twitter: @shadesofcloud
Facebook: @Shadesofcloud
Instagram: @Shadesofcloudcomputing
Blog: Shadesofcloud
Author: Follow @meetslick on all platforms </>
Thank You!!
Stay tuned and see you in the cloud.

Credits: Google Cloud Platform, Essentials and Infrastructure.
Image Credit: Google Cloud

--

--

Shola Slick Akinrolie
Shades of Cloud

Simplifying Products and Technology for Developers and Users Consumption, Adoption and Happiness🔥• Software Engr • Developer Advocate •