CS FundamentalsVery hardProduct-company system-design interview

Assertion (A): Writing the same 'Order' entity into both an orders database and a search index inside one request handler can leave them inconsistent. Reason (R): Without a distributed transaction or an outbox, a crash between the two writes commits one and not the other.

  1. A. A is true but R is false
  2. B. A is false but R is true
  3. C. Both A and R are true, but R does not explain A
  4. D. Both A and R are true and R explains A

Correct answer: D. Both A and R are true and R explains A

This 'dual write' problem is solved by the transactional outbox pattern: write the event to an outbox table in the same database transaction, then publish it reliably to update the index.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic