Event Store Design

by wshobson46891e7e60daNo licenseListed Oct 8, 2026Updated Oct 8, 2026

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

Instructions onlySoftware Development
AI-generated overview

Guides the design and implementation of event stores for event-sourced systems, covering architecture, technology choices and best practices.

What it does
This skill provides guidance on designing event stores for event-sourced applications. It explains core concepts such as append-only streams, ordering, versioning, subscriptions and idempotency, compares event store technologies including EventStoreDB, PostgreSQL, Kafka, DynamoDB and Marten, and lists best practices and pitfalls. It points to a reference file for templates and detailed worked examples.
When to use it
Use it when building event sourcing infrastructure, choosing between event store technologies, implementing custom event stores, or planning event store schemas and scaling. It also suits optimizing event storage and retrieval.
Requirements
No scripts; instructions only. It references a bundled file, references/details.md, for templates and worked examples. No credentials, packages or network access are required.

Event Store Design

Comprehensive guide to designing event stores for event-sourced applications.

When to Use This Skill

  • Designing event sourcing infrastructure
  • Choosing between event store technologies
  • Implementing custom event stores
  • Optimizing event storage and retrieval
  • Setting up event store schemas
  • Planning for event store scaling

Core Concepts

1. Event Store Architecture

┌─────────────────────────────────────────────────────┐│                    Event Store                       │├─────────────────────────────────────────────────────┤│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐ ││  │   Stream 1   │  │   Stream 2   │  │   Stream 3   │ ││  │ (Aggregate)  │  │ (Aggregate)  │  │ (Aggregate)  │ ││  ├─────────────┤  ├─────────────┤  ├─────────────┤ ││  │ Event 1     │  │ Event 1     │  │ Event 1     │ ││  │ Event 2     │  │ Event 2     │  │ Event 2     │ ││  │ Event 3     │  │ ...         │  │ Event 3     │ ││  │ ...         │  │             │  │ Event 4     │ ││  └─────────────┘  └─────────────┘  └─────────────┘ │├─────────────────────────────────────────────────────┤│  Global Position: 1 → 2 → 3 → 4 → 5 → 6 → ...     │└─────────────────────────────────────────────────────┘

2. Event Store Requirements

RequirementDescription
Append-onlyEvents are immutable, only appends
OrderedPer-stream and global ordering
VersionedOptimistic concurrency control
SubscriptionsReal-time event notifications
IdempotentHandle duplicate writes safely

Technology Comparison

TechnologyBest ForLimitations
EventStoreDBPure event sourcingSingle-purpose
PostgreSQLExisting Postgres stackManual implementation
KafkaHigh-throughput streamingNot ideal for per-stream queries
DynamoDBServerless, AWS-nativeQuery limitations
Marten.NET ecosystems.NET specific

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Use stream IDs that include aggregate type - Order-{uuid}
  • Include correlation/causation IDs - For tracing
  • Version events from day one - Plan for schema evolution
  • Implement idempotency - Use event IDs for deduplication
  • Index appropriately - For your query patterns

Don'ts

  • Don't update or delete events - They're immutable facts
  • Don't store large payloads - Keep events small
  • Don't skip optimistic concurrency - Prevents data corruption
  • Don't ignore backpressure - Handle slow consumers

Source and attribution

Source:wshobson/agentsinplugins/backend-development/skills/event-store-designat commit46891e7

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal