Field notes on software design
Learn software design,
one drawn idea at a time.
Plain-English explanations of the ideas behind real systems — sketched out and animated so you can watch the pieces actually move.
Basics
SOLID Principles
Five guidelines for writing object-oriented code that stays easy to read, change, and extend as it grows.
Read lessonDRY, YAGNI & KISS
Three timeless rules of thumb — don't repeat yourself, don't build what you don't need, and keep it simple — that keep code easy to change.
Read lessonAbstraction & Encapsulation
Two ideas that let you use something without knowing how it works inside — show only what matters, and protect the rest behind a simple interface.
Read lessonCoupling & Cohesion
Two of the oldest words in software design, and the simplest rule of thumb you'll ever learn: keep coupling low and cohesion high.
Read lessonDependency Injection & IoC
Stop letting objects build their own collaborators — hand them in from outside so your code stays swappable and testable.
Read lessonStatelessness
Why servers that remember nothing locally are the secret to scaling out cleanly.
Read lessonConcurrency vs Parallelism
Concurrency is structuring a program to deal with many things at once; parallelism is actually doing many things at the same instant.
Read lessonSynchronous vs Asynchronous
Decide whether the caller should stop and wait for an answer, or fire the work off and carry on while the result catches up later.
Read lessonIdempotency
Make an operation safe to repeat: running it twice leaves the system in the exact same state as running it once.
Read lessonLatency & Throughput
Two ways to measure speed: how long one request takes, versus how many requests finish per second.
Read lessonHorizontal vs Vertical Scaling
Two ways to handle more traffic: make one machine bigger, or add more machines side by side.
Read lessonTDD & BDD
Write the test before the code, let it drive the design, and turn your specs into living documentation everyone can read.
Read lessonDesign Patterns
Named, reusable solutions to the design problems that keep showing up — and a shared vocabulary for talking about them.
Read lessonData Fundamentals
ACID & Transactions
A transaction bundles several database operations into one all-or-nothing unit, so your data never gets stranded halfway through a change.
Read lessonDatabase Indexing
A small sorted lookup structure that lets the database jump straight to the rows you want instead of reading the whole table.
Read lessonNormalization & Denormalization
Store each fact in exactly one place to keep data honest — then sometimes duplicate it on purpose to make reads fast.
Read lessonReplication & Eventual Consistency
Keeping copies of your data on several machines makes it survive failures and serve more readers — at the price of brief moments where the copies disagree.
Read lesson