Event store design

From mtecoYY/ai-baike · View interactive version

Event store design is an AI agent skill from the GitHub repository mtecoYY/ai-baike. Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

How to use this skill

Skill file

Event Store Design

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

When to Use This Skill

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

Don'ts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.