Transfer Matrix¶
These patterns are so fundamental they appear in nearly every domain. Recognizing them helps you transfer knowledge across fields.
Indirection / Abstraction¶
Core idea: Adding a layer to gain flexibility
Examples:
- Memory: Virtual memory
- Networking: Protocol layers
- Architecture: Dependency inversion
- Data: Views, indexes
Caching / Memoization¶
Core idea: Trading space for time
Examples:
- Memory: Cache hierarchy
- Distributed: CDNs, replicas
- Performance: Result caching
- Data: Materialized views
Partitioning / Sharding¶
Core idea: Divide to conquer scale
Examples:
- Data: Database sharding
- Distributed: Service decomposition
- Memory: NUMA awareness
- Testing: Test isolation
Replication¶
Core idea: Copies for availability or performance
Examples:
- Data: Database replicas
- Distributed: Service redundancy
- Memory: Cache lines
- Files: Backup systems
Batching¶
Core idea: Amortize overhead across operations
Examples:
- I/O: Buffered writes
- Networking: Request batching
- Performance: Bulk operations
- Data: Batch processing
Queueing¶
Core idea: Decouple producers from consumers
Examples:
- Concurrency: Work queues
- Distributed: Message queues
- I/O: Request queues
- Performance: Connection pools
Why These Patterns Matter¶
These patterns aren't just similar-looking code - they represent deep structural solutions to fundamental problems:
- Indirection solves the problem of coupling
- Caching solves the problem of repeated work
- Partitioning solves the problem of scale
- Replication solves the problem of availability
- Batching solves the problem of overhead
- Queueing solves the problem of coupling in time
When you see a new system or architecture, ask: which of these patterns is it using? This question often reveals the core design decisions and trade-offs.