MCP HubMCP Hub
SKILL·385E1D

ddia-systems

wondelai
업데이트됨 15 days ago
6 조회
2,020
206
2,020
GitHub에서 보기
테스팅aidesigndata

정보

이 스킬은 저장, 복제, 파티셔닝, 일관성에 관한 원칙을 제공하여 개발자가 데이터 중심 시스템을 설계하고 문제를 해결할 수 있도록 돕습니다. 데이터베이스 선택, 대규모 쿼리 최적화, 복제 지연 및 데이터 불일치와 같은 문제 디버깅 시 활용하세요. 신뢰할 수 있는 데이터 파이프라인 구축을 위해 데이터 모델부터 분산 합의에 이르는 핵심 개념을 다룹니다.

빠른 설치

Claude Code

추천
기본
npx skills add wondelai/skills -a claude-code
플러그인 명령대체
/plugin add https://github.com/wondelai/skills
Git 클론대체
git clone https://github.com/wondelai/skills.git ~/.claude/skills/ddia-systems

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Designing Data-Intensive Applications Framework

A principled approach to building reliable, scalable, and maintainable data systems. Apply these principles when choosing databases, designing schemas, architecting distributed systems, or reasoning about consistency and fault tolerance.

Core Principle

Data outlives code. Applications are rewritten and frameworks come and go, but data persists for decades -- prioritize the long-term correctness, durability, and evolvability of the data layer. Most applications are data-intensive, not compute-intensive: the hard problems are data volume, complexity, and rate of change, and explicit consistency/availability/latency trade-offs separate robust systems from fragile ones.

Scoring

Goal: 10/10. Score a data architecture by the seven Quick Diagnostic rows below: award ~1.4 points per row answered "yes" with evidence (deliberate, documented trade-off), 0 where the answer is "no" or unknown.

  • 9-10: every domain choice -- data model, storage engine, replication, partitioning, isolation, derived-data, fault handling -- is deliberate, documented, and matched to actual read/write/consistency requirements; failover tested.
  • 5-6: core choices made but two or three diagnostic rows fail -- e.g. default isolation level unknown, hot-key risk unhandled, or failover untested.
  • <=3: choices driven by familiarity, not requirements; ignored failure modes (replication lag, write skew, hot partitions) and accidental complexity dominate.

Report the current score, which diagnostic rows failed, and the improvements needed to reach 10/10.

The DDIA Framework

Seven domains for reasoning about data-intensive systems:

1. Data Models and Query Languages

Core concept: The data model shapes how you think about the problem. Relational, document, and graph models each impose different constraints and enable different query patterns.

Why it works: Choosing the wrong data model forces application code to compensate for representational mismatch, adding accidental complexity that compounds over time.

Key insights:

  • Relational models excel at many-to-many relationships and ad-hoc queries; document models at one-to-many relationships and locality; graph models at recursive traversals over interconnected data
  • Schema-on-write (relational) catches errors early; schema-on-read (document) offers flexibility
  • Polyglot persistence -- different stores for different access patterns -- is often the right answer
  • Object-relational impedance mismatch is a real cost; document models reduce it for self-contained aggregates

Code applications:

ContextPatternExample
User profiles with nested dataDocument model for self-contained aggregatesProfile, addresses, and preferences in one MongoDB document
Social network connectionsGraph model for relationship traversalNeo4j Cypher: MATCH (a)-[:FOLLOWS*2]->(b) for friend-of-friend
Financial ledger with joinsRelational model for referential integrityPostgreSQL foreign keys between accounts, transactions, entries

See references/data-models.md when picking relational vs document vs graph or evaluating schema-on-read -- adds the full trade-off matrix and query-language comparisons.

2. Storage Engines

Core concept: Storage engines trade off read performance against write performance. Log-structured engines (LSM trees) optimize writes; page-oriented engines (B-trees) balance reads and writes.

Key insights:

  • LSM trees: append-only writes, periodic compaction, excellent write throughput, higher read amplification
  • B-trees: in-place updates, predictable read latency, write amplification from page splits
  • Write amplification (one logical write causing multiple physical writes) matters for SSDs with limited write cycles
  • Column-oriented storage dramatically improves analytical queries through compression and vectorized processing
  • In-memory databases are fast because they avoid encoding overhead, not because they avoid disk

Code applications:

ContextPatternExample
High write throughputLSM-tree engineCassandra or RocksDB for time-series ingestion at 100K+ writes/sec
Mixed read/write OLTPB-tree enginePostgreSQL B-tree indexes for transactional point lookups
Analytical queriesColumn-oriented storageClickHouse or Parquet for scanning billions of rows, few columns

See references/storage-engines.md when a workload is read/write-bound or you must choose indexes -- adds write/read-path diagrams, compaction strategies, column storage, and a benchmark-driven decision procedure.

3. Replication

Core concept: Replication keeps copies of data on multiple machines for fault tolerance, scalability, and latency reduction. The core challenge is handling changes consistently.

Why it works: Every replication strategy trades off consistency, availability, and latency. Making the trade-off explicit prevents subtle anomalies that surface only under load or failure.

Key insights:

  • Single-leader: simple, strong consistency possible, but the leader is a bottleneck and single point of failure
  • Multi-leader: better write availability across data centers, but complex conflict resolution
  • Leaderless: highest availability via quorum reads/writes, but needs careful conflict handling
  • Replication lag causes read-your-writes, monotonic-read, and causality violations
  • Synchronous replication guarantees durability but adds latency; asynchronous risks data loss on failover
  • CRDTs and last-writer-wins resolve conflicts with very different correctness guarantees

Code applications:

ContextPatternExample
Read-heavy web appSingle-leader with read replicasPostgreSQL primary + read replicas behind pgBouncer
Multi-region writesMulti-leader replicationCockroachDB or Spanner with bounded staleness
Shopping cart availabilityLeaderless with mergeDynamoDB with last-writer-wins or application-level cart merge

See references/replication.md when choosing single/multi/leaderless or debugging stale reads -- adds lag anomalies, quorum math, conflict resolution, and CRDTs.

4. Partitioning

Core concept: Partitioning (sharding) distributes data across nodes so each handles a subset, enabling horizontal scaling beyond a single machine.

Key insights:

  • Key-range partitioning supports efficient range scans but risks hotspots on sequential keys
  • Hash partitioning distributes load evenly but destroys sort order, making range queries expensive
  • Local secondary indexes require scatter-gather queries; global secondary indexes require cross-partition updates
  • Hotspots occur even with hashing when a single key is extremely popular (celebrity problem)
  • Rebalancing strategies: fixed partition count, dynamic splitting, or proportional to nodes

Code applications:

ContextPatternExample
Time-series dataKey-range partitioning by time + sourcePartition by (sensor_id, date) to avoid current-day write hotspot
User data at scaleHash partitioning on user IDCassandra consistent hashing on user_id for even distribution
Celebrity/hot-key problemKey splitting with random suffixAppend random digit to hot key, fan out reads across 10 sub-partitions

See references/partitioning.md when sharding or fighting a hot key -- adds rebalancing strategies, request routing, and local-vs-global secondary index trade-offs.

5. Transactions and Consistency

Core concept: Transactions provide safety guarantees (ACID) that simplify application code by letting you pretend failures and concurrency don't exist -- within the transaction's scope.

Why it works: Without transactions, every piece of application code must handle partial failures, races, and concurrent modification. Transactions move that complexity into the database, handled correctly once.

Key insights:

  • Isolation levels are a spectrum: read uncommitted, read committed, snapshot isolation, serializable
  • Most databases default to read committed or snapshot isolation -- NOT serializable -- so you must understand the anomalies this permits
  • Write skew: two transactions read the same data, decide, and write different records -- no row lock prevents it
  • Serializable snapshot isolation (SSI) gives full serializability optimistically: no blocking, but aborts on conflict; two-phase locking blocks and deadlocks under contention
  • Distributed transactions (two-phase commit) are expensive and fragile; design around single-partition operations instead

Code applications:

ContextPatternExample
Account balance transferSerializable transactionBEGIN; UPDATE accounts ... -100 WHERE id=1; UPDATE accounts ... +100 WHERE id=2; COMMIT;
Inventory reservationSELECT FOR UPDATE to prevent write skewSELECT stock FROM items WHERE id = X FOR UPDATE before decrementing
Cross-service operationsSaga instead of distributed transactionCharge card, reserve inventory; on failure, run compensating refund

See references/transactions.md when setting isolation levels or chasing a concurrency bug -- adds per-isolation anomaly tables, write-skew examples, 2PL vs SSI, and distributed-transaction pitfalls.

6. Batch and Stream Processing

Core concept: Batch processing transforms bounded datasets in bulk; stream processing transforms unbounded event streams continuously. Both compute derived data.

Why it works: Separating the system of record from derived data (caches, indexes, materialized views) lets each be optimized independently and rebuilt from source when requirements change.

Key insights:

  • MapReduce is conceptually simple but operationally awkward; dataflow engines (Spark, Flink) generalize it with arbitrary DAGs
  • Change data capture (CDC) turns database writes into a stream downstream systems can consume
  • Stream-table duality: a stream is the changelog of a table; a table is the materialized state of a stream
  • Exactly-once semantics require idempotent operations or transactional output
  • Time windowing (tumbling, hopping, session) is essential for aggregating unbounded streams

Code applications:

ContextPatternExample
Daily analytics pipelineBatch processing with SparkRead day's events from S3, aggregate, write to warehouse
Real-time fraud detectionStream processing with FlinkKafka payment events, rules over 5-second tumbling windows
Syncing search indexChange data captureDebezium captures PostgreSQL WAL, Kafka feeds Elasticsearch
Audit trail / event replayEvent sourcingStore OrderPlaced, OrderShipped events; rebuild state by replaying

See references/batch-stream.md when designing a pipeline or deriving data from a system of record -- adds dataflow engines, CDC wiring, windowing, and exactly-once techniques.

7. Reliability and Fault Tolerance

Core concept: Faults are inevitable; failures are not. A reliable system continues operating correctly even when individual components fail. Design for faults, not against them.

Key insights:

  • A fault is one component deviating from spec; a failure is the whole system stopping -- fault tolerance prevents the former becoming the latter
  • Hardware faults are random and independent; software faults are correlated and systematic (more dangerous)
  • Human error is the leading cause of outages -- minimize opportunity for mistakes, maximize ability to recover
  • Timeouts are the fundamental fault detector, but tuning is hard: too short causes false positives, too long delays recovery
  • Safety properties (nothing bad happens) must always hold; liveness (something good eventually happens) may be temporarily violated
  • Byzantine fault tolerance is rarely needed outside blockchain; assume crash-stop or crash-recovery

Code applications:

ContextPatternExample
Service communicationTimeouts + retries with backoffretry(max=3, backoff=exponential(base=1s, max=30s)) with jitter
Leader electionConsensus algorithm (Raft/Paxos)etcd or ZooKeeper for distributed locks and leader election
Graceful degradationCircuit breakerResilience4j: open circuit after 50% failures in 10-second window

See references/fault-tolerance.md when tuning timeouts/retries or adding consensus -- adds fault classification, timeout-tuning math, Raft/Paxos mechanics, and safety/liveness guarantees.

Common Mistakes

MistakeWhy It FailsFix
Choosing a database by popularityEngines have fundamentally different trade-offsMatch storage engine to actual read/write patterns
Ignoring replication lagStale reads, phantom reads, lost updatesImplement read-your-writes and monotonic-read guarantees
Distributed transactions everywhere2PC is slow, fragile; coordinator is a SPOFDesign single-partition operations; use sagas across services
Hash partitioning everythingDestroys range query abilityKey-range partitioning for time-series; composite keys for locality
Assuming serializable isolationDefaults are weaker; write skew appears in productionCheck the actual default; use explicit locking where needed
Conflating batch and streamWrong tool adds latency or wasted complexityMatch processing model to data boundedness and latency needs
Treating all faults as recoverableCorruption and Byzantine faults need different handlingClassify faults; design a recovery strategy per class

Quick Diagnostic

QuestionIf NoAction
Can you explain why you chose this database over alternatives?Choice was familiarity, not requirementsEvaluate data model fit, read/write ratio, consistency needs, scaling path
Do you know your database's default isolation level?Latent concurrency bugsCheck docs; test for write skew and phantom reads
Is your replication strategy explicitly chosen?Implicit consistency/durability assumptionsDocument sync vs async, failover behavior, lag tolerance
Can your system handle a hot partition key?One popular entity can down the clusterAdd key-splitting or load shedding for hot keys
Do you separate system of record from derived data?Every change requires migrating everythingIntroduce CDC or event sourcing to decouple
Are timeouts and retries tuned, not defaulted?Cascading failures or needless delaysMeasure p99; set timeouts above p99, below cascade threshold
Have you tested failover in production conditions?Recovery plan is theoreticalRun chaos experiments: kill leaders, partition networks, fill disks

Further Reading

For the complete treatment with detailed diagrams and research references:

About the Author

Martin Kleppmann is a distributed-systems researcher at the University of Cambridge and a former engineer at LinkedIn and Rapportive, known for his work on CRDTs and local-first software. His book Designing Data-Intensive Applications (2017) is the definitive reference for engineers building data systems, praised for making distributed-systems concepts accessible and practical.

GitHub 저장소

wondelai/skills
경로: plugins/wondelai-skills/skills/ddia-systems
0
agent-skillsai-skillsbusinessclaude-codeclaude-code-marketplaceclaude-code-plugin
FAQ

자주 묻는 질문

ddia-systems Skill이란 무엇인가요?

ddia-systems은(는) wondelai이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 ddia-systems 관련 작업을 수행할 수 있게 합니다.

ddia-systems은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. ddia-systems을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

ddia-systems은(는) 어떤 카테고리에 속하나요?

ddia-systems은(는) 테스팅 카테고리에 속합니다.

ddia-systems은(는) 무료로 사용할 수 있나요?

네. ddia-systems은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

evaluating-llms-harness
테스팅

이 Claude Skill은 MMLU, GSM8K를 포함한 60개 이상의 표준화된 학술 과제에서 LLM 성능을 벤치마크하기 위해 lm-evaluation-harness를 실행합니다. 개발자들이 모델 품질을 비교하고, 학습 진행 상황을 추적하거나 학술 결과를 보고할 수 있도록 설계되었습니다. 이 도구는 HuggingFace와 vLLM 모델을 포함한 다양한 백엔드를 지원합니다.

스킬 보기
cloudflare-cron-triggers
테스팅

이 스킬은 cron 표현식을 사용하여 Worker를 스케줄링하기 위한 Cloudflare Cron Triggers 구현에 관한 포괄적인 지식을 제공합니다. 주기적 작업, 유지보수 작업, 자동화된 워크플로우 설정 방법을 다루며, 잘못된 cron 표현식이나 시간대 문제 같은 일반적인 이슈들을 해결하는 방법을 포함합니다. 개발자들은 이를 통해 스케줄된 핸들러 구성, cron 트리거 테스트, Workflows 및 Green Compute와의 연동 작업을 수행할 수 있습니다.

스킬 보기
webapp-testing
테스팅

이 Claude Skill은 Python 스크립트를 통해 로컬 웹 애플리케이션을 테스트하기 위한 Playwright 기반 툴킷을 제공합니다. 프론트엔드 검증, UI 디버깅, 스크린샷 캡처, 로그 확인 기능을 지원하며 서버 라이프사이클을 관리합니다. 브라우저 자동화 작업에 사용하되 컨텍스트 오염을 방지하기 위해 소스 코드를 읽지 않고 스크립트를 직접 실행하세요.

스킬 보기
finishing-a-development-branch
테스팅

이 스킬은 테스트 통과를 확인한 후 체계적인 통합 옵션을 제시하여 개발자가 완성된 작업을 마무리하도록 돕습니다. 구현이 완료된 후 머지, PR 생성, 브랜치 정리와 같은 워크플로우를 안내합니다. 코드가 준비되고 테스트가 완료되었을 때 개발 프로세스를 체계적으로 마무리하기 위해 사용하세요.

스킬 보기