Create And Configure Cloud Spanner: A Step-By-Step Guide
Step 1: Login To Google Cloud Console
- First thing we need to do for creating Cloud Spanner is to login to the Google Cloud Platform’s Cloud Console.
- On your web browser, navigate to google cloud console and login with valid credentials and a valid subscription plan to Google Cloud services.
Step 2: Enable Spanner API
Once we are logged into the Cloud Console, we have to enable the Spanner API. Spanner API is an application programming interface (API) provided by Google Cloud Platform that allows developers to interact with Cloud Spanner and create, manage, and query databases withing Cloud Spanner.
- To enable the API, click on the the API & Services button in the left sidebar on the Cloud Console and then select Library.
- This will open the API Library where search for Spanner API. Once you got the API in search results, click on it and then click on Enable.
Step 3: Search For Cloud Spanner
- Now, Search for Cloud Spanner in the search-bar given in the Cloud Console and click on the result.
- Then click on Create a provisioned instance.
Step 4: Configure Cloud Spanner Instance
a) Configure Instance details:
- Give a appropriate name to the Spanner instance. Instance name should be 4 to 30 character long. You can choose the same name for instance Id as well. instance Id allows only Lowercase letters, numbers, hyphens. The instance Id is the unique identifier for the instance and name is for display purpose only.
b) Configure Region:
- Now Select the Region configuration for the instance. We have two options given here, one is Regional and another one is Multi-Regional.
- If the users and services are located in one region then it’s better to select regional to save some cost. For database to be triggered by multiple locations then it’s better to use Multi-regional.
- For this example, we are selecting Regional. Now for both the cases we have to choose a region. It is recommended to choose the location which is near to you. Here we will choose asia-south2 (Delhi).
c) Configure Compute Capacity:
- Compute capacity determines the data throughput, Queries per second and storage limits for the Cloud Spanner instance. If you are building a large project, you can choose Node as unit. But here as we are using this for learning purpose we will be choosing Processing Units. Leave other settings as pre-set.
Step 5: Review And Create
- Once you are done with the above configurations, review all the changes you have made and look for the summary available on the right side of your computer screen.
- The summary gives you an insight on the configurations are made. This also provides the estimated cost for computation and Storage for using this cloud service with the selected configurations.
- Once you have verified everything, click on Create. Wait for few seconds and Cloud Spanner instance will be ready for use.
How To Configure Cloud Spanner In GCP ?
In today’s era when data is everywhere, the demand for databases which can seamlessly accumulate massive amount of data is increasing. Databases also have to provide consistency, reliability and high availability. Google Cloud Platform is one of famous cloud providers in the market providing cloud solutions including storage and databases. Cloud Spanner is a fully managed, scalable, distributed database service, offered by Google Cloud Platform. Cloud Spanner combines the benefits of a traditional relational database system with the scale and flexibility of a NoSQL database. In this article we will be learning about, how we can create and configure Cloud Spanner in Google Cloud Platform.