How to approach System Design? — Transcript
Full transcript
- 0:00so system design is tricky but it does
- 0:01not have to be difficult in this video
- 0:03i'll walk you through on the two
- 0:04approaches that i have been using
- 0:06to build massively scalable systems over
- 0:09last 10 years of my career right we'll
- 0:11start with what is system design then
- 0:12we'll take a look at the two approaches
- 0:14and then i'll share the three key
- 0:15pointers that you should remember while
- 0:17you're designing any system out there
- 0:19but before we move forward i'd want to
- 0:20talk to you about a code based course of
- 0:22system design that i have been running
- 0:23since march 2021 and if you're looking
- 0:26to learn system design from the first
- 0:27principles this course is for you yeah
- 0:30because this is a cohort based course it
- 0:31will not just be me rambling a
- 0:34semi-optimized solution thinking it's
- 0:35the most amazing solution out there
- 0:37instead it will be a collaborative
- 0:39environment where every single person
- 0:40who is part of the cohort
- 0:42will can pitch in his or her ideas and
- 0:45we will evolve our system around that
- 0:47right every single problem statement
- 0:49comes with a brainstorming session where
- 0:51we all together brainstorm and evolve
- 0:53our system that's why everyone
- 0:55understands the kind of trade-offs we
- 0:57made while making that decision instead
- 0:59of just saying hey we'll use a
- 1:00particular queue we'll have the
- 1:02justification why we use only that queue
- 1:04why we use that particular database why
- 1:06sequel why not no sql right how are we
- 1:08leveraging throughput how are we
- 1:10ensuring that our system scales that's
- 1:11the highlight of this course this course
- 1:13is taken by more than 500 engineers to
- 1:16date
- 1:18spanning nine countries and seven
- 1:19cohorts right people from all top
- 1:21companies have taken this course
- 1:23and the outline is very intriguing it's
- 1:26very exciting so we start with week one
- 1:28around we start with the core foundation
- 1:30of the course where we design online
- 1:32offline indicator then we try to design
- 1:33our own medium then we go into database
- 1:36where we go in depth of database logging
- 1:38and take and see few very amazing
- 1:39examples of data log or database logging
- 1:42in in action and how do we ensure that
- 1:45our system scales through that
- 1:48then the third week is all about going
- 1:49distributed where we design our load
- 1:52balancer i'll walk you through the
- 1:53actual code of
- 1:54a toy load balancer and understand how
- 1:56tcp connections are managed and how
- 1:57simple it is to build load balancer then
- 1:59week four is about all about social
- 2:01networks week five is all about building
- 2:03your own storage indians like we'll
- 2:04build that intuition on if you were to
- 2:06ever design your storage agent how would
- 2:08you do that right then week six is about
- 2:10building high throughput system seven is
- 2:12about building
- 2:13uh ir systems basically information
- 2:15retrieval systems and add-on designs
- 2:16where we design our own message brokers
- 2:18like sqs where we design distributed
- 2:20task scheduler and we conclude the
- 2:22course with week 8 where we talk about
- 2:24the super clever algorithms that has
- 2:26powered or that has made those systems
- 2:28possible right i have also attached a
- 2:31video verbatim as is from my first code
- 2:34where we designed and scaled instagram
- 2:35notifications i will highly encourage
- 2:36you to check this video out right and
- 2:39now back to the video
- 2:41so what is system design system design
- 2:43to be put it in a very simple terms it's
- 2:46when your customer has some requirement
- 2:48when hey let's say your customer says i
- 2:50need a live class solution hey i need
- 2:52real time interaction hey i need to
- 2:55upload my data into a particular
- 2:57location right so there is some customer
- 2:59need which is then translated into some
- 3:01product and business requirement then
- 3:03your product manager or your business uh
- 3:05team sends a requirement to the product
- 3:06even product team designs that part and
- 3:08then it comes to you right and that's
- 3:10what translates into that system so
- 3:12everything
- 3:13boils down to the business or the
- 3:15product problem statement and then you
- 3:16have to solve it right a system what
- 3:18exactly system so system is a very
- 3:20generic part but what exactly is that so
- 3:22system could be that what you are
- 3:24supposed to solve could be an
- 3:26application an end to end application
- 3:28having a front end and a back end that
- 3:31user uses day in and day out it could be
- 3:33a micro service it could just be a pure
- 3:36microsoft pure engineering solution
- 3:38where your target customer is some other
- 3:40team it is not your end user but some
- 3:42other team which is sitting right next
- 3:44to you you are building micro service
- 3:45for them it's a pure engineering
- 3:47solution that you are trying to build
- 3:48then it could be just a library that
- 3:51everyone else was struggling with and
- 3:52you thought of building it for example
- 3:54building your own web
- 3:56basically building your own web
- 3:57framework could be just a library that
- 3:59you are building it to make your overall
- 4:02http request response very smooth
- 4:04right or it could be an actual physical
- 4:07hardware that you are shipping where you
- 4:09were given a product requirement and the
- 4:11only thing that you could do is actually
- 4:12ship that hardware that embedded system
- 4:15to your users or to your customers
- 4:18right now when someone says design a
- 4:21system
- 4:22it could be one or all of these three
- 4:25things first a high level architecture
- 4:27diagram
- 4:29where you get to see a macro bird's eye
- 4:31view of that system where your design we
- 4:33are supposed to design a macro bird's
- 4:35eye view of that system where hey these
- 4:36would be the micro services that talk to
- 4:38each other and then you are and then and
- 4:41then this is how the interaction would
- 4:42happen this how this basically this is
- 4:44how the persistence would happen and all
- 4:45on a high level architecture side right
- 4:49then it could also be a logical design
- 4:52in which they ask you to
- 4:55do like you are required to do business
- 4:57logic algorithms core data structures
- 5:00right core storage techniques that you
- 5:02would be using core persistent
- 5:04algorithms that you would be using that
- 5:06part so
- 5:07it's basically not just the high level
- 5:09but you are scratching the surface and
- 5:10going a level deep into identifying hey
- 5:13what exactly would i use over here and
- 5:15then the third design or or basically
- 5:17then the third aspect could be a
- 5:18physical design where you are supposed
- 5:20to design the storage part of it the
- 5:22actual i o the actual hardware which
- 5:24instance type which gpu which processor
- 5:27that you are using what would be the
- 5:28overall capacity of it how would the
- 5:30backup and restore would happen how
- 5:32would you structure the data pipelines
- 5:34and all right so these are the three
- 5:36things like now depending on what you
- 5:38are discussing or what you are designing
- 5:40where you are designing what is the
- 5:42state there you would be required to
- 5:44design one or all three
- 5:46be it your work your then you are
- 5:48definitely supposed to design all three
- 5:50if you are in the interview then i would
- 5:51highly encourage you to limit the scope
- 5:53of your discussion and pick one and then
- 5:55solve it really nicely right now talking
- 5:57about how to approach system design the
- 6:00two approaches that i've used in my
- 6:02career the first one is what i call a
- 6:04spiral approach the spiral approach is
- 6:06where you decide the core of your system
- 6:09design and then you start building
- 6:10around it it so then your system evolves
- 6:13as a spiral
- 6:15right now for example you start with
- 6:17storage hey that you decided hey i want
- 6:18to use this particular database and then
- 6:20you move to the next part you have now
- 6:22that i have database i want i'd want a
- 6:24bunch of api servers to to basically
- 6:26support it right and then
- 6:28you evolve to the next part where hey
- 6:30you said now i have this service now i
- 6:32need another service right for example
- 6:34this is the first step that you started
- 6:35with a simple database then you added a
- 6:38a a very simple way to interact with
- 6:40that this forms the core of your then
- 6:42you evolve they do say that hey i need a
- 6:44couple of services to interact with each
- 6:46service having its own database let's
- 6:48say payment and a payment gateway the
- 6:49next part is you have a payment and
- 6:51payment gateway then you need a retry
- 6:52mechanism to retry the fail payments and
- 6:54all right so this is how you would
- 6:57evolve your system now when would you
- 6:59use a spiral based evolution where you
- 7:01are pretty confident on the decisions
- 7:03you are making that's a key thing when
- 7:06you are experienced enough or when you
- 7:07know the problem statement is simple
- 7:08enough that that the decision that you
- 7:10are making is very crisp is very optimal
- 7:13and this is exactly how it should be
- 7:15done you are very confident on that
- 7:16spiral way of designing systems works
- 7:19the best right these systems are pretty
- 7:21predictable on how they should be
- 7:22designed and you are just evolving them
- 7:25very quickly
- 7:27the second approach is an incremental
- 7:28mvp approach where you see a bunch where
- 7:31you start small and then you add more
- 7:33and more features to it just to handle
- 7:35larger larger larger scale of it right
- 7:37these is how i represented this is
- 7:39through non-concentric circles because
- 7:42you know
- 7:43you started here then you added then you
- 7:45added some part to add more skills but
- 7:47then you added some more and then this
- 7:49oval which is which is very obscured in
- 7:51its stay in its shape
- 7:54because you thought your system is
- 7:56evolving in a certain direction but
- 7:57because of change because of scale it
- 7:59evolved into some other so it's the way
- 8:01i represented its non-concentric
- 8:04circles and ovals or non-concentric
- 8:06ellipses
- 8:08right so here the idea is you start with
- 8:11a very simple extremely basic day zero
- 8:14architecture
- 8:16extremely simple and then you think hey
- 8:19now
- 8:20this is my desire architecture let's say
- 8:23i got more users now what for example
- 8:26you started with a single user a single
- 8:28api server and a single database now you
- 8:30hit the next skill what's the next skill
- 8:31you got multiple users so if you got
- 8:33multiple users one api server might not
- 8:35be able to handle it so you add a load
- 8:36balancer right then what you do then
- 8:38what you do you think about the next
- 8:40step hey this system was working fine
- 8:42but now when i got even more users my
- 8:44system started to choke up so then what
- 8:46you do is you added a read replica to
- 8:48your database to handle the load then
- 8:50you thought hey some workers or some
- 8:51things are happening synchronously which
- 8:53could very well happen asynchronously so
- 8:54you add a you then you add an
- 8:56asynchronous uh uh so basically then you
- 8:59add a message broker to it to introduce
- 9:01an asynchronous workflow into a system
- 9:03design so
- 9:04tackling one scale or one level at a
- 9:07time is how you go for an incremental
- 9:09mvp approach where incrementally you are
- 9:12trying to evolve your system to just be
- 9:14able to sustain the next scale right and
- 9:18this is how these are two
- 9:20very similar yet yet different
- 9:23approaches of system design that i would
- 9:25highly encourage you to pick your
- 9:27problem with like
- 9:28basically given a solution pick one over
- 9:30other in which you are very confident
- 9:32hey i know the like for example if you
- 9:34know the the solution very well go for a
- 9:36spiral based approach if you don't know
- 9:38the solution variable start with the day
- 9:390 architecture and then scale individual
- 9:41component out right and then break it
- 9:43into other services and all right
- 9:46so key pointers to think about when you
- 9:49are approaching a system design is first
- 9:50of all every single system out there is
- 9:53infinitely buildable this is something
- 9:54that you need to understand you can add
- 9:56as many features as you want into this
- 9:59but depending on the time you have for
- 10:01you to deliver your project or for you
- 10:02to crack that interview in either case
- 10:05it's very important to fence your
- 10:07particular system
- 10:09you have to restrict the scope
- 10:11right that in the stipulated time of
- 10:14let's say while you are at work
- 10:16you know that this is what like you have
- 10:19two weeks to actually implement it you
- 10:21cannot spend more than two weeks to ship
- 10:23this particular thing out so you would
- 10:25be restricting the scope of your design
- 10:28according to that and hey this is only
- 10:30i'd be committing to ship and this is
- 10:32something that you are predicting that
- 10:33you will be very easily be able to ship
- 10:35it right so restricting the scope is
- 10:37very important and even same thing
- 10:38during your interview is a technical
- 10:39discussion hey restrain the scope so
- 10:42that you design that one thing really
- 10:44well right second key pointer is see
- 10:46clarifications from your seniors or your
- 10:48interviewer right because every single
- 10:50system design problem is actually
- 10:52ambiguous no one has an idea on how that
- 10:54system is going to evolve so so seek
- 10:56those clarifications on hey is this the
- 10:58only requirement would this requirement
- 11:00change what would happen if this if if a
- 11:04breaks like seek seek those
- 11:05clarifications on are we okay to take a
- 11:08down time of five minutes are we okay to
- 11:10do x y z like depending on the system at
- 11:13hand seek those clarifications it would
- 11:15help you design a very optimal system
- 11:18third and the most important key pointer
- 11:20is ask those critical questions
- 11:22ask us critical questions that challenge
- 11:25design decisions for example protocol a
- 11:27versus protocol b
- 11:29why why are we using http why can't we
- 11:31go for grpc as those critical decisions
- 11:34ask those critical questions that
- 11:36actually challenges your design decision
- 11:37hey
- 11:38i think we should not be using web
- 11:40sockets over here then suddenly your
- 11:42entire architecture changes like why do
- 11:45why does this need to be real time can
- 11:46this not be your synchronous then
- 11:48suddenly your entire design would change
- 11:50so ask those critical questions because
- 11:52asking them would make your senior or
- 11:55your interviewer be very impressed on
- 11:57that you are putting in a lot of thought
- 11:59you are not taking problem statement as
- 12:01is but instead you are you are valuing
- 12:03the problem statement you are thinking
- 12:05the problem statement of your own and
- 12:07then devising the best possible solution
- 12:09out there because independent thinkers
- 12:11are the most critical assets that every
- 12:13single org is looking for and every
- 12:15single org is proud to retain right so
- 12:18one thing in general that you would
- 12:20always see working out for any problem
- 12:22in general and especially in the world
- 12:23of system design is divide and conquer
- 12:26so even when you think about either
- 12:28spiral based approach or
- 12:31an incremental mvp approach we always
- 12:33broke that problem into small component
- 12:35we solved that one thing so in spiral
- 12:36approach we saw that code and then we
- 12:38built a new service and then we added a
- 12:39users and then we added the next one in
- 12:41incremental based approach what we did
- 12:43is we took a day zero solution and then
- 12:45we we basically operated at a very small
- 12:47level and then we increased the scale to
- 12:49handle it to the next level and then the
- 12:51next level and the next level
- 12:53so
- 12:54this is very important whenever you are
- 12:57approaching any system design try to
- 12:58break it into manageable sub problems
- 13:00and solve each of those problem very
- 13:03optimally and once you do once you do
- 13:05that when all of the sub problems come
- 13:07and or rather one of all of your
- 13:09subsystems come together this solves the
- 13:11entire problem optimally right so divide
- 13:14and conquer is a strategy that works
- 13:15amazingly well in system reason and i
- 13:17would and i would highly encourage you
- 13:19to look for it
- 13:21right
- 13:22okay yeah so that's it for this video
- 13:24this is a very short one but i hope uh
- 13:27you
- 13:27if in case you are confused about how to
- 13:30approach because that's what the most
- 13:32overwhelming part is so i've given you
- 13:34two approaches to go for it this is
- 13:35something that i personally used
- 13:37throughout my career
- 13:38and and even today when someone gives me
- 13:41a system to design this is exactly how i
- 13:43approach right so yeah that's it for
- 13:45this one uh if you guys like this video
- 13:48give this video a thumbs up if you guys
- 13:49like the channel give this channel a sub
- 13:51and i'll see in the next one thanks a
- 13:53time
About this transcript
This page contains the full transcript of How to approach System Design? by Arpit Bhayani, generated from the public captions YouTube serves with the video. The transcript has 2,808 words across 416 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.