Give me 18 minutes and I'll give you 20+ hours of system design knowledge. I took the big ideas from Designing Data-Intensive Applications by Martin Kleppmann, a 600+ page book, and turned them into 11 short lessons. AI can write your code now, but it can't make the design calls that decide if your app survives real users. That part is still your job.
In this video I cover: the one diagram every system shares, why systems break, safe rollouts, scaling out, SQL vs NoSQL, ACID transactions, indexes, LSM trees vs B-trees, special databases, and how services talk. Great for system design interview prep or for your own AI product.
👋 𝗛𝗲𝘆, 𝗜'𝗺 𝗘𝗿𝗶𝗰. I used to be a senior AI software engineer at Amazon and Microsoft. Now I build bookzero.ai with Claude Code.
0:00 The power and limits of AI in system design
4:27 The fundamental diagram of every system
7:04 The three goals of system design: reliable, scalable, maintainable
10:40 Scaling out, not up: load balancers, replicas, sharding, and caching
13:09 SQL vs NoSQL: choosing the right database for your data
15:23 Transactions: atomicity, consistency, isolation, durability
16:30 Indexes and database storage: the trade-off between reads and writes
17:45 Specialized databases: search, time series, and analytics
19:00 How services communicate: encoding, compatibility, and messaging patterns
This video introduces the fundamentals of system design, emphasizing that architectural decision-making remains a critical human skill that AI cannot yet replace. It covers the journey from basic request-response flows to complex, scalable architectures, focusing on reliability, database selection, storage engines, and efficient service communication to ensure systems survive real-world loads.
Okay, so AI can write pretty much all of your code now.
You can open Claude, say
build me a Facebook-style feed, and it'll just go.
But at some point it stops and asks you stuff like
Postgres or DynamoDB? One server or a load balancer in front of three?
Should we cache this in Redis? One big app or a bunch of microservices?
Should the services call each other directly
Or worse, it doesn't ask, it just picks for you.
or go through a message queue?
And that's the part AI can't really do for you yet,
because those calls decide whether your app survives real users.
Like, in January 2023,
a few deleted files grounded every domestic flight in the US for a
morning, the first nationwide ground stop since 9-11.
In 2024, one bad update from CrowdStrike
Last strike crashed about 8.5 million Windows machines.
And in October 2025,
one bug inside AWS took down a huge chunk of the internet for most
of a day, and DownDetector logged over 11 million problem reports.
None of that was about writing code.
Those were design calls.
That's system design.
And the good news is, most of it comes from a handful of ideas.
A lot of them come from one book,
Designing Data-Intensive Applications by Martin Kleppmann,
which pretty much every backend engineer ends up reading.
So in this video, I'm going to give you
the 11 concepts that matter most, in about 20 minutes.
We'll start with the one picture every system has,
then why systems break and how to ship
without breaking them, then how to scale,
then how databases actually work, and finally how
your services talk to each other. And it goes from simple to advanced,
so whether you're prepping for an interview
or building your own product with AI,
you'll get something out of this.
And it all starts with one simple picture.
Now, before we continue, I recently launched
our school community where I help you to master AI
agents, automations, and building real AI products.
This is coming from someone who used to work as a
senior AI software engineer at companies like Amazon
and Microsoft. And in this community,
you are going to get full AI builder roadmap,
where you're going to start with AI automations,
then later on moving into AI agents, research systems,
SaaS buildings, and eventually how to
how to productize and market your AI skills.
You're gonna get the templates, workflows,
All right,
so first thing first,
lesson one,
every system
is the same diagram.
When people hear system design, they picture some giant scary chart.
But at the start, it's always this.
A user sends a request. That request hits your app server,
which is the thing that exposes your API.
The server talks to a database, the database stores or finds the data,
and the answer goes back to the user.
That's it. Whether you're designing Facebook,
Uber, a bank, or your own SaaS, it starts exactly like that.
Then you add pieces as you need them.
A cache like Redis so you're not hitting the database
for the same thing over and over.
A search engine like Elasticsearch for when people search.
A message queue like Kafka for work that can happen in the background.
And really, system design is just three things on top of that picture.
The data, how it flows, and what happens when something fails.
Learn the basic picture well,
and every new problem is just a few of those pieces moved around.
And this is also how most interviews actually go,
you draw that picture and then they poke at it.
What happens if this server dies?
What's another way you could design this?
And how does that piece actually work? That's pretty much it.
So if you can draw the diagram
and answer those 3 questions for each box,
you're already ahead of most people walking in.
Lesson 2. Every system is trying to hit 3 goals,
and Kleppmann's book opens with exactly these.
Reliable, scalable, and maintainable.
Reliable means it keeps working even when something goes wrong.
Scalable means when you go from 100 users to 10 million,
it can still handle the load.
And maintainable means it's easy to change.
How fast can a new engineer get going in this
codebase? And these days, how easy is it for an AI agent to work in it?
If your code is a mess,
Claude code is going to struggle in it just like a new hire would.
And these three pull against each other all the time.
Adding 10 more servers helps you scale,
But now there's more stuff that can break and more stuff to maintain.
So when you're making any design call, just ask,
which of these three does this help and which one does it hurt?
Before we jump into the next part,
I want to show you something I've been using recently.
So if you build with AI, you probably have a file like this,
a spec.md full of rough notes
and you clean it up by hand before you can write a prompt.
That's basically the gap VoiceOS is trying to solve.
VoiceOS is a desktop voice app for Mac and Windows
that understands what you're looking
at and what you actually want done.
So I circle this paragraph here and ask it out loud.
Make this shorter and turn it into three clear tasks.
And you can see VoiceOS light up at the top,
and now the paragraph is three clean tasks.
And you can circle anything on your screen and tell it what to do.
Now there's two different modes here.
Dictation mode just types whatever I say into any app,
like this Slack message here.
Agent mode is different.
I hold the key, ask for one task, and it actually does it.
So I hold the key and say,
Have Claude Code build the first task from spec.nd.
VoiceOS plugs into Claude Code through MCP,
so the task goes straight over, no typing a prompt.
Give it a minute. Okay, it's done.
Refresh the page here. And you can see the first task is
working. It works in over a hundred languages,
and in apps like Gmail or Slack, it shows you
first before it sends anything.
And you can build your own MCPs for it. This part of the video is
sponsored by VoiceOS, so grab it from the link
at the top of the description and in the pinned comment
All right, let's get back into it.
Lesson 3. Why systems break. And there are really three reasons.
The first is hardware. Disks die,
machines lose power, cables get unplugged.
And this one's real. Sharks have actually bitten
undersea internet cables, and Google has wrapped
its newer cables in extra armor partly because of
The second is software,
a bug that was always sitting in the code waiting for the one input
nobody tested. That's basically what happened to AWS in October 2025.
A hidden race condition,
which is when two processes step on each other's toes,
wiped out the DNS record for DynamoDB in
its biggest region. And because so much of AWS leans on DynamoDB,
it all fell over together,
for around 15 hours. And the third one is people.
Somebody makes one typo in a config file and
That FAA outage? The FAA said contractors
unintentionally deleted files while trying
to fix a sync between the main database and the backup,
and one well-known study of big internet
services found that people making mistakes,
mostly config changes, were the top cause of outages.
And now you can add one more.
AI-written code that looks right, but isn't.
So if things are always going to break,
lesson four is how you ship without breaking production.
Number one, use a staging environment.
That's a copy of production where you test first,
so if someone pushes the wrong config,
you catch it there instead of in front of real users.
Number two, gradual rollouts.
Instead of sending a change to everyone, you send it to 5% of users,
then 20, then 50, and you watch what happens at each step.
CrowdStrike pushed its bad update to
everyone at basically the same time.
And afterwards, they literally said they'd
start rolling updates out in stages,
starting with a small test group.
Number three, fast rollbacks.
So if something does go wrong, one button puts the old version back.
And number four, good monitoring.
Which just means your servers keep sending out logs and numbers,
so you can see a problem before your users tell you about it.
And honestly, this is also how I'd set
up anything Cloud Code ships for you.
Let it build, but make it go through the same gates.
Lesson five, scale out, not up.
When your app gets more traffic,
the first thing you'll want to do is just buy a bigger server.
More memory, more CPU. That's called scaling up.
And it works for a while,
but one machine always hits a ceiling.
So instead, you scale out. You run lots of smaller servers,
and you put a load balancer in front,
which is basically a traffic cop that spreads the
requests across all of them.
And the big win is, if one server dies, the others keep going.
Then you do the same thing for the database.
You add read replicas, which are copies of your
database that only handle reads, so the main one can focus on writes.
When the data gets too big
for one machine, you shard it, which means you split it up,
like users A to M on one database,
and N to Z on another.
And you add a cache for the stuff everyone keeps asking for.
But here's the catch. One computer is simple.
50 computers have to coordinate. What if one is
getting way more traffic than the others?
What if one is up, but kind of broken? That's the real
cost of scaling. So in an interview, think of it as levels.
Level 1 is the basic diagram. Level 2,
you add a load balancer and more servers.
Level 3, you scale the database with replicas and shards,
and then caching and queues on top.
Don't jump to level 3 for an app with 100 users.
Start simple and add each level when the traffic actually asks for it.
Lesson 6.
SQL or NoSQL?
Which is probably the most common question
in any system design interview.
Let's say you're building a profile page.
Anna has a name, a city, and where she works.
In a NoSQL database like DynamoDB or MongoDB,
you can just store all of that as one document,
kind of like a JSON object. You ask for Anna, you get Anna.
Simple, fast, and it scales really well.
But now Anna has a hundred friends,
and you want to show their names on her page.
If you copy each friend's info into Anna's document,
then the moment one friend changes
You've got to go update that name everywhere it was copied.
With a relational database like Postgres,
you store each person once, give them an ID,
and keep a separate table that just says who's friends with who.
Then, a query called a join pulls it all together.
Change a name once, and it's updated everywhere.
So my rule of thumb is just count the joins.
If your data is full of relationships,
or you need things like money
or tickets to always be exactly right, go SQL.
If it's mostly self-contained records
that need to scale, NoSQL is great.
And when you're working with AI,
say this out loud in your prompt, because otherwise,
it's just guessing. Also, really quickly,
before we move on to the next section,
I'm really curious what you think about this one.
When you start a brand new project,
what's your default database?
Postgres every time, or NoSQL until you actually need joins?
Tell me which one and why.
Comment down below, I read every single comment.
Lesson 7. Transactions. Here's the classic example.
Someone's at an ATM and their bank
balance says $1,500. At the same time,
someone else on the same account opens the banking app
on their phone and it also says $1,500.
The person at the ATM takes out $200, so the real balance is
now $1,300. But the person on the phone is still looking at $1,500
and they hit withdraw all of it.
Depending on your database and how it's set up,
that can actually go through,
and now the account is in the negative.
That's a really bad bug, and it's exactly the kind of
bug that only shows up with real users at the same time.
This is what asset is about.
Atomicity means it all happens or none of it happens,
no half a withdrawal.
Consistency means your rules always hold,
like a balance can't go below zero.
Isolation means two transactions running
at the same time don't step on each other.
And durability means once it says saved, it stays saved,
even if the server crashes a second later.
Relational databases are built around this,
and a lot of NoSQL databases have added transactions too,
just know which one you're getting.
And if you're having AI build anything with money,
tickets, or inventory in it,
tell it to wrap those updates in a transaction and then actually test
two of them at the same time,
because that bug won't show up when you're the only one clicking
Lesson 8. Indexes. To get why they matter,
imagine the simplest database ever, just a text file.
Every time you save something, you add a line to the end.
Writing is super fast. But now you want
Jessica's info, and you have no idea where it is,
so you have to read the whole file from the top.
With a million users, that's way too slow.
So, you add an index. It's basically a little lookup
table that says Jessica's data starts right here,
so you jump straight to it instead of reading
And this is exactly what you do in a real database.
If your app keeps looking people up by email,
you add an index on the email column
and that lookup goes from checking every single row to almost instant.
But here's the trade-off, and it's the one interviewers want to hear.
An index takes extra space, and every time you write,
the database has to update the index too.
So indexes make reads faster and writes a little slower.
Don't index everything, index the things you actually search by.
And here's a quick tip.
When a page in your app gets slow,
a missing index is one of the first things to check.
You can literally ask Cloud Code to look at your slowest queries
and tell you which columns need an index.
Lesson 9, and this is where you start
to sound like you really know your stuff.
Under the hood, most databases are built on one of two designs.
The first is called an
LSM tree, which is what Cassandra uses.
New writes go into a sorted list in memory. When that fills
up, it gets written to disk as a sorted file,
and in the background, the database keeps merging
those files together. Because it never edits old files
and just keeps adding new ones, writes are
really fast. The downside is a read might have
to check a few different files to find the newest version
The second is a B-tree, which is what Postgres and SQLite use.
It keeps your data on disk in
fixed-size pages, organized like a tree,
so finding any key is just a short walk from the
top of the tree down to the right page.
When a page gets full, it splits in two. Reads are fast
and predictable, but every write has to go update a page in place.
And both use something called a
write-ahead log. Before changing anything,
the database writes down what it's about to do,
so if the server crashes halfway,
it just replays that log and picks up where it left off.
So the takeaway is pretty simple.
Is your app write heavy like logging tons of events?
Lean LSM. Read heavy like
a store where people browse all day? Lean Btree.
And really quickly, before we wrap up,
I really want to hear from you on this one.
Picture the app you're building right now.
Is it write heavy or read heavy?
And did you pick your database
because of that or just because it was the default?
Be honest. Comment down below. I read every single comment.
Lesson 10. Sometimes the answer
is a totally different kind of database.
If people need to search text, you use something like Elasticsearch.
Instead of storing each
document with its words,
it flips it around and stores each word with a list of documents it
shows up in. So searching for cat
is one lookup instead of reading every document.
If you're tracking things over time,
like CPU usage on your servers or sensor data from cars,
a time series database like InfluxDB is built
for questions like what happened in the last
5 minutes. And for analytics,
like how many customers have more than $500,
a column-based database like Clickhouse stores each column together,
so that question only reads the one column it needs, not every row.
You don't need these on
day one, but when a question keeps getting slow,
this is usually the answer.
And lesson 11, how your services talk to each other.
Quick thing first, should it even be more
than one service? For most new apps, one big app,
a monolith, is the right place to start.
You split a piece out into its own microservice
when it really needs to scale on its own,
or a separate team owns it.
And once you've got more than one, they have to talk.
Whenever one service sends data to another,
say a Python app sending a user profile to a
Java service, it has to turn that data into bytes.
That's called encoding.
Most of the time, that's JSON.
And JSON is great because you can read it. But it has some catches.
It's big. In Kleppmann's example,
the same record takes 81 bytes as JSON,
33 with protocol buffers, and 32 with Avro.
Very large numbers can lose precision
when JavaScript reads them, which is literally
why Twitter started sending its IDs as text.
And JSON can't hold raw binary,
so images have to be converted into text first, which
makes them bigger.
The other thing is versions.
You can never update every server
and every app at the same exact moment.
So for a while, old code
and new code are running side by side, and they both have to
to understand the same messages.
That's backward compatibility,
and formats like protocol buffers and Avro are built with that in
mind. Then, how you send it.
REST over HTTP is the default, and it's perfect for public APIs.
gRPC sends compact binary
and is usually used between your own internal services when speed
matters. And a message queue like Kafka sits
in the middle as a buffer. If the service on the
other end is down or just overloaded,
the messages wait in line until it's ready, instead of getting
That's also why queues are great for slow work,
like sending emails or processing uploads.
Your app drops a message in the queue, answers the user right away,
and a worker picks it up in the background.
So pretty much, that's system design in about 20 minutes.
Every system starts as the same picture,
you plan for things breaking before they do,
and you pick your database by how your app actually reads and writes.
Let me know in the comments which lesson clicked for you,
and which one you want a full deep dive on next.
And if this helped, make sure to subscribe,
I'll see you in the next one.