Generated banner for Event Store Design
Generated logo for Event Store Design

Event Store Design

Seth HobsonCommunityCreated by Seth Hobson

  • Skill
  • Guidelines
  • Software development
  • MIT
  • No issues found

From the author

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
— the description by Seth Hobson

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to designing event stores, covering core architectural requirements, technology comparisons, and implementation best practices. It emphasizes the immutable, append-only nature of event sourcing and provides concrete templates for schema design and application-level implementation to ensure data integrity, concurrency control, and efficient event retrieval.

What it does

  • Defines core requirements for event stores including immutability and optimistic concurrency.
  • Compares common storage technologies like PostgreSQL, Kafka, and DynamoDB for event sourcing.
  • Provides SQL schema templates for event and snapshot storage.
  • Offers implementation patterns for appending events with version checking.
  • Outlines best practices for stream naming, event metadata, and schema evolution.
  • Details strategies for handling idempotency and subscription checkpoints.

When to use it

  • When architecting the persistence layer for an event-sourced system.
  • When evaluating which database technology best fits your event sourcing needs.
  • When implementing custom event store logic in a backend application.
  • When optimizing event storage schemas for performance and scalability.
  • When establishing patterns for event versioning and schema evolution.

Advantages

  • Ensures data consistency through optimistic concurrency control.
  • Provides a clear framework for choosing the right storage technology.
  • Includes ready-to-use SQL and code templates for rapid implementation.
  • Promotes best practices for long-term system maintainability and tracing.
  • Addresses critical operational concerns like idempotency and backpressure.

Usage examples

“How should I structure my PostgreSQL schema for an event store?”
The agent provides a SQL template including tables for events, snapshots, and subscription checkpoints with appropriate indexing.
“What are the pros and cons of using Kafka versus PostgreSQL for event sourcing?”
The agent compares the two, highlighting Kafka's high-throughput streaming capabilities versus PostgreSQL's suitability for per-stream queries.
“How do I implement optimistic concurrency when appending events?”
The agent explains the version-checking pattern and provides a Python code example using a database transaction.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/wshobson/event-store-design/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip event-store-design.zip -d .agents/skills

Documentation by Seth Hobson

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

Files

ATTRIBUTION.md

Attribution

This folder is an unmodified copy of the Agent Skill "event-store-design", distributed by AutoGineer (https://autogineer.com/agent-skills).

The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.

Files added by AutoGineer

  • ATTRIBUTION.md: this file, written by AutoGineer

  • LICENSE: copied from LICENSE

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Seth Hobson
Publisher
Seth Hobson (Community)
Source
wshobson/agents · plugins/backend-development/skills/event-store-design · commit 4bde316
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Seth Hobson or Seth Hobson.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download event-store-design.zip