Skip to content

Epic: Eventual Consistency and Race Condition Mitigation Across AWS Regions #43

@KeveenMenezes

Description

@KeveenMenezes

Epic Title:
Eventual Consistency and Race Condition Mitigation Across AWS Regions

Problem Statement:
DuckStore experiences heavy asynchronous order, inventory, and account updates across distributed AWS regions. Guaranteeing eventual consistency and preventing race conditions, lost updates, and out-of-order delivery during network partitions and traffic spikes becomes increasingly difficult. Recent failures have resulted in regionally inconsistent shopping carts, stale inventory, and duplicate orders from out-of-sequence event processing.

Architectural Context:

  • .NET 10 microservices, async event-driven messaging (Kinesis, SQS, EventBridge)
  • Distributed state, no single source of truth
  • Multi-env (prod/staging/dev), AWS regions

Constraints:

  • No synchronous fallback for inventory or checkout; replay logic cannot assume ordering.
  • Duplicate and partial message deliveries need to be handled gracefully.
  • External SLAs on consistency from downstream providers

Non-Functional Requirements:

  • SLA: 99.99% consistency within 5 minutes for inventory/order state across regions
  • No data loss in region failover scenarios
  • Region-specific reconciliation tooling and metrics

Acceptance Criteria:

  • Consistency strategy documented and validated under ambiguous and deterministic failures
  • Race condition handling/mechanisms proven via simulation/integration tests
  • Playbook for regional failover and healing

Risk Areas:

  • Race conditions during partition healing
  • Event replay causing duplicate orders/inventory loss
  • Visibility lag affecting user experience

Suggested Research Topics:

  • CRDTs vs. event sourcing for state convergence
  • Idempotency and deduplication strategies for distributed event consumers
  • Automated reconciliation tooling in cloud-native .NET

Difficulty Level: Architect-Level

Metadata

Metadata

Assignees

No one assigned

    Labels

    copilot challengeA challenge proposed by the co-pilot, with simulations of possible production errors.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions