Build Your Own X: Architecture
The architecture phase is about data, contracts, and distributed coordination. The Build Your Own X projects in this phase let you implement the mechanisms behind the abstractions you use every day: indexes, query plans, replication, consensus, inverted indexes, and browser layout engines.
Each project is a self-contained tutorial with research links, the curated BYO-X external tutorial list preserved, milestones with code sketches, evidence requirements, common pitfalls, and module integration notes.
The improvement target for this phase is operational realism. A finished architecture project should not only run; it should name its workload, failure mode, consistency or durability boundary, measurement method, and the tradeoff it chose.
Do not paste external database, distributed-systems, or architecture tutorials into your portfolio. Use them as references, then write your own implementation, your own tests, and your own ADRs.
Projects in this phase
| Project | Primary module fit | Difficulty | Languages typically used |
|---|---|---|---|
| Database (Key-Value) | Sem 6 M2 — storage & indexing | Medium | Go, Rust, C++ |
| Database (Relational) | Sem 6 M1–M4 — SQL, transactions | Hard | C, Go, Rust |
| Search Engine | Sem 6 M2 / Sem 7 M2 | Medium | Python, Go |
| Web Server (HTTP from scratch) | Sem 7 M4 — API design | Medium | C, Go, Node.js, Python |
| Web Browser Engine | Sem 7 M1–M2 | Hard | Rust, Python |
| Kafka-like Distributed Log | Sem 6 M3 — replication | Hard | Java, Go, Rust |
| Consensus / Raft | Sem 6 M5 — distributed fundamentals | Hard | Go, Rust, Java |
| Blockchain | Sem 6 M3 + M5 — replication + distributed | Medium | Python, Go, JavaScript |
Additional local book-backed projects:
| Project | Primary module fit | Difficulty | Languages typically used |
|---|---|---|---|
| Redis Server | Sem 6 M2 + Sem 7 M4 - in-memory data server | Medium-Hard | C, C++, Go |
Cross-phase projects:
- Foundations: LLM (for RAG extension on top of Search Engine)
- Systems: Network Stack (TCP), BitTorrent Client
- Production: Front-end Framework
Architecture module → project map
Semester 06: Databases and Distributed Systems
| Module | Recommended BYO projects | Why it fits |
|---|---|---|
| Module 1 — Relational databases & SQL | Database (Relational) | Implementing a SQL parser + planner + executor demystifies the query layer |
| Module 2 — Storage engines & indexing | Database (KV), Redis Server, Search Engine | Disk-first storage, in-memory server behavior, and inverted indexes cover three different index/storage shapes |
| Module 3 — Replication & partitioning | Kafka-like, Blockchain | Partitioned, replicated, ordered log for Kafka; PoW-replicated chain for Blockchain |
| Module 4 — Transactions & consistency | Database (Relational) (later milestones) | MVCC, WAL, isolation |
| Module 5 — Distributed systems fundamentals | Consensus / Raft, Blockchain | Two consensus families: deterministic (Raft) vs probabilistic (Nakamoto) |
Semester 07: Architecture and DDD
| Module | Recommended BYO projects | Why it fits |
|---|---|---|
| Module 1 — Architecture fundamentals & quality | Web Browser Engine (architectural case study) | Browser engines are a textbook example of layered architecture with quality tradeoffs |
| Module 2 — Architecture patterns & modularity | Web Browser Engine, Search Engine | Modular pipeline (parse → style → layout → paint) |
| Module 3 — DDD & bounded contexts | None — design refactor better suits required project | Use the required Semester 7 project for DDD |
| Module 4 — API design & contract evolution | Web Server, Redis Server | HTTP and RESP-style command protocols both force explicit framing, versioning, error, and compatibility decisions |
| Module 5 — ADRs & architecture reviews | (all projects produce ADRs as part of evidence) | Each completed project becomes a case study |
Local source additions
The local Build Your Own source set adds Redis Server as a first-class project. The source ID is build-your-own/redis-james-smith; supporting source IDs are build-your-own/database-james-smith and build-your-own/web-server-node-james-smith.
Keep Database (Key-Value) focused on storage-engine durability and indexing. Use Redis Server when the goal is an in-memory data server with TCP protocol framing, event-loop behavior, TTLs, slow-client handling, and latency evidence.
Project quality rubric
| Dimension | Minimum acceptable evidence | Strong evidence |
|---|---|---|
| Workload | one stated access pattern | read/write mix, data size, and concurrency shape |
| Contract | supported API/protocol/query subset | compatibility tests and explicit unsupported cases |
| State model | documented in-memory/on-disk structures | invariants plus recovery or restart behavior |
| Failure mode | one demonstrated failure case | crash, timeout, slow client, stale replica, or malformed input test |
| Measurement | one benchmark run | repeatable script with latency, throughput, and resource numbers |
| Architecture note | one ADR or design note | tradeoff comparison against an alternative design |
This keeps book-backed projects from becoming reading assignments. They become small systems with evidence.
Build rules (architecture-flavored)
- The project must expose a real tradeoff, not only a happy path. Cache vs no cache, single-leader vs leaderless, hash index vs B-tree.
- Every data or architecture decision must name the access pattern or quality attribute behind it. "Why this index?" → "Because point lookups dominate range scans in this workload."
- Build small mechanisms from scratch when they teach. Use production tools when the module is about operating the decision.
- Diagrams, ADRs, query plans, and failure traces live close to the code.
- One operational tradeoff documented per project. What is sacrificed and what is gained.
Source
- Catalog:
codecrafters-io/build-your-own-x - Browsable mirror:
build-your-own-x.vercel.app - Books, paid tutorials, and 3rd-party guides for every project: see the Build Your Own X — Books & Paid Resources guide in the portal. James Smith's build-your-own.org book series maps directly to four Architecture-phase projects.