ASP.NET Core Web API Interview Question #189

What is eventual consistency?

Senior API Design, Architecture, Scalability & Production Scenarios Senior Advanced

Quick Interview Answer

Eventual consistency means different parts of a distributed system may temporarily observe different state, but they converge after asynchronous processing completes. It is common when services own separate databases and communicate through messages or events.

Detailed Explanation

Eventual consistency means different parts of a distributed system may temporarily observe different state, but they converge after asynchronous processing completes. It is common when services own separate databases and communicate through messages or events.

The API contract should make intermediate states visible where necessary, such as Pending, Processing, Completed, or Failed, rather than pretending a distributed operation completed atomically.

Code Example

POST /api/orders

HTTP/1.1 202 Accepted

{
  "id": 1001,
  "status": "Processing"
}