QuestionQ52

VerifiedDesigning scalable, available, and reliable cloud-native applications

A teammate asks you to review the code below, which adds a credit to an account balance in Cloud Datastore. Which improvement should you recommend that the teammate make?

Question Image

Explanation

A balance increment is a read-modify-write operation that must be atomic. Performing the entity lookup and update in a Cloud Datastore transaction provides serializable isolation and prevents concurrent requests from silently overwriting each other’s balance changes. Cloud Datastore transactions

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!