本文へスキップ
Skillpedia
APIとサーバー(バックエンド)41k · #6638

event-store-design

できること

このツールは、起きたことをすべて記録するシステムのための「イベントストア」を計画し、作成する手助けをします。情報を安全に、整理された形で保存するのに役立ちます。

使う場面

  • ✓イベントを記録するシステムの土台を作るとき
  • ✓これらのイベントを保存するために使う技術を選ぶとき
  • ✓イベントの保存と取り出しの方法を整理するとき

スキルのリンク

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/event-store-design/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/event-store-design/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“アプリケーション内のユーザー操作を記録するために、イベントストアをどのように設計すればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

イベントストアの構造を作る手順を案内します。イベントは必ず末尾に追加されること、連番で整理されること、そして重複や欠落が起きないようにする方法を定義していきます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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
よくある質問

「イベントソーシング」とは何ですか?

システム内のすべての状態変化を、イベントの連続として保存する仕組みです。現在の状態だけを保存するのではなく、その状態に至るまでの履歴を保存します。

なぜイベントを更新したり削除したりしてはいけないのですか?

イベントは過去に起きた事実だからです。書き換えると歴史を改ざんすることになり、矛盾が生じるおそれがあります。間違いや取り消しが必要な場合は、新しいイベントを追加して対応するのがよいです。

「相関ID」と「原因ID」とは何ですか?

これらは、イベントがシステムのさまざまな部分をどのように流れ、どこから発生したかを追跡するための識別子です。デバッグや、何が起きたのかを理解するのに役立ちます。

詳細

作者による元の説明

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

repo: wshobson/agents

人気

GitHubのスター
41k
ランキング
#6638
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル