event-store-design
π―SkillA guide to designing an event store, a database that keeps every change in an app as a permanent record instead of overwriting data. It compares storage options and lists good and bad practices.
Installation
npx skills add wshobson/agents --skill event-store-designRun it in a terminal; it asks which AI coding tools to install it for (Claude Code, Codex, Cursor and more).
Uses skills.sh Β· Node.js 22.20+
After installing
Ask for related work and the agent uses it on its own, or call it yourself.
/event-store-designInstall by hand
Copy the whole skill folder from GitHub to the place below. Copying only SKILL.md can leave out files the skill uses.
Open the skill folder β- This project
.claude/skills/event-store-design/ - All projects
~/.claude/skills/event-store-design/
These paths are for Claude Code. For other tools, the command above puts it in the right place.
What this skill does
Overview
Some apps save every change as an "event" instead of only the latest state. This approach is called event sourcing, and the place that holds the events is an event store. This skill explains how to design one and which technology to choose.
Key Features
- Learn the basic shape of an event store and how events are grouped and ordered.
- Compare options such as EventStoreDB, PostgreSQL, Kafka, DynamoDB and Marten.
- Prevent two writers from saving conflicting changes at the same time.
- Handle the same event arriving twice without breaking your data.
- Use ready-made templates from the skill's reference file.
Who is this for?
It is for backend developers building systems that need a full history of changes. It also helps teams deciding whether to build their own event store or use an existing product.
Summarized by AI from this skill's SKILL.md. Suggest a better one
SKILL.md
View on GitHub β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
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
More from this repository10
Helps you build a consistent look for your app with Tailwind CSS v4. It sets up shared colors, sizes, dark mode and reusable components so every screen matches.
A guide to TypeScript's advanced type features, which describe the shape of your data so mistakes are caught before the code runs. It covers reusable types, types that change based on rules, and built-in helper types, with short examples.
Guidance for building reliable server-side apps with Node.js, using Express or Fastify. It covers login, error handling, databases, API design and a list of proven best practices.
Intelligent automation and multi-agent orchestration for Claude Code
Claude Code plugin for AI-powered framework migration workflows, coordinating specialized agents to plan and execute transitions between technology stacks as part of the wshobson/agents marketplace.
A Claude Code plugin for payment system integration covering Stripe, PayPal, and billing platforms with checkout flows, subscription management, and webhook handling in the wshobson/agents ecosystem.
A Claude Code plugin bundling core development tools and agents for everyday tasks like debugging and code generation, part of the wshobson/agents marketplace with 73 focused plugins.
Claude Code plugin for observability and monitoring including logging, metrics, distributed tracing, and alerting, part of the wshobson/agents marketplace with 73 focused plugins.
A Claude Code plugin providing specialized AI agents for deployment strategy planning and execution, covering blue-green deployments, canary releases, rolling updates, and zero-downtime patterns.
Claude Code plugin for JVM language development including Java, Kotlin, and Scala with specialized agents for idiomatic patterns, build tools, and runtime optimization in the wshobson/agents marketplace.