Design and implement event stores for event-sourced systems

Event store design

by wshobson · MIT license · ★ 39,857 on GitHub · updated Sep 21

Event store design cover

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

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

# 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

Overview

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

Manual install (npx, ZIP)
Claude Codenpx skills add wshobson/agents --skill event-store-design -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \ | tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/backend-development/skills/event-store-design
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/df73c96fce3b6cd90e88/event-store-design.zip" -OutFile "$env:TEMP\event-store-design.zip"; Expand-Archive "$env:TEMP\event-store-design.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md4.1 KB
  • references/1 file · 11.2 KB
Read the files here
wshobson/4236bb92 files
SKILL.md
Show the full text81 lines

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
1---
2name: event-store-design
3description: Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
4---
5 
6# Event Store Design
7 
8Comprehensive guide to designing event stores for event-sourced applications.
9 
10## When to Use This Skill
11 
12- Designing event sourcing infrastructure
13- Choosing between event store technologies
14- Implementing custom event stores
15- Optimizing event storage and retrieval
16- Setting up event store schemas
17- Planning for event store scaling
18 
19## Core Concepts
20 
21### 1. Event Store Architecture
22 
23```
24┌─────────────────────────────────────────────────────┐
25│ Event Store │
26├─────────────────────────────────────────────────────┤
27│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
28│ │ Stream 1 │ │ Stream 2 │ │ Stream 3 │ │
29│ │ (Aggregate) │ │ (Aggregate) │ │ (Aggregate) │ │
30│ ├─────────────┤ ├─────────────┤ ├─────────────┤ │
31│ │ Event 1 │ │ Event 1 │ │ Event 1 │ │
32│ │ Event 2 │ │ Event 2 │ │ Event 2 │ │
33│ │ Event 3 │ │ ... │ │ Event 3 │ │
34│ │ ... │ │ │ │ Event 4 │ │
35│ └─────────────┘ └─────────────┘ └─────────────┘ │
36├─────────────────────────────────────────────────────┤
37│ Global Position: 1 → 2 → 3 → 4 → 5 → 6 → ... │
38└─────────────────────────────────────────────────────┘
39```
40 
41### 2. Event Store Requirements
42 
43| Requirement | Description |
44| ----------------- | ---------------------------------- |
45| **Append-only** | Events are immutable, only appends |
46| **Ordered** | Per-stream and global ordering |
47| **Versioned** | Optimistic concurrency control |
48| **Subscriptions** | Real-time event notifications |
49| **Idempotent** | Handle duplicate writes safely |
50 
51## Technology Comparison
52 
53| Technology | Best For | Limitations |
54| ---------------- | ------------------------- | -------------------------------- |
55| **EventStoreDB** | Pure event sourcing | Single-purpose |
56| **PostgreSQL** | Existing Postgres stack | Manual implementation |
57| **Kafka** | High-throughput streaming | Not ideal for per-stream queries |
58| **DynamoDB** | Serverless, AWS-native | Query limitations |
59| **Marten** | .NET ecosystems | .NET specific |
60 
61## Templates and detailed worked examples
62 
63Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates.
64 
65## Best Practices
66 
67### Do's
68 
69- **Use stream IDs that include aggregate type** - `Order-{uuid}`
70- **Include correlation/causation IDs** - For tracing
71- **Version events from day one** - Plan for schema evolution
72- **Implement idempotency** - Use event IDs for deduplication
73- **Index appropriately** - For your query patterns
74 
75### Don'ts
76 
77- **Don't update or delete events** - They're immutable facts
78- **Don't store large payloads** - Keep events small
79- **Don't skip optimistic concurrency** - Prevents data corruption
80- **Don't ignore backpressure** - Handle slow consumers
81 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 39,857
Checked
Source
wshobson/agents ↗
Creator
wshobson · 179 listings
View creator

Similar skills

See all →
SkillCreate branded architecture, architecture deltaDiagram designcathrynlavery/diagram-design · by cathrynlaveryCreate branded architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as HTML/SVG/PNG, with .drawio, Mermaid, and .excalidraw import, plus lifecycle phase maps, block decomposition trees, and onboarding guidance.★ 43.2k GitHub starsSkillReview a PR against the Pascal architectural rulesReview architecturepascalorg/editor · by pascalorgReview a PR against the Pascal architectural rules — package boundaries (core/viewer/editor/nodes), the registry-driven composition model (def.geometry / def.renderer / def.system), legacy-dispatch regressions, the slots + world-scale-UV convention for new nodes/geometry, hook hygiene (useEditor/useScene/useViewer), and selector performance. Use when the user asks to review a PR, audit a branch, or check that changes respect the codebase's architecture.★ 24.6k GitHub starsSkillCreate and edit draw.io/diagrams.net diagramsDraw.io Architecture StudioAgents365-ai/drawio-skill · by Agents365-aiCreate and edit draw.io/diagrams.net diagrams as editable `.drawio` files. Covers architecture, UML/ERD/sequence, BPMN, network, and swimlane views authored from a description or converted from code, IaC, SQL, and API schemas, plus sync, query, test, review, export, and publish of existing diagrams. Use when the user asks for draw.io/diagrams.net or an editable diagram; prefer Mermaid/PlantUML when diagrams-as-code is enough.★ 9.8k GitHub starsSkillCreate polished dark-themed architecture diagramsArchitecture Diagram SkillCocoon-AI/architecture-diagram-generator · by Cocoon-AICreate polished dark-themed architecture diagrams as self-contained HTML+SVG files. Use when the user asks for system, infrastructure, cloud, security, or network topology diagrams.★ 7.4k GitHub starsSkillThe foundational knowledge distillation pattern for buildingLLM Wiki — Knowledge Distillation PatternAr9av/obsidian-wiki · by Ar9avThe foundational knowledge distillation pattern for building and maintaining an AI-powered Obsidian wiki. Based on Andrej Karpathy's LLM Wiki architecture. Use this skill whenever the user wants to understand the wiki pattern, set up a new knowledge base, or needs guidance on the three-layer architecture (raw sources → wiki → schema). Also use when discussing knowledge management strategy, wiki structure decisions, or how to organize distilled knowledge. This is the "theory" skill — other skills handle specific operations (ingesting, querying, linting).★ 3.5k GitHub starsSkillManage software complexity through deep modulesA Philosophy of Software Design Frameworkwondelai/skills · by wondelaiManage software complexity through deep modules, information hiding, and strategic programming. Use when the user mentions "module design", "API too complex", "shallow class", "complexity budget", "strategic vs tactical", "deep module", "information leakage", "pass-through method", "this code is over-engineered", or "simplify this design". Also trigger when reviewing an interface for simplicity, evaluating whether an abstraction is pulling its weight, deciding whether a comment is worth writing, or choosing between general-purpose and special-purpose approaches. Covers deep vs shallow modules, red flags for complexity, and comments as design documentation. For code quality, see clean-code. For architecture boundaries, see clean-architecture.★ 2.2k GitHub stars

More from wshobson

SkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliancewshobson/agents · by wshobsonImplement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.★ 39.9k GitHub starsSkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Designwshobson/agents · by wshobsonMaster Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.★ 39.9k GitHub starsSkillMigrate from AngularJS to Angular using hybrid modeAngular migrationwshobson/agents · by wshobsonMigrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.★ 39.9k GitHub starsSkillUnderstand anti-reversing, obfuscationAnti reversing techniqueswshobson/agents · by wshobsonUnderstand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.★ 39.9k GitHub starsSkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patternswshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub stars