PROFESSIONAL-CLOUD-DEVELOPER · Question #237
You work for an organization that manages an online ecommerce website. Your company plans to expand across the world; however, the estore currently serves one specific region. You need to select a…
The correct answer is C. Create a Cloud Spanner table that has TransactionId and CustomerId configured as primary. Cloud Spanner is the correct choice for a globally scaling SQL database. Unlike Cloud SQL, which is a regional service and cannot horizontally scale to support worldwide traffic without significant architecture changes, Cloud Spanner is a fully managed, globally distributed…
Question
You work for an organization that manages an online ecommerce website. Your company plans to expand across the world; however, the estore currently serves one specific region. You need to select a SQL database and configure a schema that will scale as your organization grows. You want to create a table that stores all customer transactions and ensure that the customer (CustomerId) and the transaction (TransactionId) are unique. What should you do?
Options
- ACreate a Cloud SQL table that has TransactionId and CustomerId configured as primary keys.
- BCreate a Cloud SQL table that has TransactionId and CustomerId configured as primary keys.
- CCreate a Cloud Spanner table that has TransactionId and CustomerId configured as primary
- DCreate a Cloud Spanner table that has TransactionId and CustomerId configured as primary
How the community answered
(16 responses)- B13% (2)
- C81% (13)
- D6% (1)
Explanation
Cloud Spanner is the correct choice for a globally scaling SQL database. Unlike Cloud SQL, which is a regional service and cannot horizontally scale to support worldwide traffic without significant architecture changes, Cloud Spanner is a fully managed, globally distributed relational database with horizontal scaling. Configuring TransactionId and CustomerId as a composite primary key ensures that each combination is unique, meeting the uniqueness requirement for both customer and transaction. Option D is also Cloud Spanner but likely uses an interleaved table structure or different key ordering that is not optimal. Cloud SQL (options A and B) cannot scale globally as described in the scenario requirements.
Topics
Community Discussion
No community discussion yet for this question.