Event Store Design

Event Store Design

Guides an AI agent in designing and implementing event stores for event-sourced systems, covering schemas, ordering, technologies and scaling.

Skill files2 files

references/

SKILL.md81 lines
1
---
2
name: event-store-design
3
description: Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
4
---
5
6
# Event Store Design
7
8
Comprehensive guide to designing event stores for event-sourced applications.
9
10
## When to Use This Skill
11
12
- Designing event sourcing infrastructure
13
- Choosing between event store technologies
14
- Implementing custom event stores
15
- Optimizing event storage and retrieval
16
- Setting up event store schemas
17
- Planning for event store scaling
18
19
## Core Concepts
20
21
### 1. Event Store Architecture
22
23
```
24
┌─────────────────────────────────────────────────────┐
25
│ Event Store │
26
├─────────────────────────────────────────────────────┤
27
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
28
│ │ Stream 1 │ │ Stream 2 │ │ Stream 3 │ │
29
│ │ (Aggregate) │ │ (Aggregate) │ │ (Aggregate) │ │
30
│ ├─────────────┤ ├─────────────┤ ├─────────────┤ │
31
│ │ Event 1 │ │ Event 1 │ │ Event 1 │ │
32
│ │ Event 2 │ │ Event 2 │ │ Event 2 │ │
33
│ │ Event 3 │ │ ... │ │ Event 3 │ │
34
│ │ ... │ │ │ │ Event 4 │ │
35
│ └─────────────┘ └─────────────┘ └─────────────┘ │
36
├─────────────────────────────────────────────────────┤
37
│ Global Position: 1 → 2 → 3 → 4 → 5 → 6 → ... │
38
└─────────────────────────────────────────────────────┘
39
```
40
41
### 2. Event Store Requirements
42
43
| Requirement | Description |
44
| ----------------- | ---------------------------------- |
45
| **Append-only** | Events are immutable, only appends |
46
| **Ordered** | Per-stream and global ordering |
47
| **Versioned** | Optimistic concurrency control |
48
| **Subscriptions** | Real-time event notifications |
49
| **Idempotent** | Handle duplicate writes safely |
50
51
## Technology Comparison
52
53
| Technology | Best For | Limitations |
54
| ---------------- | ------------------------- | -------------------------------- |
55
| **EventStoreDB** | Pure event sourcing | Single-purpose |
56
| **PostgreSQL** | Existing Postgres stack | Manual implementation |
57
| **Kafka** | High-throughput streaming | Not ideal for per-stream queries |
58
| **DynamoDB** | Serverless, AWS-native | Query limitations |
59
| **Marten** | .NET ecosystems | .NET specific |
60
61
## Templates and detailed worked examples
62
63
Full template library and detailed worked examples live in `references/details.md`. Read that file when you need the concrete templates.
64
65
## Best Practices
66
67
### Do's
68
69
- **Use stream IDs that include aggregate type** - `Order-{uuid}`
70
- **Include correlation/causation IDs** - For tracing
71
- **Version events from day one** - Plan for schema evolution
72
- **Implement idempotency** - Use event IDs for deduplication
73
- **Index appropriately** - For your query patterns
74
75
### Don'ts
76
77
- **Don't update or delete events** - They're immutable facts
78
- **Don't store large payloads** - Keep events small
79
- **Don't skip optimistic concurrency** - Prevents data corruption
80
- **Don't ignore backpressure** - Handle slow consumers
81

© Seth Hobson · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,970 prompts

More by @OpenSourceBuffGuy

See all
Pastel autumn outfit lookbook with handwritten annotations prompt image

Pastel autumn outfit lookbook with handwritten annotations

Creates a pastel e-commerce fashion lookbook poster of a model in a simple autumn outfit, with handwritten labels, arrows and a bold headline.

image-prompt, fashion, fashion-shoot, poster, text-rendering, pastel, autumn, full-body, woman, minimalist, negative-space, vertical-format, gpt-image, product-photography, social-media-graphic, photorealistic, for-online-sellers, for-designers, portrait, editorial, whimsical, cozy, studio-lighting

Premium food photography template prompt image

Premium food photography template

Creates a steaming, glossy spicy Sichuan-style dish photo in a dark bowl with chilies and restaurant props, with the food and ratio left to fill in.

image-prompt, gpt-image, food-photography, photorealistic, cinematic, moody, dramatic-lighting, bokeh, close-up, high-angle, square-format, placeholders, template, negative-prompt, cooking, restaurants, product-photography, for-photographers, for-small-business-owners, for-online-sellers, advertising

Configuration Validation prompt image

Configuration Validation

Builds configuration validation for an application: schemas, per-environment rules, runtime checks, secret handling, tests and a security report.

slash-command, code-generation, python, best-practices, security-review, testing, audit, yaml-prompt, developer-tools, for-developers, for-devops-engineers, code, report, documentation, migration, advanced, long-form, devops, deployment, structured-output

Reviews

Loading reviews…

Discussion

Loading comments…