What's really happening inside the systems you use every day β reconstructed, and rebuilt small enough to run.
Most "how X works" posts stop at a box diagram. These don't. Each teardown goes down to the algorithms, data structures, and the exact tradeoffs β reconstructed from a company's public engineering blog β and ships a small runnable prototype you can read in one sitting.
π Read the blog Β Β·Β πΊοΈ The series arc Β Β·Β β Suggest a teardown Β Β·Β π Run the code
β New teardowns land here regularly β star the repo to follow along.
You use these systems every day. This repo opens them up β one system at a time β and rebuilds the core mechanism small enough that you can read it, run it, and break it in an afternoon.
Every teardown does the same four things:
- π§© Starts from the problem and builds the architecture up one decision at a time.
- π¬ Names the algorithm underneath β inverted index, scatter-gather, fan-out β and explains why it's efficient.
- π» Ships a runnable prototype β not a production clone, just the core idea you can execute.
- π§Ύ Stays honest β inferred from public sources, always cited, never claiming to be anyone's real code.
| # | System | Company | The core idea | π Read | π» Run |
|---|---|---|---|---|---|
| 01 | FishDB β feed retrieval engine | Graph-anchored retrieval: an inverted index + scatter-gather over 48 shards. You post, nothing moves; readers pull it at query time. | Post Β· Deep dive | fishdb/ |
|
| 02 | Twitter timelines | Twitter / X | Fan-out-on-write & the celebrity problem | planned β roadmap | β |
| 03 | Instagram Explore | Meta | The blend, and ranking as the center of gravity | planned | β |
| 04 | Who pays the cost? | β | The synthesis: write-side vs. read-side as one design axis | planned | β |
π§ The series is built to climb toward Teardown 04 β a synthesis where the individual systems stop being the subject and become evidence for one mental model. The full arc is in
SERIES.md.
The hook: YouTube optimizes watch time. Instagram optimizes discovery. LinkedIn optimizes graph relevance β and that one difference changes the entire engineering. When you post, nothing is sent anywhere; it's filed under your name, and readers pull it when they open the app.
What you'll learn (click to expand)
- Inverted vs. forward indexes β and why you need both
- The timeline record
(actor, verb, object)β and why the actor becomes a search term - Scatter-gather over shards + replicas, and why the slowest shard sets your latency
- One-writer-per-shard, the rule that buys lock-free reads
- Lambda ingestion (Kafka for fresh + HDFS for bulk)
- Per-shard top-K with a heap, and the broker's k-way merge
| π Blog post | How LinkedIn Built Its Feed to Answer You in 40 Milliseconds |
| π§ Deep-dive design doc | teardowns/fishdb/DESIGN.md β problem β requirements β HLD β flows β rationale |
| π» Runnable prototype (Java) | teardowns/fishdb/code/ |
cd teardowns/fishdb/code
javac fishdb/*.java
java fishdb.Main # scripted walkthrough β one query, narrated end to end
java fishdb.Main -i # interactive β type your own queries and watch retrieval happen liveSource: LinkedIn Engineering β FishDB. A reconstruction, not LinkedIn's code.
This repo is a blog and a browsable code resource at the same time β pick whichever way you like to learn.
flowchart LR
R["π© Under the Hood<br/>(this repo)"]
R --> B["π The blog<br/>_posts/ β GitHub Pages<br/><i>read the narrative</i>"]
R --> C["π» The code resource<br/>teardowns/<name>/<br/><i>read & run the prototype</i>"]
B -. same teardown .- C
| If you want to⦠| Go to⦠|
|---|---|
| π Read the story of how a system works | the blog (rendered from _posts/) |
| π§ Go deeper β requirements, HLD, sequence diagrams | the teardown's DESIGN.md |
| π» Run the mechanism yourself | the teardown's code/ folder |
Adding a teardown means adding one post + one teardowns/<name>/ folder β nothing else moves.
π Full repo layout (click to expand)
engineering-systems/
βββ README.md β you are here (the hub)
βββ SERIES.md β the planned multi-post arc
βββ NEW_TEARDOWN.md β template + checklist for the next teardown
βββ CONTRIBUTING.md β hosting setup + how to contribute
β
βββ _posts/ β published blog posts (one per teardown) ββ
βββ _config.yml β Chirpy theme config β the
βββ Gemfile β Jekyll / Chirpy dependencies ββ GitHub Pages
βββ _tabs/ β blog nav pages (About, β¦) β blog
βββ .github/workflows/ β auto-build & deploy on push ββ
β
βββ teardowns/ β one self-contained folder per teardown ββ
βββ fishdb/ β the
βββ README.md β this teardown's local hub ββ code
βββ DESIGN.md β the deep-dive design doc β resource
βββ code/ β runnable prototype ββ
Each teardown's code/ folder is self-contained β no shared build system, no monorepo tooling.
Clone, cd, run.
git clone https://github.com/jkaus324/engineering-systems.git
cd engineering-systems/teardowns/fishdb/code
javac fishdb/*.java && java fishdb.Main -iFishDB's prototype needs JDK 21+ (it uses records and virtual threads) and zero dependencies. Future teardowns each state their own language + version in their folder's README.
flowchart LR
T1["β
01 Β· LinkedIn<br/>read-side retrieval"] --> T2["β³ 02 Β· Twitter<br/>fan-out-on-write"]
T2 --> T3["β³ 03 Β· Instagram<br/>the blend"]
T3 --> T4["π― 04 Β· Synthesis<br/>who pays the cost?"]
Each post stands alone and becomes a data point for the finale β where push-vs-pull turns out to
be a single design axis you can use to reason about any feed. Full reasoning in SERIES.md.
These are educational reconstructions inferred from public engineering blogs. They are:
- β Cited β every quantitative claim traces back to its public source.
- β Flagged β anything inferred beyond the source is marked inline.
- β Not affiliated with, endorsed by, or containing source code from any company discussed.
If a detail here disagrees with the original source, trust the source β and please open an issue so it can be fixed.
Corrections, and suggestions for systems to tear down next, are very welcome.
- π Found an error? Open an issue β trust the source over the reconstruction.
- β Want to add a teardown? It's one post + one folder β see
NEW_TEARDOWN.md. - π Hosting / setup? The one-time GitHub Pages steps are in
CONTRIBUTING.md.
All trademarks belong to their respective owners. Prose & code in this repo: MIT β see LICENSE.
Built with curiosity. If a teardown taught you something, a β helps others find it.