0
0
GCPcloud~10 mins

Cloud Spanner for global distribution in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Cloud Spanner instance with multi-region configuration.

GCP
gcloud spanner instances create my-instance --config=[1] --description="Global instance" --nodes=3
Drag options to blanks, or click blank then click option'
Aasia-east1
Bnam6
Cregional-us-central1
Deurope-west1
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a single region like 'asia-east1' instead of a multi-region config.
Using a regional config which does not support global distribution.
2fill in blank
medium

Complete the code to create a Cloud Spanner database in the instance.

GCP
gcloud spanner databases create my-database --instance=[1]
Drag options to blanks, or click blank then click option'
Aspanner-instance
Bglobal-instance
Ctest-instance
Dmy-instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different instance name than the one created.
Using a placeholder name instead of the actual instance name.
3fill in blank
hard

Fix the error in the command to add a read-write region to the instance.

GCP
gcloud spanner instances update my-instance --add-[1]=europe-west1
Drag options to blanks, or click blank then click option'
Aread-write-region
Bread-region
Creplica
Dregion
Attempts:
3 left
💡 Hint
Common Mistakes
Using --add-region which is invalid.
Using --add-read-region which adds read-only region, not read-write.
4fill in blank
hard

Fill both blanks to configure the instance with 5 nodes and a multi-region config.

GCP
gcloud spanner instances create my-global-instance --config=[1] --nodes=[2]
Drag options to blanks, or click blank then click option'
Anam6
B3
C5
Dregional-us-central1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a regional config instead of multi-region.
Setting nodes to a string instead of a number.
5fill in blank
hard

Fill all three blanks to create a database with a DDL statement for a table.

GCP
gcloud spanner databases ddl update my-database --instance=[1] --ddl='CREATE TABLE [2] (Id INT64 NOT NULL, Name STRING(100)) PRIMARY KEY([3])'
Drag options to blanks, or click blank then click option'
Amy-instance
BUsers
CId
Dmy-database
Attempts:
3 left
💡 Hint
Common Mistakes
Using the database name instead of instance name in the --instance flag.
Using a wrong table name or primary key column.