YouTube2Text

How to approach System Design? — Transcript

by Arpit Bhayani · 2,808 words · 416 segments · language en · Watch on YouTube

Full transcript

  1. 0:00so system design is tricky but it does
  2. 0:01not have to be difficult in this video
  3. 0:03i'll walk you through on the two
  4. 0:04approaches that i have been using
  5. 0:06to build massively scalable systems over
  6. 0:09last 10 years of my career right we'll
  7. 0:11start with what is system design then
  8. 0:12we'll take a look at the two approaches
  9. 0:14and then i'll share the three key
  10. 0:15pointers that you should remember while
  11. 0:17you're designing any system out there
  12. 0:19but before we move forward i'd want to
  13. 0:20talk to you about a code based course of
  14. 0:22system design that i have been running
  15. 0:23since march 2021 and if you're looking
  16. 0:26to learn system design from the first
  17. 0:27principles this course is for you yeah
  18. 0:30because this is a cohort based course it
  19. 0:31will not just be me rambling a
  20. 0:34semi-optimized solution thinking it's
  21. 0:35the most amazing solution out there
  22. 0:37instead it will be a collaborative
  23. 0:39environment where every single person
  24. 0:40who is part of the cohort
  25. 0:42will can pitch in his or her ideas and
  26. 0:45we will evolve our system around that
  27. 0:47right every single problem statement
  28. 0:49comes with a brainstorming session where
  29. 0:51we all together brainstorm and evolve
  30. 0:53our system that's why everyone
  31. 0:55understands the kind of trade-offs we
  32. 0:57made while making that decision instead
  33. 0:59of just saying hey we'll use a
  34. 1:00particular queue we'll have the
  35. 1:02justification why we use only that queue
  36. 1:04why we use that particular database why
  37. 1:06sequel why not no sql right how are we
  38. 1:08leveraging throughput how are we
  39. 1:10ensuring that our system scales that's
  40. 1:11the highlight of this course this course
  41. 1:13is taken by more than 500 engineers to
  42. 1:16date
  43. 1:18spanning nine countries and seven
  44. 1:19cohorts right people from all top
  45. 1:21companies have taken this course
  46. 1:23and the outline is very intriguing it's
  47. 1:26very exciting so we start with week one
  48. 1:28around we start with the core foundation
  49. 1:30of the course where we design online
  50. 1:32offline indicator then we try to design
  51. 1:33our own medium then we go into database
  52. 1:36where we go in depth of database logging
  53. 1:38and take and see few very amazing
  54. 1:39examples of data log or database logging
  55. 1:42in in action and how do we ensure that
  56. 1:45our system scales through that
  57. 1:48then the third week is all about going
  58. 1:49distributed where we design our load
  59. 1:52balancer i'll walk you through the
  60. 1:53actual code of
  61. 1:54a toy load balancer and understand how
  62. 1:56tcp connections are managed and how
  63. 1:57simple it is to build load balancer then
  64. 1:59week four is about all about social
  65. 2:01networks week five is all about building
  66. 2:03your own storage indians like we'll
  67. 2:04build that intuition on if you were to
  68. 2:06ever design your storage agent how would
  69. 2:08you do that right then week six is about
  70. 2:10building high throughput system seven is
  71. 2:12about building
  72. 2:13uh ir systems basically information
  73. 2:15retrieval systems and add-on designs
  74. 2:16where we design our own message brokers
  75. 2:18like sqs where we design distributed
  76. 2:20task scheduler and we conclude the
  77. 2:22course with week 8 where we talk about
  78. 2:24the super clever algorithms that has
  79. 2:26powered or that has made those systems
  80. 2:28possible right i have also attached a
  81. 2:31video verbatim as is from my first code
  82. 2:34where we designed and scaled instagram
  83. 2:35notifications i will highly encourage
  84. 2:36you to check this video out right and
  85. 2:39now back to the video
  86. 2:41so what is system design system design
  87. 2:43to be put it in a very simple terms it's
  88. 2:46when your customer has some requirement
  89. 2:48when hey let's say your customer says i
  90. 2:50need a live class solution hey i need
  91. 2:52real time interaction hey i need to
  92. 2:55upload my data into a particular
  93. 2:57location right so there is some customer
  94. 2:59need which is then translated into some
  95. 3:01product and business requirement then
  96. 3:03your product manager or your business uh
  97. 3:05team sends a requirement to the product
  98. 3:06even product team designs that part and
  99. 3:08then it comes to you right and that's
  100. 3:10what translates into that system so
  101. 3:12everything
  102. 3:13boils down to the business or the
  103. 3:15product problem statement and then you
  104. 3:16have to solve it right a system what
  105. 3:18exactly system so system is a very
  106. 3:20generic part but what exactly is that so
  107. 3:22system could be that what you are
  108. 3:24supposed to solve could be an
  109. 3:26application an end to end application
  110. 3:28having a front end and a back end that
  111. 3:31user uses day in and day out it could be
  112. 3:33a micro service it could just be a pure
  113. 3:36microsoft pure engineering solution
  114. 3:38where your target customer is some other
  115. 3:40team it is not your end user but some
  116. 3:42other team which is sitting right next
  117. 3:44to you you are building micro service
  118. 3:45for them it's a pure engineering
  119. 3:47solution that you are trying to build
  120. 3:48then it could be just a library that
  121. 3:51everyone else was struggling with and
  122. 3:52you thought of building it for example
  123. 3:54building your own web
  124. 3:56basically building your own web
  125. 3:57framework could be just a library that
  126. 3:59you are building it to make your overall
  127. 4:02http request response very smooth
  128. 4:04right or it could be an actual physical
  129. 4:07hardware that you are shipping where you
  130. 4:09were given a product requirement and the
  131. 4:11only thing that you could do is actually
  132. 4:12ship that hardware that embedded system
  133. 4:15to your users or to your customers
  134. 4:18right now when someone says design a
  135. 4:21system
  136. 4:22it could be one or all of these three
  137. 4:25things first a high level architecture
  138. 4:27diagram
  139. 4:29where you get to see a macro bird's eye
  140. 4:31view of that system where your design we
  141. 4:33are supposed to design a macro bird's
  142. 4:35eye view of that system where hey these
  143. 4:36would be the micro services that talk to
  144. 4:38each other and then you are and then and
  145. 4:41then this is how the interaction would
  146. 4:42happen this how this basically this is
  147. 4:44how the persistence would happen and all
  148. 4:45on a high level architecture side right
  149. 4:49then it could also be a logical design
  150. 4:52in which they ask you to
  151. 4:55do like you are required to do business
  152. 4:57logic algorithms core data structures
  153. 5:00right core storage techniques that you
  154. 5:02would be using core persistent
  155. 5:04algorithms that you would be using that
  156. 5:06part so
  157. 5:07it's basically not just the high level
  158. 5:09but you are scratching the surface and
  159. 5:10going a level deep into identifying hey
  160. 5:13what exactly would i use over here and
  161. 5:15then the third design or or basically
  162. 5:17then the third aspect could be a
  163. 5:18physical design where you are supposed
  164. 5:20to design the storage part of it the
  165. 5:22actual i o the actual hardware which
  166. 5:24instance type which gpu which processor
  167. 5:27that you are using what would be the
  168. 5:28overall capacity of it how would the
  169. 5:30backup and restore would happen how
  170. 5:32would you structure the data pipelines
  171. 5:34and all right so these are the three
  172. 5:36things like now depending on what you
  173. 5:38are discussing or what you are designing
  174. 5:40where you are designing what is the
  175. 5:42state there you would be required to
  176. 5:44design one or all three
  177. 5:46be it your work your then you are
  178. 5:48definitely supposed to design all three
  179. 5:50if you are in the interview then i would
  180. 5:51highly encourage you to limit the scope
  181. 5:53of your discussion and pick one and then
  182. 5:55solve it really nicely right now talking
  183. 5:57about how to approach system design the
  184. 6:00two approaches that i've used in my
  185. 6:02career the first one is what i call a
  186. 6:04spiral approach the spiral approach is
  187. 6:06where you decide the core of your system
  188. 6:09design and then you start building
  189. 6:10around it it so then your system evolves
  190. 6:13as a spiral
  191. 6:15right now for example you start with
  192. 6:17storage hey that you decided hey i want
  193. 6:18to use this particular database and then
  194. 6:20you move to the next part you have now
  195. 6:22that i have database i want i'd want a
  196. 6:24bunch of api servers to to basically
  197. 6:26support it right and then
  198. 6:28you evolve to the next part where hey
  199. 6:30you said now i have this service now i
  200. 6:32need another service right for example
  201. 6:34this is the first step that you started
  202. 6:35with a simple database then you added a
  203. 6:38a a very simple way to interact with
  204. 6:40that this forms the core of your then
  205. 6:42you evolve they do say that hey i need a
  206. 6:44couple of services to interact with each
  207. 6:46service having its own database let's
  208. 6:48say payment and a payment gateway the
  209. 6:49next part is you have a payment and
  210. 6:51payment gateway then you need a retry
  211. 6:52mechanism to retry the fail payments and
  212. 6:54all right so this is how you would
  213. 6:57evolve your system now when would you
  214. 6:59use a spiral based evolution where you
  215. 7:01are pretty confident on the decisions
  216. 7:03you are making that's a key thing when
  217. 7:06you are experienced enough or when you
  218. 7:07know the problem statement is simple
  219. 7:08enough that that the decision that you
  220. 7:10are making is very crisp is very optimal
  221. 7:13and this is exactly how it should be
  222. 7:15done you are very confident on that
  223. 7:16spiral way of designing systems works
  224. 7:19the best right these systems are pretty
  225. 7:21predictable on how they should be
  226. 7:22designed and you are just evolving them
  227. 7:25very quickly
  228. 7:27the second approach is an incremental
  229. 7:28mvp approach where you see a bunch where
  230. 7:31you start small and then you add more
  231. 7:33and more features to it just to handle
  232. 7:35larger larger larger scale of it right
  233. 7:37these is how i represented this is
  234. 7:39through non-concentric circles because
  235. 7:42you know
  236. 7:43you started here then you added then you
  237. 7:45added some part to add more skills but
  238. 7:47then you added some more and then this
  239. 7:49oval which is which is very obscured in
  240. 7:51its stay in its shape
  241. 7:54because you thought your system is
  242. 7:56evolving in a certain direction but
  243. 7:57because of change because of scale it
  244. 7:59evolved into some other so it's the way
  245. 8:01i represented its non-concentric
  246. 8:04circles and ovals or non-concentric
  247. 8:06ellipses
  248. 8:08right so here the idea is you start with
  249. 8:11a very simple extremely basic day zero
  250. 8:14architecture
  251. 8:16extremely simple and then you think hey
  252. 8:19now
  253. 8:20this is my desire architecture let's say
  254. 8:23i got more users now what for example
  255. 8:26you started with a single user a single
  256. 8:28api server and a single database now you
  257. 8:30hit the next skill what's the next skill
  258. 8:31you got multiple users so if you got
  259. 8:33multiple users one api server might not
  260. 8:35be able to handle it so you add a load
  261. 8:36balancer right then what you do then
  262. 8:38what you do you think about the next
  263. 8:40step hey this system was working fine
  264. 8:42but now when i got even more users my
  265. 8:44system started to choke up so then what
  266. 8:46you do is you added a read replica to
  267. 8:48your database to handle the load then
  268. 8:50you thought hey some workers or some
  269. 8:51things are happening synchronously which
  270. 8:53could very well happen asynchronously so
  271. 8:54you add a you then you add an
  272. 8:56asynchronous uh uh so basically then you
  273. 8:59add a message broker to it to introduce
  274. 9:01an asynchronous workflow into a system
  275. 9:03design so
  276. 9:04tackling one scale or one level at a
  277. 9:07time is how you go for an incremental
  278. 9:09mvp approach where incrementally you are
  279. 9:12trying to evolve your system to just be
  280. 9:14able to sustain the next scale right and
  281. 9:18this is how these are two
  282. 9:20very similar yet yet different
  283. 9:23approaches of system design that i would
  284. 9:25highly encourage you to pick your
  285. 9:27problem with like
  286. 9:28basically given a solution pick one over
  287. 9:30other in which you are very confident
  288. 9:32hey i know the like for example if you
  289. 9:34know the the solution very well go for a
  290. 9:36spiral based approach if you don't know
  291. 9:38the solution variable start with the day
  292. 9:390 architecture and then scale individual
  293. 9:41component out right and then break it
  294. 9:43into other services and all right
  295. 9:46so key pointers to think about when you
  296. 9:49are approaching a system design is first
  297. 9:50of all every single system out there is
  298. 9:53infinitely buildable this is something
  299. 9:54that you need to understand you can add
  300. 9:56as many features as you want into this
  301. 9:59but depending on the time you have for
  302. 10:01you to deliver your project or for you
  303. 10:02to crack that interview in either case
  304. 10:05it's very important to fence your
  305. 10:07particular system
  306. 10:09you have to restrict the scope
  307. 10:11right that in the stipulated time of
  308. 10:14let's say while you are at work
  309. 10:16you know that this is what like you have
  310. 10:19two weeks to actually implement it you
  311. 10:21cannot spend more than two weeks to ship
  312. 10:23this particular thing out so you would
  313. 10:25be restricting the scope of your design
  314. 10:28according to that and hey this is only
  315. 10:30i'd be committing to ship and this is
  316. 10:32something that you are predicting that
  317. 10:33you will be very easily be able to ship
  318. 10:35it right so restricting the scope is
  319. 10:37very important and even same thing
  320. 10:38during your interview is a technical
  321. 10:39discussion hey restrain the scope so
  322. 10:42that you design that one thing really
  323. 10:44well right second key pointer is see
  324. 10:46clarifications from your seniors or your
  325. 10:48interviewer right because every single
  326. 10:50system design problem is actually
  327. 10:52ambiguous no one has an idea on how that
  328. 10:54system is going to evolve so so seek
  329. 10:56those clarifications on hey is this the
  330. 10:58only requirement would this requirement
  331. 11:00change what would happen if this if if a
  332. 11:04breaks like seek seek those
  333. 11:05clarifications on are we okay to take a
  334. 11:08down time of five minutes are we okay to
  335. 11:10do x y z like depending on the system at
  336. 11:13hand seek those clarifications it would
  337. 11:15help you design a very optimal system
  338. 11:18third and the most important key pointer
  339. 11:20is ask those critical questions
  340. 11:22ask us critical questions that challenge
  341. 11:25design decisions for example protocol a
  342. 11:27versus protocol b
  343. 11:29why why are we using http why can't we
  344. 11:31go for grpc as those critical decisions
  345. 11:34ask those critical questions that
  346. 11:36actually challenges your design decision
  347. 11:37hey
  348. 11:38i think we should not be using web
  349. 11:40sockets over here then suddenly your
  350. 11:42entire architecture changes like why do
  351. 11:45why does this need to be real time can
  352. 11:46this not be your synchronous then
  353. 11:48suddenly your entire design would change
  354. 11:50so ask those critical questions because
  355. 11:52asking them would make your senior or
  356. 11:55your interviewer be very impressed on
  357. 11:57that you are putting in a lot of thought
  358. 11:59you are not taking problem statement as
  359. 12:01is but instead you are you are valuing
  360. 12:03the problem statement you are thinking
  361. 12:05the problem statement of your own and
  362. 12:07then devising the best possible solution
  363. 12:09out there because independent thinkers
  364. 12:11are the most critical assets that every
  365. 12:13single org is looking for and every
  366. 12:15single org is proud to retain right so
  367. 12:18one thing in general that you would
  368. 12:20always see working out for any problem
  369. 12:22in general and especially in the world
  370. 12:23of system design is divide and conquer
  371. 12:26so even when you think about either
  372. 12:28spiral based approach or
  373. 12:31an incremental mvp approach we always
  374. 12:33broke that problem into small component
  375. 12:35we solved that one thing so in spiral
  376. 12:36approach we saw that code and then we
  377. 12:38built a new service and then we added a
  378. 12:39users and then we added the next one in
  379. 12:41incremental based approach what we did
  380. 12:43is we took a day zero solution and then
  381. 12:45we we basically operated at a very small
  382. 12:47level and then we increased the scale to
  383. 12:49handle it to the next level and then the
  384. 12:51next level and the next level
  385. 12:53so
  386. 12:54this is very important whenever you are
  387. 12:57approaching any system design try to
  388. 12:58break it into manageable sub problems
  389. 13:00and solve each of those problem very
  390. 13:03optimally and once you do once you do
  391. 13:05that when all of the sub problems come
  392. 13:07and or rather one of all of your
  393. 13:09subsystems come together this solves the
  394. 13:11entire problem optimally right so divide
  395. 13:14and conquer is a strategy that works
  396. 13:15amazingly well in system reason and i
  397. 13:17would and i would highly encourage you
  398. 13:19to look for it
  399. 13:21right
  400. 13:22okay yeah so that's it for this video
  401. 13:24this is a very short one but i hope uh
  402. 13:27you
  403. 13:27if in case you are confused about how to
  404. 13:30approach because that's what the most
  405. 13:32overwhelming part is so i've given you
  406. 13:34two approaches to go for it this is
  407. 13:35something that i personally used
  408. 13:37throughout my career
  409. 13:38and and even today when someone gives me
  410. 13:41a system to design this is exactly how i
  411. 13:43approach right so yeah that's it for
  412. 13:45this one uh if you guys like this video
  413. 13:48give this video a thumbs up if you guys
  414. 13:49like the channel give this channel a sub
  415. 13:51and i'll see in the next one thanks a
  416. 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.