---
name: Event Store Design
slug: event-store-design
category: Data
description: Event Store Design provides patterns and guidance for designing and implementing event stores in event-sourced systems. Use it when choosing event store technologies, implementing persistence, or optimizing event storage and retrieval.
github: "https://github.com/wshobson/agents/tree/main/plugins/backend-development/skills/event-store-design"
language: Python
stars: 38761
forks: 4132
install: "npx degit https://github.com/wshobson/agents/tree/main/plugins/backend-development/skills/event-store-design ~/.claude/skills/event-store-design"
installs_to: ~/.claude/skills/event-store-design
source_path: plugins/backend-development/skills/event-store-design/SKILL.md
collection_size: 25
category_size: 668
collection_url: "https://dirskills.com/collections/wshobson/agents"
added: 2026-08-13T07:37:07.453Z
last_synced: 2026-08-13T07:37:07.453Z
canonical_url: "https://dirskills.com/skills/event-store-design"
---

# Event Store Design

Event Store Design provides patterns and guidance for designing and implementing event stores in event-sourced systems. Use it when choosing event store technologies, implementing persistence, or optimizing event storage and retrieval.

**Install:**

```bash
npx degit https://github.com/wshobson/agents/tree/main/plugins/backend-development/skills/event-store-design ~/.claude/skills/event-store-design
```

## README

# 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

| Requirement       | Description                        |
| ----------------- | ---------------------------------- |
| **Append-only**   | Events are immutable, only appends |
| **Ordered**       | Per-stream and global ordering     |
| **Versioned**     | Optimistic concurrency control     |
| **Subscriptions** | Real-time event notifications      |
| **Idempotent**    | Handle duplicate writes safely     |

## Technology Comparison

| Technology       | Best For                  | Limitations                      |
| ---------------- | ------------------------- | -------------------------------- |
| **EventStoreDB** | Pure event sourcing       | Single-purpose                   |
| **PostgreSQL**   | Existing Postgres stack   | Manual implementation            |
| **Kafka**        | High-throughput streaming | Not ideal for per-stream queries |
| **DynamoDB**     | Serverless, AWS-native    | Query 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
