nerdexam
Google

PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #65

You are designing for a write-heavy application. During testing, you discover that the write workloads are performant in a regional Cloud Spanner instance but slow down by an order of magnitude in a…

The correct answer is A. Place the bulk of the read and write workloads closer to the default leader region. In a multi-regional Cloud Spanner instance, all write transactions must achieve a quorum commit, which requires the default leader region to participate. If write requests originate far from the leader region, they incur significant network round-trip latency before being…

Optimizing Cloud Spanner Performance

Question

You are designing for a write-heavy application. During testing, you discover that the write workloads are performant in a regional Cloud Spanner instance but slow down by an order of magnitude in a multi-regional instance. You want to make the write workloads faster in a multi- regional instance. What should you do?

Options

  • APlace the bulk of the read and write workloads closer to the default leader region.
  • BUse staleness of at least 15 seconds.
  • CAdd more read-write replicas.
  • DKeep the total CPU utilization under 45% in each region.

How the community answered

(32 responses)
  • A
    84% (27)
  • B
    9% (3)
  • C
    3% (1)
  • D
    3% (1)

Explanation

In a multi-regional Cloud Spanner instance, all write transactions must achieve a quorum commit, which requires the default leader region to participate. If write requests originate far from the leader region, they incur significant network round-trip latency before being committed. Placing the application (and thus the bulk of read/write workloads) in the same or a nearby region as the default leader dramatically reduces this latency. Using read staleness (B) helps reads avoid the leader but has no effect on write latency. Adding more read-write replicas (C) increases replication overhead and can actually slow down writes. Keeping CPU under 45% (D) is a general best-practice threshold to avoid hotspots but does not address the fundamental cross-region write latency problem.

Topics

#Cloud Spanner#Multi-regional deployments#Write performance#Latency optimization

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DATABASE-ENGINEER Practice