nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #286

You work on an application that relies on Cloud Spanner as its main datastore. New application features have occasionally caused performance regressions. You want to prevent performance issues by…

The correct answer is B. Create a new Cloud Spanner instance for every build. Load the required data. Delete the Cloud. For concurrent, isolated performance tests against Cloud Spanner, each build needs its own independent instance so tests don't interfere with each other. Creating a new Cloud Spanner instance per build provides full isolation, allows true concurrency, and uses real Cloud…

Optimizing Application Performance

Question

You work on an application that relies on Cloud Spanner as its main datastore. New application features have occasionally caused performance regressions. You want to prevent performance issues by running an automated performance test with Cloud Build for each commit made. If multiple commits are made at the same time, the tests might run concurrently. What should you do?

Options

  • ACreate a new project with a random name for every build. Load the required data. Delete the
  • BCreate a new Cloud Spanner instance for every build. Load the required data. Delete the Cloud
  • CCreate a project with a Cloud Spanner instance and the required data. Adjust the Cloud Build
  • DStart the Cloud Spanner emulator locally. Load the required data. Shut down the emulator after

How the community answered

(13 responses)
  • B
    77% (10)
  • C
    8% (1)
  • D
    15% (2)

Explanation

For concurrent, isolated performance tests against Cloud Spanner, each build needs its own independent instance so tests don't interfere with each other. Creating a new Cloud Spanner instance per build provides full isolation, allows true concurrency, and uses real Cloud Spanner behavior (critical for accurate performance testing). The instance is deleted after the test to control costs. Option A (new project per build) is overkill - project creation is slow, subject to quota limits, and incurs more overhead than needed. Option C (shared instance) fails under concurrency because multiple builds would contend for the same resources and data, producing unreliable results. Option D (local emulator) does not replicate production Cloud Spanner performance characteristics and would give misleading results for a performance regression test.

Topics

#Cloud Spanner#Performance Testing#CI/CD#Test Isolation

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice