Skip to content

Investigate: StreamVersion vs EventId for optimistic concurrency #249

@jwilger

Description

@jwilger

Overview

Investigate whether using EventId (UUID) for optimistic concurrency instead of StreamVersion (sequential integer) would provide benefits.

Current Approach

  • StreamVersion: sequential integer per stream
  • Pro: Gap-free, simple mental model
  • Con: Requires careful version management

Alternative Approach

  • EventId: UUID for each event
  • Pro: Globally unique, no coordination needed
  • Con: Less intuitive for "expected version" semantics

Questions to Answer

  • What are the tradeoffs in terms of API ergonomics?
  • Does EventId-based concurrency simplify or complicate the implementation?
  • Are there performance implications?
  • How do other event sourcing libraries handle this?

Acceptance Criteria

  • Research completed
  • Tradeoffs documented
  • Recommendation made (keep current approach or change)

Migrated from beads issue: eventcore-aet

Metadata

Metadata

Assignees

No one assigned

    Labels

    researchInvestigation / spike

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions