sysdesign-dual-write-event-sourcing

Guide design teams through dual-write decisions with a four-axis trade-off scoring framework.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-dual-write-event-sourcing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sysdesign-dual-write-event-sourcing
Source: https://github.com/danilods/matilha-sysdesign-pack/tree/main/skills/sysdesign-dual-write-event-sourcing
Command: npx skills add https://github.com/danilods/matilha-sysdesign-pack --skill sysdesign-dual-write-event-sourcing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides design teams through dual-write decisions where a single user action updates two data stores. This skill helps assess when to adopt patterns such as transactional outbox, change data capture (CDC), or event sourcing, and ensures a clear source of truth and guardrails before decisions are made.

Core Features & Use Cases

  • Identify and name the dual-write anti-pattern, framing the decision space around two-store writes.
  • Compare three alternatives (transactional outbox, CDC, event sourcing) with a structured scoring approach and explicit tradeoffs.
  • Produce artifacts (ADR with a trade-off table, diagrams, and a risk/reconciliation plan) to guide implementation decisions.

Quick Start

Map the current two-store write path, evaluate the three alternatives, and document the chosen pattern with an ADR before prototyping.

Frequently Asked Questions about sysdesign-dual-write-event-sourcing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the dual-write anti-pattern in systems design?

The dual-write anti-pattern occurs when a single user action updates two data stores simultaneously, risking inconsistency. It requires an explicit source of truth and a structured trade-off evaluation to decide if patterns like transactional outbox or event sourcing are needed.

How do I decide between transactional outbox, CDC, and event sourcing for dual writes?

Compare transactional outbox, change data capture, and event sourcing using a four-axis trade-off scoring framework. Evaluate explicit tradeoffs for each pattern against your source of truth requirements to determine which approach best fits your data consistency needs.

When should I use event sourcing instead of a transactional outbox for DB and Kafka updates?

Use event sourcing when your system needs a complete audit log and complex state reconstruction, accepting added complexity. Choose transactional outbox when you only need reliable message delivery alongside database writes without full event replay capabilities.

How do I document a dual-write pattern decision for my team?

Document your dual-write pattern decision by producing an Architecture Decision Record containing a trade-off table, system diagrams, and a risk or reconciliation plan. This ADR locks in the chosen pattern and defines a clear rollback plan before implementation.

What are the main tradeoffs of adopting event sourcing for dual-write scenarios?

Event sourcing tradeoffs involve increased system complexity, eventual consistency challenges, and infrastructure overhead. A structured scoring framework helps evaluate whether the benefits of event replay and auditability outweigh these operational costs for your specific scenario.

Can I apply dual-write tradeoff evaluation to search index and cache updates?

Yes, dual-write tradeoff evaluation applies to search index updates, cache updates, and DB+Kafka scenarios. The framework helps identify your explicit source of truth and guides pattern selection across any two-store write path your system requires.