EV

event-store-design

Guidance on designing and building robust event stores for event-sourced applications.

Install

mkdir -p .claude/skills/event-store-design && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/488" && unzip -o skill.zip -d .claude/skills/event-store-design && rm skill.zip

Installs to .claude/skills/event-store-design

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
188 chars✓ has a “when” trigger
Advanced

Key capabilities

  • →Design event store schemas
  • →Implement append-only persistence
  • →Configure optimistic concurrency control
  • →Set up event subscriptions
  • →Handle event deduplication

How it works

It guides the design of immutable, append-only event streams that support per-stream ordering and versioning for consistency.

Inputs & outputs

You give it
Event store design requirements
You get back
Schema and implementation strategy

When to use event-store-design

  • →Designing event sourcing infrastructure
  • →Choosing event store technologies
  • →Optimizing event storage and retrieval

About this skill

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

When not to use it

  • →Storing large payloads
  • →Updating or deleting existing events

Prerequisites

Event sourcing infrastructure requirements

Limitations

  • →Requires careful handling of backpressure
  • →Query limitations depend on chosen technology

How it compares

It focuses on event-sourced architecture patterns rather than general-purpose database CRUD operations.

Compared to similar skills

event-store-design side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
event-store-design (this skill)54moNo flagsAdvanced
drizzle-orm323moNo flagsIntermediate
postgresql-table-design306moNo flagsIntermediate
springboot-patterns117moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by wshobson

View all by wshobson →

Search skills

Search the agent skills registry