Bird
0
0

How can you ensure atomicity (all-or-nothing) when performing composite operations across multiple resources?

hard📝 Application Q9 of 15
Rest API - Advanced Patterns
How can you ensure atomicity (all-or-nothing) when performing composite operations across multiple resources?
AUse GET method for all operations.
BUse transactions or rollback support provided by the API server.
CSend each operation as a separate HTTP request.
DInclude a delay between operations in the composite request.
Step-by-Step Solution
Solution:
  1. Step 1: Understand atomicity in composite operations

    Atomicity means either all operations succeed or none do, requiring transaction or rollback support.
  2. Step 2: Evaluate options

    Only Use transactions or rollback support provided by the API server. describes this; sending separate requests or using GET does not guarantee atomicity; delays do not affect atomicity.
  3. Final Answer:

    Use transactions or rollback support provided by the API server. -> Option B
  4. Quick Check:

    Atomicity needs transactions = C [OK]
Quick Trick: Atomic composite ops need server-side transaction support [OK]
Common Mistakes:
MISTAKES
  • Thinking separate requests ensure atomicity
  • Using GET method for changes
  • Adding delays to control atomicity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes