agentleFS
SpaceFrontiersSpaceFrontiers/ai-overmind/skills/development-technical/data-intensive-systems-architect/SKILL.md

data-intensive-systems-architect

Skill4 starsChanged 12 months agoApache-2.0View on GitHub

Design reliable, scalable, maintainable data-intensive applications. Covers architecture patterns, storage engines (B-Trees, LSM-Trees), replication, partitioning, transactions, and concurrent programming. Use when architecting systems for large-scale data storage, processing, or distributed computing.

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. About 0 are common, 26 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈26

    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:

    When architecting data-intensive systems, always optimize for these three fundamental characteristics:

    line 23
  2. Distinctive:

    Implement redundancy: Use replication and backup strategies

    line 30
  3. Distinctive:

    Test failure scenarios: Use chaos engineering to validate resilience

    line 32
  4. Distinctive:

    Design for horizontal scaling: Add machines rather than bigger machines

    line 39
  5. Distinctive:

    Enable evolvability: Use schema versioning and backward-compatible changes

    line 49
  6. Distinctive:

    Trade-offs: Not optimized for bulk data operations

    line 84
  7. Distinctive:

    Use when: Read-heavy workloads, OLTP systems

    line 103
  8. Distinctive:

    Use when: Write-heavy workloads, append-only patterns

    line 108
  9. Distinctive:

    Read scaling through replicas

    line 120
  10. Distinctive:

    Pattern: No designated leader; any node accepts writes (e.g., Cassandra)

    line 146
  11. Distinctive:

    No single point of failure

    line 151
  12. Distinctive:

    Trade-offs: Must handle consistency issues (read-repair, tombstones, sloppy quorums)

    line 156
  13. Distinctive:

    Best practice: Avoid distributed transactions when possible.

    line 207
  14. Distinctive:

    No deadlocks, better scalability

    line 231
  15. Distinctive:

    Use event logs (Apache Kafka, AWS Kinesis)

    line 301
  16. Distinctive:

    When architecting a data-intensive system, systematically evaluate:

    line 313
  17. Distinctive:

    Solution: Start simple, measure, optimize based on real bottlenecks

    line 352
  18. Distinctive:

    Solution: Prefer local transactions, sagas, or eventual consistency

    line 364
  19. Distinctive:

    Solution: Default to single-leader; use multi-leader only when geo-distribution demands it

    line 368
  20. Distinctive:

    Flexible schema: Document databases, schemaless

    line 403
  21. Distinctive:

    Don't pick technologies first.

    line 410
  22. Distinctive:

    Use distributed tracing for complex flows

    line 420
  23. Distinctive:

    No single points of failure

    line 423
  24. Distinctive:

    Use proven technologies over cutting-edge

    line 430
  25. Distinctive:

    Use well-defined APIs between components

    line 444
  26. Distinctive:

    Practical Implication: When choosing between consistency models, understand that the CAP theorem doesn't force binary choices but rather …

    line 471

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Data-Intensive Systems Architect

Comprehensive guidance for designing data-intensive applications. Based on authoritative sources: DDIA (Kleppmann), Database Internals (Petrov), Designing Distributed Systems (Burns), and concurrent programming research (Raynal, Taubenfeld).

Supporting Documents:

  • algorithms.md - Consensus, partitioning, probabilistic structures
  • database-internals.md - Storage engine deep dive
  • concurrency-primitives.md - Lock-free algorithms
  • design-principles.md - Implementation patterns
  • trade-offs.md - Trade-off analysis framework
  • examples.md - Real-world architectures

Core Principles

When architecting data-intensive systems, always optimize for these three fundamental characteristics:

1. Reliability 🛡️

The system continues to work correctly (performing the correct function at the desired level of performance) even when things go wrong (hardware faults, software faults, human errors).

Key practices:

  • Design for failure: Assume components will fail; eliminate single points of failure
  • Implement redundancy: Use replication and backup strategies
  • Build fault tolerance: Systems should degrade gracefully, not catastrophically
  • Test failure scenarios: Use chaos engineering to validate resilience

2. Scalability 📈

The system's ability to cope with increased load. This isn't just about handling more data, but maintaining performance as load grows.

Key practices:

  • Measure what matters: Track percentile latencies (p95, p99), not just averages
  • Design for horizontal scaling: Add machines rather than bigger machines
  • Partition wisely: Choose appropriate sharding strategies
  • Monitor growth patterns: Understand your load parameters (requests/sec, read/write ratio, data volume)

3. Maintainability 🔧

The system should be easy to operate, understand, and modify over time.

Key practices:

  • Keep it simple: Minimize accidental complexity
  • Ensure observability: Comprehensive logging, metrics, and tracing
  • Enable evolvability: Use schema versioning and backward-compatible changes
  • Document decisions: Record architectural trade-offs and constraints

Data Model Selection

Choose the right data model based on your access patterns and data structure:

Relational Databases 🗄️

When to use:

  • Complex joins and transactions required
  • Strong consistency guarantees needed
  • Well-defined schema with structured data
  • ACID properties are critical

Examples: PostgreSQL, MySQL Trade-offs: Harder to scale horizontally, schema changes can be complex

Document Databases 📄

When to use:

  • Self-contained records (JSON-like documents)
  • Flexible schemas needed
  • Data locality is important (related data stored together)
  • Minimal joins required

Examples: MongoDB, CouchDB Trade-offs: Potential data duplication, join operations less efficient

Graph Databases 🕸️

When to use:

  • Highly interconnected data
  • Relationship traversal is core functionality
  • Social networks, recommendation engines
  • Complex relationship queries

Examples: Neo4j, Amazon Neptune Trade-offs: Not optimized for bulk data operations

Wide-Column Stores 📊

When to use:

  • Time-series data
  • High write throughput required
  • Sparse data with varying columns
  • Eventual consistency acceptable

Examples: Cassandra, HBase Trade-offs: Limited query flexibility, eventual consistency challenges

Storage Engine Considerations

Understand the underlying storage mechanism:

B-Tree Based (PostgreSQL, MySQL)

  • ✅ Strengths: Fast reads, good for range queries
  • ❌ Weaknesses: Slower writes, write amplification
  • Use when: Read-heavy workloads, OLTP systems

LSM-Tree Based (Cassandra, RocksDB)

  • ✅ Strengths: Excellent write performance, efficient compression
  • ❌ Weaknesses: Slower reads, compaction overhead
  • Use when: Write-heavy workloads, append-only patterns

💡 Deep Dive Available: For implementation-level details about B-Trees, LSM-Trees, page organization, WAL, MVCC, buffer management, and storage engine internals, see database-internals.md

Replication Strategies

Single-Leader Replication 👑

Pattern: One leader accepts writes, replicates to followers

Characteristics:

  • Simple to understand and implement
  • Consistent write ordering
  • Read scaling through replicas
  • Easy failover

Trade-offs:

  • Synchronous replication: Strong consistency, higher latency
  • Asynchronous replication: Better availability, potential data loss, replication lag

Use when: Standard default for most applications (PostgreSQL, MySQL, MongoDB)

Multi-Leader Replication 🌐

Pattern: Multiple nodes can accept writes

Characteristics:

  • Multi-region write capability
  • Reduced write latency for geo-distributed users
  • Complex conflict resolution required

Conflict resolution strategies:

  • Last-write-wins (loses data)
  • Version vectors
  • Application-specific merge logic

Use when: Truly necessary for geo-distribution, offline-first applications Warning: Significantly increases complexity; avoid unless essential

Leaderless Replication 🛡️

Pattern: No designated leader; any node accepts writes (e.g., Cassandra)

Characteristics:

  • High availability through quorum reads/writes
  • Eventual consistency model
  • No single point of failure

Quorum formula: W + R > N (where W=write nodes, R=read nodes, N=total replicas)

Use when: High availability priority over strict consistency Trade-offs: Must handle consistency issues (read-repair, tombstones, sloppy quorums)

Partitioning (Sharding) Strategies

Hash Partitioning #️⃣

Approach: Hash key to determine partition

Strengths:

  • Even data distribution
  • Fast point lookups
  • Avoids hotspots

Weaknesses:

  • Poor range query performance
  • Loses data locality

Use when: Uniform access patterns, point lookups dominate

Range Partitioning 📏

Approach: Partition by key ranges

Strengths:

  • Efficient range queries
  • Data locality preserved
  • Natural ordering maintained

Weaknesses:

  • Risk of hotspots (e.g., recent timestamps)
  • Uneven data distribution possible
  • Requires careful key selection

Use when: Range queries are common, time-series data

Partitioning Considerations

  • Secondary indexes: Each shard maintains local index (scatter queries) or global distributed index (itself partitioned)
  • Rebalancing: Automate partition redistribution as nodes added/removed
  • Cross-shard operations: Minimize distributed transactions; consider denormalization

Transaction Management

ACID Transactions 🔒

Use when:

  • Strong consistency required
  • Multi-step operations must be atomic
  • Data integrity is critical

