All skills
wshobson avatar

/event-store-design

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

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

Use this Skill: https://skilld.dev/gh/wshobson/agents/event-store-design

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ52 tokens always: the name and description. โ‰ˆ978 when used: this file. โ‰ˆ2.9k more on demand in 1 file.

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

Source: SKILL.md on GitHub

1 warning16d5 checks ยท Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides architectural guidance and implementation templates for event store infrastructure. It follows security best practices and contains no malicious code.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW ยท No issues

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 ยท 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • event-sourcing
  • event-store
  • architecture
  • persistence
  • postgresql
  • eventstore
  • kafka
  • dynamodb
  • schema-design
  • concurrency-control

README badge

README badge for wshobson/agents/event-store-design

Guides design and implementation of event stores for event-sourced systems, covering architecture patterns, technology selection (EventStoreDB, PostgreSQL, Kafka, DynamoDB), and schema optimization. Use when building event sourcing infrastructure or choosing between persistence technologies for append-only event streams.

Generated from the current SKILL.md.

What event store technologies does this skill cover?
The skill compares EventStoreDB, PostgreSQL, Kafka, DynamoDB, and Marten, discussing when each is appropriate and their tradeoffs.
Does this skill provide implementation templates?
Yes. Concrete templates and worked examples are in the referenced `references/details.md` file.
What's the core principle behind event store design in this skill?
Events are append-only, immutable facts ordered per stream and globally. The skill emphasizes idempotency, versioning, and optimistic concurrency control to prevent data corruption.
Does this cover scaling event stores?
The skill lists event store scaling as a planning concern but focuses primarily on architecture, technology selection, and design patterns rather than detailed scaling strategies.

Generated from the current SKILL.md. These answers refresh after source changes.