Playing with Cloud Spanner V2 | Scribe

    Playing with Cloud Spanner V2

    • Hafeez Baig |
    • 33 steps |
    • 3 minutes
    1
    Sign in into the **Google Cloud Platform**
    2
    Type "**Spanner**" in the search bar and click on the **Spanner** option
    information ordinal icon
    **What is Spanner?**\ \ Cloud Spanner is a Google Cloud relational database service that offers global distribution, scalability, and strong consistency. It combines the reliability of SQL databases with the scalability of NoSQL. Spanner automatically handles data distribution and replication across regions, ensuring high availability and low-latency access. It supports standard SQL queries and ACID transactions, making it suitable for applications needing global consistency and high performance.
    3
    Welcome to Spanner wizard will open, click on the **CREATE A PROVISIONED INSTANCE** button
    4
    **Create an instace** wizard will open, give the Instance name as - "**my-first-spanner-instance**" and click on the **CONTINUE** button
    5
    Scroll to the **Choose a configuration** section and select the option **Regional**
    6
    Click on the **CONTINUE** button
    7
    Scroll to the **Configure compute capacity** section and select the **Nodes** option
    information ordinal icon
    **What are Nodes?**\ \ In the context of Google Cloud Spanner, nodes are the compute resources that power your Spanner instance. Each node provides a certain amount of processing power, memory, and storage. The more nodes you add, the more compute and storage capacity you get, allowing for better performance and higher throughput. Nodes help distribute data and handle queries efficiently, making Spanner scalable and responsive for large databases.
    8
    Scroll to the **Choose a scaling mode** section and select the option **Manual,** then scroll to the **Quantity** text input field and enter "**1**"
    9
    Scroll the page and click on the **CREATE** button
    10
    **my-first-spanner-instance** wizard will open, scroll to the **Databases** section and click on the **CREATE DATABASE** button
    information ordinal icon
    **What are Databases?**\ \ Databases in Google Cloud Spanner are collections of structured data organized to support storage, retrieval, and management. Within a Spanner instance, you can create multiple databases, each containing tables to store your data. These databases support SQL queries, ACID transactions, and schema changes, making them suitable for complex applications. Spanner ensures that these databases are scalable, globally distributed, and consistently synchronized across regions.
    11
    **Create a database in my-first-spanner-instance** wizard will open, give the Database name as - "**my-first-database**"
    12
    Scroll to the **Select database dialect** section and select the option **Google Standard SQL**
    information ordinal icon
    **What is Google Standard SQL?**\ \ Google Standard SQL is a SQL dialect used in Google Cloud services like BigQuery and Cloud Spanner. It follows the SQL:2011 standard, offering a familiar syntax for querying and managing data. This dialect includes support for complex queries, joins, subqueries, and functions, making it versatile for data analysis. It also adds features specific to Google Cloud, such as array and struct data types, making it powerful for handling nested and complex data structures.
    13
    Scroll the page and click on the **CREATE** button
    14
    Click on the **CREATE TABLE** button
    15
    **GOOGLE STANDARD SQL DATABASE** wizard will open, scroll to the **Editor 2** section and enter the code as shown
    16
    Click on the **RUN** button