Trade-offs:

  • Added complexity in distributed systems
  • Performance overhead
  • Scalability limitations

Best practice: Avoid distributed transactions when possible; use within single database nodes

Sagas Pattern

Alternative for distributed transactions:

  • Break long transaction into smaller local transactions
  • Compensating actions for rollback
  • Eventual consistency

Use when: Cross-service workflows in microservices

Concurrency Patterns and Synchronization 🔄

Progress Guarantees

Modern concurrent systems provide different levels of progress guarantees:

Blocking (Traditional):

  • May deadlock, requires detection/prevention
  • Simple to reason about and implement
  • Use when: Low contention, simplicity valued
  • Examples: PostgreSQL, MySQL InnoDB

Lock-Free (Modern):

  • System-wide progress guaranteed (≥1 thread succeeds)
  • No deadlocks, better scalability
  • Use when: High contention, maximum throughput critical
  • Examples: Microsoft Hekaton Bw-Trees, RocksDB MemTable

Wait-Free (Specialized):

  • Per-thread bounded progress
  • Strongest guarantee, highest complexity
  • Use when: Real-time requirements, bounded latency critical
  • Examples: Atomic counters (Fetch&Add)

Synchronization Primitive Selection

Choose the right primitive for your use case:

Use CaseRecommended PrimitiveDatabase Example
Buffer pool latchesReaders-writer lock or Lock-freePostgreSQL LWLocks, Hekaton lock-free
Transaction coordination2PL or MVCC+CASMySQL InnoDB, PostgreSQL MVCC
Index updatesLatch coupling or Lock-freeB-Tree latch crabbing, Bw-Trees
Thread poolsSemaphores or Lock-free queuesConnection pool, worker dispatch
Distributed consensusRaft or Multi-PaxosCockroachDB, Google Spanner
Parallel queriesBarrier synchronizationMap-Reduce, parallel aggregation
CountersFetch&Add or Lock-freeStatistics, monitoring

Lock-Based vs. Lock-Free Decision Matrix

Choose Lock-Based when:

  • ✅ Simplicity preferred over maximum performance
  • ✅ Critical sections are short
  • ✅ Contention is low to moderate
  • ✅ Deadlock detection/avoidance is acceptable
  • ✅ Team has standard concurrency expertise

Choose Lock-Free when:

  • ✅ Maximum throughput critical
  • ✅ High contention expected
  • ✅ Deadlock elimination required
  • ✅ Scalability to many cores essential
  • ✅ Team has advanced concurrency expertise

Trade-offs:

  • Lock-based: Simple implementation, potential deadlocks, may not scale
  • Lock-free: Complex implementation, no deadlocks, scales better, requires garbage collection

Distributed Consensus

FLP Impossibility: Pure asynchronous systems cannot guarantee consensus with failures

Practical Solutions:

  • Raft (CockroachDB, TiDB, etcd): Leader-based, log replication, majority quorum
  • Multi-Paxos (Spanner, Cosmos DB): Proposer-acceptor-learner, two-phase protocol
  • Leaderless (Cassandra): Quorum reads/writes, eventual consistency, no consensus

When You Need Consensus:

  • Distributed transaction commit (2PC, 3PC)
  • Leader election in replicated systems
  • Consistent snapshots across shards
  • Configuration management (ZooKeeper, etcd)

💡 Deep Dive Available: For detailed concurrency algorithms, lock-free data structures, progress guarantees, and consensus protocols, see concurrency-primitives.md

Event-Driven Architecture 📩

Benefits:

  • Decouples services
  • Improves scalability
  • Natural audit log
  • Enables event sourcing

Implementation:

  • Use event logs (Apache Kafka, AWS Kinesis)
  • Publish events for state changes
  • Services subscribe to relevant events

Considerations:

  • Embrace eventual consistency
  • Handle duplicate events (idempotency)
  • Event schema evolution
  • Event ordering guarantees

Design Checklist

When architecting a data-intensive system, systematically evaluate:

Requirements Analysis

  • Define load parameters (requests/sec, data volume, concurrent users)
  • Identify latency requirements (average vs percentiles)
  • Determine consistency requirements (strong vs eventual)
  • Assess availability needs (target uptime SLA)
  • Understand data access patterns (read/write ratio, query types)

Architecture Decisions

  • Choose appropriate data model(s) for use cases
  • Select storage engine based on read/write patterns
  • Design replication strategy (single/multi/leaderless)
  • Plan partitioning scheme and key selection
  • Determine transaction requirements
  • Design for horizontal scalability
  • Plan for multi-region if needed

Operational Readiness

  • Implement comprehensive monitoring (metrics, logs, traces)
  • Set up alerting for critical metrics
  • Plan backup and recovery procedures
  • Design schema migration strategy
  • Document operational runbooks
  • Establish capacity planning process
  • Implement chaos testing

Maintainability

  • Minimize complexity where possible
  • Use standard patterns and technologies
  • Document architectural decisions (ADRs)
  • Plan for schema evolution
  • Ensure backward compatibility
  • Establish clear ownership and on-call rotation

Common Anti-Patterns to Avoid

❌ Premature Optimization

Problem: Over-engineering before understanding actual requirements Solution: Start simple, measure, optimize based on real bottlenecks

❌ Ignoring Percentile Latencies

Problem: Optimizing for average latency while p99 suffers Solution: Monitor and optimize tail latencies (p95, p99)

❌ Network Fallacy

Problem: Assuming network is reliable, has zero latency, infinite bandwidth Solution: Design for network failures, retries with exponential backoff, circuit breakers

❌ Distributed Transactions Overuse

Problem: Using distributed transactions by default Solution: Prefer local transactions, sagas, or eventual consistency

❌ Blind Multi-Leader

Problem: Choosing multi-leader without considering conflict complexity Solution: Default to single-leader; use multi-leader only when geo-distribution demands it

❌ Poor Partition Key Selection

Problem: Creating hotspots through uneven distribution Solution: Analyze access patterns; hash for uniform distribution, range for queries

❌ Ignoring Operational Complexity

Problem: Choosing technologies without considering operational burden Solution: Evaluate total cost of ownership including operations, monitoring, expertise

Trade-Off Decision Framework

For every architectural decision, explicitly consider:

Consistency vs Availability (CAP Theorem)

  • CP (Consistency + Partition Tolerance): Sacrifice availability during partitions
  • AP (Availability + Partition Tolerance): Accept eventual consistency
  • Reality: Choose what to prioritize when network fails; most systems need partition tolerance

Latency vs Throughput

  • Low latency: Individual request speed (optimize for p99)
  • High throughput: Total work per second (batch processing)
  • Trade-off: Often inversely related; choose based on use case

Read vs Write Optimization

  • Read-heavy: Caching, replication, denormalization
  • Write-heavy: LSM-trees, append-only logs, eventual consistency
  • Balanced: Hybrid approaches, partitioning by workload

Simplicity vs Performance

  • Simplicity: Easier to understand, maintain, debug
  • Performance: Optimized for specific use case
  • Guideline: Choose simplicity unless performance requirements demand complexity

Schema Flexibility vs Query Efficiency

  • Flexible schema: Document databases, schemaless
  • Rigid schema: Relational, enforced constraints
  • Context: Data structure stability vs need for evolution

Guidelines for Implementation

1. Start with Requirements, Not Technology

Don't pick technologies first. Understand:

  • Data volume and growth rate
  • Query patterns and access frequency
  • Consistency and latency requirements
  • Team expertise and operational capacity

2. Measure Real Workloads

  • Implement comprehensive instrumentation early
  • Track percentiles, not just averages
  • Monitor both application and infrastructure metrics
  • Use distributed tracing for complex flows

3. Design for Failure

  • No single points of failure
  • Graceful degradation
  • Retry with exponential backoff and jitter
  • Circuit breakers for cascading failures
  • Bulkheads for failure isolation

4. Keep It Simple

  • Use proven technologies over cutting-edge
  • Minimize number of different data stores
  • Avoid premature abstraction
  • Question if distributed system is truly needed

5. Plan for Evolution

  • Schema versioning from day one
  • Backward-compatible API changes
  • Feature flags for gradual rollouts
  • Canary deployments
  • Blue-green deployments for major changes

6. Embrace Modularity

  • Break monoliths into services based on scalability needs
  • Use well-defined APIs between components
  • Independent deployment and scaling
  • Separate concerns (compute, storage, caching)

7. Leverage Managed Services

  • Reduce operational burden where appropriate
  • Cloud-native services for commodity needs
  • Focus team effort on business differentiators
  • Balance control vs operational simplicity

Research Foundations

This skill draws on established distributed systems research and academic literature:

Distributed Systems Evolution

Recent research (Lindsay et al., 2021) highlights three major trends in distributed systems evolution:

  1. Accelerated fragmentation driven by commercial interests and physical limitations (end of Moore's law)
  2. Transition from generalized to specialized architectures - each paradigm increasingly targets specific use cases
  3. Cyclical pivoting between centralization and decentralization in coordination patterns

Consensus and Consistency

Academic research confirms that consensus algorithms remain fundamental to distributed systems (Kalajdjieski et al., 2022):

  • Replication and partitioning are proven techniques for scalability and reliability
  • Consistency challenges affect both replicated storage and consensus algorithms
  • The CAP theorem (Brewer, 2000; Gilbert & Lynch, 2002) remains central to understanding trade-offs in distributed systems
  • Strong consistency requires immediate propagation; weak consistency accepts delays

Practical Implication: When choosing between consistency models, understand that the CAP theorem doesn't force binary choices but rather defines what to prioritize during network partitions.

Byzantine Fault Tolerance

Research on distributed consensus (Coan & Welch, 1992) demonstrates:

  • Classic consensus algorithms work with both agreement preservation and disagreement detection
  • Strong consensus (requiring agreement on actual initial values) is more challenging than basic consensus
  • Algorithms like phase-king require n > 4t (where t is faulty processors) for correctness
  • Exponential-time algorithms can solve strong consensus with n > max{3t, mt}

Key Insight: The impossibility results in distributed consensus aren't absolute - they depend on network models (synchronous vs asynchronous) and consistency requirements.

References

Based on principles from:

Books

  • "Designing Data-Intensive Applications" by Martin Kleppmann (O'Reilly, 2017)
  • "Database Internals: A Deep Dive into How Distributed Data Systems Work" by Alex Petrov (O'Reilly, 2019)
  • "Designing Distributed Systems" by Brendan Burns (O'Reilly, 2nd Edition, 2024)
  • "Concurrent Programming: Algorithms, Principles, and Foundations" by Michel Raynal (Springer, 2013)
  • "Synchronization Algorithms and Concurrent Programming" by Gadi Taubenfeld (Pearson, 2006)

Research Papers

Storage Engines:

  • Mohan, C., et al. (1992). "ARIES: A Transaction Recovery Method Supporting Fine-Granularity Locking and Partial Rollbacks Using Write-Ahead Logging"
  • O'Neil, P., et al. (1996). "The Log-Structured Merge-Tree (LSM-Tree)"
  • Levandoski, J., Lomet, D., Sengupta, S. (2013). "The Bw-Tree: A B-tree for New Hardware Platforms"

Concurrency and Synchronization:

  • Fischer, M., Lynch, N., Paterson, M. (1985). "Impossibility of Distributed Consensus with One Faulty Process" (FLP)
  • Herlihy, M. (1991). "Wait-Free Synchronization"
  • Herlihy, M. (1991). "Wait-Free Hierarchy"
  • Michael, M., Scott, M. (1996). "Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms"
  • Mellor-Crummey, J., Scott, M. (1991). "Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors" (MCS Lock)
  • Dice, D., Shalev, O., Shavit, N. (2006). "Transactional Locking II" (TL2 STM)

Distributed Systems:

  • Lindsay, D., Gill, S.S., Smirnova, D., & Garraghan, P. (2021). "The evolution of distributed computing systems: from fundamental to new frontiers". Computing, 103, 1859-1878.
  • Kalajdjieski, J., Raikwar, M., Arsov, N., Velinov, G., & Gligoroski, D. (2022). "Databases fit for blockchain technology: A complete overview". Blockchain: Research and Applications.
  • Coan, B.A., & Welch, J.L. (1992). "Distributed consensus revisited". Information Processing Letters.
  • Lamport, L. (1998). "The Part-Time Parliament" (Paxos)
  • Ongaro, D., Ousterhout, J. (2014). "In Search of an Understandable Consensus Algorithm" (Raft)
  • Attiya, H., Bar-Noy, A., Dolev, D. (1995). "Sharing Memory Robustly in Message-Passing Systems" (ABD Algorithm)

Industry Resources

  • AWS Well-Architected Framework - Reliability Pillar
  • Production experience from large-scale systems (Facebook/RocksDB, Google/LevelDB, Microsoft Hekaton, LinkedIn, Netflix, Uber, CockroachDB)
  • Computer Science Center Courses - Database Internals (Vadim Tsesko, Ilya Teterin), Parallel Programming (Evgeny Kalishenko)

Key Takeaway

No perfect solution exists. Identify what you're optimizing for (consistency vs availability, latency vs throughput, simplicity vs performance) and make intentional, context-aware trade-offs rather than defaulting blindly.

The goal is not to memorize all patterns, but to develop mental models for reasoning about data systems and making informed architectural decisions based on your specific requirements and constraints.

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.