event-sourcing
Use when the system needs an audit log, temporal queries, or event-driven state reconstruction. Do not use when a simple relational model is enough or when strong immediate consistency is required.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- event-sourcing
- license
- MIT
- metadata
- { "owner": "Harley Bartles", "status": "active", "use_when": [ "the system needs an audit log, temporal queries, or event-driven state reconstruction." ], "source-id": "event-sourcing", "source-path": "skills/event-sourcing/SKILL.md", "related_skills": [ "cqrs" ], "do_not_use_when": [ "a simple relational model is enough or when strong immediate consistency is required." ], "provenance-name": "Event Sourcing first-party skill", "source-category": "first_party" }
- description
- Use when the system needs an audit log, temporal queries, or event-driven state reconstruction. Do not use when a simple relational model is enough or when strong immediate consistency is required.
02 资源文件 5
- 参考文档agents/openai.yaml482 B
- 资产文件assets/authority/authority.yaml958 B
- 资产文件assets/authority/CITATIONS.md1.1 KB
- 资产文件assets/authority/source-map.yaml393 B
- 参考文档references/operational-guidance.md747 B
03 SKILL.md 正文
Event Sourcing
Overview
Event sourcing persists the state of a system as a sequence of immutable events, making the event store the source of truth. Current state is reconstructed by replaying events.
When to Use
- Use when an immutable audit trail and temporal querying are required.
- Use when reconstructing past states or diagnosing why a state changed is valuable.
- Use when event-driven integrations need a reliable history.
- Do not use when simple relational queries and strong immediate consistency are sufficient.
Core Pattern
- Record every state change as an append-only event with identity, type, payload, and timestamp.
- Organize events into streams keyed by aggregate or entity.
- Build projections (read models) by folding events into views; use snapshots to speed replay.
- Version events carefully and evolve schemas without breaking historical streams.
Common Mistakes
- Modifying or deleting events instead of appending compensating events.
- Reconstructing state on every read without projections or snapshots.
- Ignoring concurrency conflicts and idempotency.
04 同仓库更多 Skills
writing
Use when drafting, revising, or reviewing prose for human readers and clarity, an authorised voice, or reader-fatigue concerns may interact.
writing-with-clarity
Use when drafting, revising, or reviewing prose intended for human readers, including documentation, README files, reports, explanations, UI copy, errors, comments, commit messages, and pull request text.
writing-style
Use when revising or reviewing human-facing prose against an authorised voice card or a contextual reader-fatigue profile.
skill
暂无简介
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment.
writing-roadmaps
Use when a goal is too large for one writing-plans plan and requires a sequenced roadmap of consecutive plans.