KNOWLEDGE BASE

Principles

Foundational software engineering principles that guide architectural decisions and code quality. Learn the “why” behind the patterns.

34Principles
510Curated Resources

ACID

A set of database transaction properties: Atomicity, Consistency, Isolation, Durability. Guarantees reliable processing of database transactions.

15 resourcesExplore →

Backpressure

A mechanism that allows a consumer to signal to a producer that it cannot keep up. Prevents systems from being overwhelmed by controlling data flow.

15 resourcesExplore →

BASE

A consistency model used in distributed systems: Basically Available, Soft State, Eventual Consistency. Contrasts with ACID for highly available, partition-tolerant systems.

15 resourcesExplore →

Bulkhead

Isolate components into separate pools so that a failure in one does not cascade to others. Prevents resource exhaustion from affecting the entire system.

15 resourcesExplore →

Caching

Store frequently accessed data in a high-speed storage layer to reduce latency and load on backend systems. A fundamental performance optimization pattern.

15 resourcesExplore →

CAP Theorem

In a distributed system, you can only guarantee two out of three: Consistency, Availability, and Partition Tolerance. A fundamental trade-off in distributed data stores.

15 resourcesExplore →

Circuit Breaker

Prevents repeated attempts to call a failing service by opening the circuit and failing fast. Allows the system to recover by periodically testing the service.

15 resourcesExplore →

Consistency Patterns

Strategies for managing data consistency in distributed systems: strong consistency, eventual consistency, and causal consistency. Each offers different trade-offs.

15 resourcesExplore →

Convention over Configuration

Reduce the number of decisions developers need to make by providing sensible defaults. Frameworks like Rails and Spring use this to simplify setup.

15 resourcesExplore →

Command-Query Separation

Every method should be either a command that performs an action or a query that returns data, but not both. Improves clarity and predictability of code.

15 resourcesExplore →

Defensive Programming

Design code to handle unexpected inputs and states gracefully. Assume inputs will be invalid and protect against potential errors preemptively.

15 resourcesExplore →

Dependency Inversion

Depend upon abstractions, not concretions. High-level modules should not depend on low-level modules; both should depend on abstractions.

15 resourcesExplore →

DRY (Don't Repeat Yourself)

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. Eliminates duplication to reduce maintenance costs.

15 resourcesExplore →

Eventual Consistency

A consistency model where updates propagate to all nodes eventually, but not immediately. Provides high availability at the cost of temporary inconsistency.

15 resourcesExplore →

Fail-Fast

Report errors immediately and halt execution when an unexpected condition occurs. Prevents cascading failures and makes bugs easier to detect.

15 resourcesExplore →

Graceful Degradation

When part of a system fails, the system continues to operate at a reduced capacity rather than failing completely. Essential for resilient distributed systems.

15 resourcesExplore →

Idempotency

An operation that can be applied multiple times without changing the result beyond the first application. Critical for safe retries in distributed systems.

15 resourcesExplore →

Information Hiding

Hide internal implementation details of a module from its consumers. Expose only what is necessary through a well-defined interface.

15 resourcesExplore →

Interface Segregation

No client should be forced to depend on methods it does not use. Prefer small, focused interfaces over large, general-purpose ones.

15 resourcesExplore →

KISS (Keep It Simple, Stupid)

Systems work best when they are kept simple rather than made complex. Avoid unnecessary complexity in design and implementation.

15 resourcesExplore →

Leader Election

A distributed algorithm for selecting a single node as the coordinator among a group of nodes. Essential for consensus and coordination in distributed systems.

15 resourcesExplore →

Liskov Substitution

Objects of a superclass should be replaceable with objects of its subclasses without breaking the system. Subtypes must be substitutable for their base types.

15 resourcesExplore →

Load Shedding

Drops lower-priority requests when the system is under heavy load to ensure critical requests are processed. A key resilience pattern for high-traffic services.

15 resourcesExplore →

Open-Closed Principle

Software entities should be open for extension but closed for modification. Design modules that can be extended without modifying their source code.

15 resourcesExplore →

Optimistic Locking

Assumes multiple transactions can complete without conflict and only checks for conflicts at commit time. Uses version numbers to detect stale updates.

15 resourcesExplore →

Pessimistic Locking

Assumes conflicts will occur and locks data at the start of a transaction to prevent concurrent modifications. Ensures data integrity at the cost of throughput.

15 resourcesExplore →

Principle of Least Privilege

Every program and user should operate with the minimum set of permissions necessary to complete their task. Reduces the attack surface and blast radius.

15 resourcesExplore →

Quorum

A consensus mechanism requiring a minimum number of nodes to agree on a decision. Used in distributed systems for reads/writes and leader election.

15 resourcesExplore →

Rate Limiting

Controls the rate of requests a service can process within a time window. Prevents resource exhaustion and ensures fair usage across clients.

15 resourcesExplore →

Separation of Concerns

Divide a system into distinct sections where each section addresses a separate concern. Reduces complexity by modularizing functionality.

15 resourcesExplore →

Single Responsibility

A class should have only one reason to change, meaning it should have only one job or responsibility. Promotes high cohesion and reduces coupling between components.

15 resourcesExplore →

SOLID Principles

Five object-oriented design principles: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. The foundation of maintainable OOP.

15 resourcesExplore →

Throttling

Slows down the processing of requests to prevent system overload. Often used with rate limiting to gracefully handle traffic spikes.

15 resourcesExplore →

YAGNI (You Ain't Gonna Need It)

Always implement things when you actually need them, never when you merely foresee that you might need them. Prevents over-engineering and code bloat.

15 resourcesExplore →