Introduction to Google Cloud SQL
In this course, you will be introduced to Google Cloud SQL.
- Create new databases using Cloud SQL
- Migrate external databases to Cloud SQL
- Manage database users
- Import and export data
- Create backups and read replicas
- Database administrators
- Cloud Architects
- GCP Developers
- Anyone preparing for a Google Cloud certification
- Some experience working with databases
- Basic understanding of SQL syntax
- Access to a GCP account
One of the main reasons people build applications in the cloud is to process and store large amounts of data. Google Cloud Platform can give you access to an almost unlimited amount of storage. However, the more data you have, the more important it is to keep it all organized. And that is why Google offers many different database services.
Today, I am going to talk about one of the most commonly used GCP databases. Cloud SQL is a relational database that is optimized for storing structured data. That means it organizes your data into tables, rows and columns. So you can use it to store things like a list of your current customers, or a catalog of available products. Basically, any set of information you need to be able to search and sort through quickly. Cloud SQL also makes it easy to join multiple sets of data together. So if you have a table of products and a table of customers, you can join the two together to figure out which products each of your customers purchased.
Now Cloud SQL is most commonly used as a data store for applications that run directly on Google Cloud. This would include things like applications running on Compute Engine. Containers deployed to Kubernetes Engine or Cloud Run. And even code written for Cloud Functions. It also can be accessed by external applications as well. So any application that is running locally, on-premises, or even on another cloud provider, can still access data stored in a Cloud SQL database.
Now if you have already had some experience using something similar to a MySQL database, then you might be thinking that Cloud SQL sounds pretty much the same. And you would be correct! Cloud SQL is essentially a fully managed instance of either MySQL, PostgreSQL, or Microsoft SQL Server.
So you get to use the same industry-standard databases that everyone else uses. But, without all the hassle of setting up and running it yourself. Pick the engine, the region that is it going to run in, the instance type, and then Google handles the rest.
So Cloud SQL is perfect for when you need a database but don’t want to have to set it up from scratch. You can let Google’s experts handle it for you. In just a few minutes, you can have a database that will be secure, reliable, and highly available. Now if you are already using another SQL database, Cloud SQL also makes it easy to migrate over to. It has built-in tools that can copy your data over without any manual steps. And once you switch over, you gain a ton of benefits.
You don’t have to worry about OS upgrades or database patches. Your backups and replication can be completely automated. Google can even detect when your storage space is running low and automatically add more as needed. Of course your data will always be encrypted at rest. And you can encrypt your data in flight by enforcing SSL connections. So whenever you need reliable table-based storage without all the headaches, you can use Google Cloud SQL.
Now, Cloud SQL is not the only relational database that Google offers. There are other services including Cloud Spanner and BigQuery. I can’t go into detail about these two other products since they each have their own separate courses. But I can help explain what the main differences are. Cloud SQL is probably the most commonly used out of the three. It is basically a drop-in replacement for MySQL or SQL Server. If you are developing an application that needs access to a relational database, Cloud SQL is usually the best choice.
Cloud Spanner is pretty similar, except that it is more powerful and more expensive. If you need to handle thousands and thousands of simultaneous reads and writes, Cloud SQL may not be able to keep up. So in extreme cases like this, Cloud Spanner would be the better tool. BigQuery is a relational database, but it has a completely different use case. BigQuery is a data warehouse built for analytics and big data. Typically you use it to store terabytes of potentially sensitive data. And then you will probably have a small group of data scientists who will write and execute queries to discover insights based upon that data.
Now if you are still confused, maybe this example will help. Let’s say you worked for a company that builds massively multiplayer games. They might use Cloud SQL to store player account information including their names, email addresses and billing information. Then they might use Cloud Spanner for storing the global state of the game. This could track player positions, health, experience and other game values that are constantly changing. And then, BigQuery could be used to store every action that any player took. Every time they log in, every time they log out. Every time they score a point or defeated another player. And then all this information would be used to figure out ways to improve the game in the future. All three products are capable of doing similar things. But they each optimized in different ways for different tasks.
So hopefully now you have a good understanding of what Cloud SQL is and what it is used for.
Daniel began his career as a Software Engineer, focusing mostly on web and mobile development. After twenty years of dealing with insufficient training and fragmented documentation, he decided to use his extensive experience to help the next generation of engineers.
Daniel has spent his most recent years designing and running technical classes for both Amazon and Microsoft. Today at Cloud Academy, he is working on building out an extensive Google Cloud training library.
When he isn’t working or tinkering in his home lab, Daniel enjoys BBQing, target shooting, and watching classic movies.