nerdexam
Google

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…

Designing highly scalable, available, and reliable cloud-native applications

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)
  • B
    13% (2)
  • C
    81% (13)
  • D
    6% (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

#Cloud Spanner#Database scalability#Global databases#SQL schema design

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice