skills/kleppmann-data-intensive/SKILL.md
--- --- license: Apache-2.0 name: kleppmann-data-intensive description: Comprehensive guide to designing reliable, scalable data systems covering databases, streaming, and consistency category: Research & Academic tags: - data-systems - distributed-systems - databases - streaming - consistency --- # SKILL: Designing Data-Intensive Systems (Kleppmann) **Source**: *Designing Data-Intensive Applications* by Martin Kleppmann **Domain**: Distributed systems, data architecture, reliability
npx skillsauth add curiositech/windags-skills skills/kleppmann-data-intensiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Source: Designing Data-Intensive Applications by Martin Kleppmann Domain: Distributed systems, data architecture, reliability engineering Applies to: Building systems where data complexity (not computation) is the bottleneck
IF: Strong consistency required (banking, inventory)
AND: Can tolerate higher latency + coordination overhead
THEN: Use linearizability with synchronous replication
IF: Operations need ordering but not global agreement
AND: User experience matters more than strict consistency
THEN: Use causal consistency (preserve cause-effect, allow concurrent ops)
IF: High availability required during network partitions
AND: Can resolve conflicts application-side
THEN: Accept eventual consistency with conflict resolution
IF: Read-your-writes is critical but global consistency isn't
AND: Users mostly operate on their own data
THEN: Route user reads to leader/use session consistency
IF: tail latency > 500ms + replication lag > 1s
AND: Cache hit rate < 80%
THEN: Switch to local quorum reads, accept bounded staleness
IF: Write throughput bottleneck identified
AND: Operations can be partitioned by key
THEN: Implement horizontal partitioning with partition-local transactions
IF: Cross-partition queries frequent
AND: Eventual consistency acceptable for derived data
THEN: Use CQRS pattern (separate write/read paths)
IF: Coordination overhead dominates response time
AND: Operations can be made idempotent
THEN: Replace distributed locks with compare-and-set operations
IF: Component failure detected (timeout/error)
AND: Operation might have succeeded
THEN: Make operation idempotent, use unique request IDs for retry
IF: Distributed resource coordination required
AND: Process pauses/network delays possible
THEN: Implement fencing tokens (resource rejects lower-numbered tokens)
IF: Multi-step workflow spans services
AND: Atomic rollback needed
THEN: Use saga pattern with compensating transactions, not 2PC
IF: Service dependency causing tail latency spikes
THEN: Implement circuit breaker + hedged requests after timeout threshold
Symptoms: Two nodes both believe they're the leader, conflicting writes accepted Root Causes: Network partition + inadequate quorum checking + lease expiry race conditions Detection Rule: If you see duplicate primary keys or "impossible" data states after network events Fixes (ranked by speed/safety):
Symptoms: Single component failure causes system-wide outage, p99 latency spike across all services Root Causes: Synchronous dependencies + no circuit breakers + retry storms + unbounded queues Detection Rule: If failure rate increases exponentially rather than linearly with initial fault Fixes (ranked by speed/safety):
Symptoms: User writes data, immediately reads and sees old value, claims "data was lost" Root Causes: Async replication lag + load balancer routes read to stale replica + no session affinity Detection Rule: If user complaints about "lost data" correlate with write-then-read patterns Fixes (ranked by speed/safety):
Symptoms: Multiple processes acquire same lock simultaneously, resource corruption occurs Root Causes: Lock service uses timeouts without fencing + GC pauses + network delays exceed lease time Detection Rule: If you see lock violation errors or concurrent modification of "protected" resources Fixes (ranked by speed/safety):
Symptoms: Cache expires, all requests hit database simultaneously, database overloads Root Causes: Cache expiry + no request deduplication + synchronous cache population + high concurrency Detection Rule: If database load spikes correlate with cache miss events Fixes (ranked by speed/safety):
Scenario: User adds last item to cart, another user tries same item simultaneously
Decision Process:
Implementation:
-- Atomic inventory check with compare-and-set
UPDATE inventory
SET quantity = quantity - 1, version = version + 1
WHERE product_id = ? AND quantity >= 1 AND version = ?
Novice would miss: Using SELECT then UPDATE (race condition window) Expert catches: Version field prevents lost updates, quantity check prevents overselling
Fallback handling:
Scenario: User posts update, immediately checks feed, doesn't see their post
Decision Process:
Implementation Strategy:
Quality validation:
This skill should NOT be used for:
Delegate to other skills:
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.