agentleFS
grndlvlgrndlvl/software-patterns/.claude/skills/ddia/SKILL.md

ddia

Skill17 starsChanged 9 months agoMITView on GitHub

Reference for distributed systems and data architecture concepts from Martin Kleppmann's "Designing Data-Intensive Applications." Use this skill when discussing: - Database selection and data modeling - Replication and high availability - Partitioning/sharding strategies - Distributed transactions - Consistency models and guarantees - Stream vs batch processing - Event sourcing and CQRS "In the presence of a network partition, choose Consistency OR Availability."

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when discussing:

    line 7

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Designing Data-Intensive Applications Skill

Reference for distributed systems and data architecture concepts from Martin Kleppmann's "Designing Data-Intensive Applications."

Activation Triggers

Use this skill when discussing:

  • Database selection and data modeling
  • Replication and high availability
  • Partitioning/sharding strategies
  • Distributed transactions
  • Consistency models and guarantees
  • Stream vs batch processing
  • Event sourcing and CQRS

Quick Reference

Data Models

ModelBest ForTrade-offs
RelationalComplex queries, joins, ACIDSchema rigidity, scaling writes
DocumentHierarchical data, flexibilityPoor joins, denormalization
GraphHighly connected dataSpecialized queries, complexity
Wide-ColumnTime series, analyticsLimited query patterns

Storage Engines

EngineOptimized ForExamples
B-TreeRead-heavy, random accessPostgreSQL, MySQL
LSM-TreeWrite-heavy, sequentialCassandra, RocksDB, LevelDB
Column StoreAnalytics, aggregationsClickHouse, Parquet

Replication Strategies

StrategyConsistencyAvailabilityUse Case
Single LeaderStrongMediumTraditional RDBMS
Multi-LeaderEventualHighMulti-datacenter
LeaderlessEventualHighestHigh availability

Partitioning Strategies

StrategyDescriptionProsCons
RangePartition by key rangesEfficient range queriesHot spots
HashPartition by hash of keyEven distributionNo range queries
CompositeCombine range + hashBalancedComplexity

Consistency Models

ModelGuaranteePerformance
LinearizableStrongest (appears sequential)Slowest
SequentialOperations ordered per clientMedium
CausalCause-effect preservedGood
EventualWill converge eventuallyFastest

Transaction Isolation Levels

LevelDirty ReadNon-RepeatablePhantom
Read Uncommitted✗✗✗
Read Committed✓✗✗
Repeatable Read✓✓✗
Serializable✓✓✓

CAP Theorem

"In the presence of a network partition, choose Consistency OR Availability."

ChoiceBehaviorExamples
CPReject requests if can't guarantee consistencyZooKeeper, HBase
APAccept requests, allow inconsistencyCassandra, DynamoDB

Batch vs Stream Processing

AspectBatchStream
LatencyHigh (hours/days)Low (seconds/minutes)
DataBounded, completeUnbounded, continuous
ProcessingMapReduce, SparkKafka, Flink, Storm
Use CaseAnalytics, ETLReal-time alerts, dashboards

Directory Structure

ddia/
├── SKILL.md
├── data-models/
│   ├── relational.md
│   ├── document.md
│   └── graph.md
├── storage/
│   ├── b-trees.md
│   ├── lsm-trees.md
│   └── column-storage.md
├── replication/
│   ├── leader-follower.md
│   ├── multi-leader.md
│   └── leaderless.md
├── partitioning/
│   ├── strategies.md
│   └── rebalancing.md
├── transactions/
│   ├── acid.md
│   ├── isolation-levels.md
│   └── distributed-transactions.md
├── consistency/
│   ├── models.md
│   └── linearizability.md
├── consensus/
│   └── algorithms.md
└── processing/
    ├── batch.md
    ├── stream.md
    └── event-sourcing.md

Usage Examples

Choosing a Database

Question: "Should I use PostgreSQL or MongoDB?"

Consider:
- Data relationships → See data-models/
- Query patterns → See storage/
- Scale requirements → See partitioning/
- Consistency needs → See consistency/

Designing for Scale

Question: "How do I handle millions of users?"

Consider:
- Read scaling → See replication/leader-follower.md
- Write scaling → See partitioning/strategies.md
- Geographic distribution → See replication/multi-leader.md

Handling Failures

Question: "What happens when a node fails?"

Consider:
- Data durability → See replication/
- Consistency trade-offs → See consistency/models.md
- Recovery → See consensus/algorithms.md

Based on concepts from "Designing Data-Intensive Applications" by Martin Kleppmann.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.