How a CDN Works | System Design
5:14
Пікірлер
@prakharsrivastava6644
@prakharsrivastava6644 Күн бұрын
I love the cute computer in the background
@muhammedashkar692
@muhammedashkar692 Күн бұрын
no complaints other than the font used in the canvas.
@willmalisch
@willmalisch 4 күн бұрын
I think more detail could have been given on why you used Kafka. I understand how it makes sense, but maybe walking through a couple data flows would have made it more clear.
@RAMII19780529
@RAMII19780529 5 күн бұрын
I'm not trying to be difficult, but I don't understand how using a bearer token or jwt is any different / better than having the user send their username and password with each request. If the bad actor has a way to see the request, they could just copy and use the token, just the same as they could copy the username and password, which needs to be sent to create a token to being with. I think this is why using HTTPS is so important.
@quachhengtony7651
@quachhengtony7651 5 күн бұрын
Can you name some of these traditional message queues?
@MashaoleMogale
@MashaoleMogale 5 күн бұрын
during the process of notifying the driver to either accept or deny why not send to lets say 5-10 drivers closest to rider and the first to accept gets it and all the responses sent to a queue and if theres a driver for the driver the rest get rejected for that trip , this would improve user experience as users would spend less time searching for a driver instead of waiting for 1 drivers response then switching to the next which can take up some time
@wolfgangleon8362
@wolfgangleon8362 7 күн бұрын
This is a great video for large distributed systems.
@Lifestudent-
@Lifestudent- 14 күн бұрын
Wow👏👏👏👏👏👏👏👏 nailed it 💯👌
@fireball787b
@fireball787b 14 күн бұрын
imho, the downside of the timeseries db is that you will repeat calculations every time you want to know the total downloads or the top ones. In that case, I would have stored the data in the database on a field that counts the total downloads and then search from there. The issue in this case is that you will probably have deadlocks or concurrency problems because of the reads and writes, mostly on the top used apps. in this case, the db should be sharded so reads occur in one db shard and writes on the other ones. then automatically the db will update the data from one shard with the other ones. Aside from that, great design and i think the combination of db and elastic is a great choice
@TheMdaliazhar
@TheMdaliazhar 15 күн бұрын
Explanation is good but Its not comprehensive. One can't quality a system design interview based on above video for the given topic.
@tanthole0306
@tanthole0306 16 күн бұрын
Doesn't this design make Kafka the bottleneck for the whole architecture?
@latuconsinafr
@latuconsinafr 20 күн бұрын
What kind of terminal do you use?
@interviewpen
@interviewpen 18 күн бұрын
That's Warp! www.warp.dev/
@shreyaspatange8653
@shreyaspatange8653 22 күн бұрын
annnnnnnnnnnnd you infra cost will be 50k and need engineers worth 200k for maintainance
@nirmalgurjar8181
@nirmalgurjar8181 23 күн бұрын
This guy is talking like Sidhi baat no Bakwas.
@babayaga5620
@babayaga5620 26 күн бұрын
Oh put their data center in the damn Ohio lmao, fire content btw
@interviewpen
@interviewpen 25 күн бұрын
Ohio has cheap electricity and cheap real estate :D Thanks for watching!
@user-ti8cm3mh1w
@user-ti8cm3mh1w 26 күн бұрын
Very impressive
@interviewpen
@interviewpen 26 күн бұрын
Thanks!
@AndyThomasStaff
@AndyThomasStaff 27 күн бұрын
This seems like a video designed to make people fail system interviews. "Kafka," "load balancer," "websockets" are generic system design concepts you are randomly tacking on.
@interviewpen
@interviewpen 27 күн бұрын
Well, we always try to go over the reasoning for adding complexity-of course smaller systems can be far simpler. But there’s of course much more to it than we can discuss in a 15m video. Thanks for watching!
@LuisVarela-d8m
@LuisVarela-d8m 27 күн бұрын
A
@EntertainerOnline
@EntertainerOnline 29 күн бұрын
I'm not sure if I understood correctly but why are we not using any ES cluster to speed up our search? No DB can be as efficient as ES when it comes to search.
@interviewpen
@interviewpen 29 күн бұрын
ElasticSearch is essentially a sharded db with full text search at its core, so a properly architected database will do the same thing. But you’re absolutely right-es is certainly a viable solution if we want a pre-built solution.
@jephthahsnr6558
@jephthahsnr6558 Ай бұрын
🔥🔥
@interviewpen
@interviewpen Ай бұрын
Thanks for watching :)
@dirty-kebab
@dirty-kebab Ай бұрын
I feel like this is useless because you just tell us the answer, how and why.
@interviewpen
@interviewpen Ай бұрын
Ok, sorry to hear that. We do our best to build the system from the ground up, starting from a simple system, understanding why it doesn't scale and how to improve on it. We'll try to do better in the future--if you have any more specific feedback, please let me know.
@Rhly001
@Rhly001 Ай бұрын
@@interviewpen It's not useless at all while I do agree breaking down the problems further and putting more thought into it rather than jumping directly to the solution would help the users learn more and think for themselves but this content is still really valuable, and I can't thank enough for your efforts. Keep putting out more such videos. I really enjoy watching them and maybe leave some questions or projects unanswered too for the users to figure out.
@Get_YT_Views_940
@Get_YT_Views_940 Ай бұрын
Remember that you have the power to control your thoughts and emotions. Choose positive thoughts, practice mindfulness, and let go of negativity that doesn't serve you.
@abdullahsharif4291
@abdullahsharif4291 Ай бұрын
What is the name of the pen softwere used for explaining on the screen?
@interviewpen
@interviewpen Ай бұрын
We use GoodNotes on an iPad. Thanks for watching!
@vinayak6564
@vinayak6564 Ай бұрын
I feel it doesn't make sense to put chunks in queue, direct client having access to a messaging-queue-system is not practically good idea from security perspective. Also it doesn't reduce load anyhow as messaging queues also need to be scaled if not injestion servers, so it is just adding extra layer just for the sake of adding. Correct me if I am wrong.
@vinayak6564
@vinayak6564 Ай бұрын
Only messaging queue for notification service makes sense.
@interviewpen
@interviewpen Ай бұрын
The idea behind this was that if there are bursts of load, it wouldn't slow down users uploading their data. But I fully agree with you that it doesn't make sense for a client to have direct access, so it's not a very useful solution in this case. A better solution might be to use a tiered storage system behind our BLOB store which can provide very fast reads and writes for frequently accessed data while moving older data to cheaper storage mediums. Thanks for watching!
@vinayak6564
@vinayak6564 Ай бұрын
@@interviewpen Thanks for the prompt response and answer! Great content btw finished watching blob storage system design after this.
@vietnguyenquoc4948
@vietnguyenquoc4948 Ай бұрын
Can you do a design for versions control system?
@interviewpen
@interviewpen Ай бұрын
I'll add it to the backlog :)
@cool_guy_Vaibhav
@cool_guy_Vaibhav Ай бұрын
Good explanation
@interviewpen
@interviewpen Ай бұрын
Thanks!
@CristianAbrante
@CristianAbrante Ай бұрын
Hello! Which app do you use in your iPad to draw diagrams and explain the concepts? Great video! 👏
@interviewpen
@interviewpen Ай бұрын
Thanks! We use GoodNotes.
@abhibhagat7767
@abhibhagat7767 Ай бұрын
Why not enable RAID and set the correct level?
@shabarinathk8954
@shabarinathk8954 Ай бұрын
my thought exactly. but people these days need to complicate everything
@ralphard
@ralphard Ай бұрын
Assume you have to store across multiple computers, RAID doesn’t save you from the host attached to the RAID card dying
@interviewpen
@interviewpen Ай бұрын
When we're dealing with a single node, RAID is of course a great way to implement the concepts we discussed. When dealing with more than one node, we have to do replication over a network, which requires software solutions. Thanks for watching!
@Zmey5656
@Zmey5656 Ай бұрын
You always need to think about replicas
@ehza
@ehza Ай бұрын
nice
@interviewpen
@interviewpen Ай бұрын
Thanks!
@tidenly
@tidenly Ай бұрын
Its nice you showed both options using JWTs and simple session IDs. I see lots of people jump straight for JWTs because its newer, without thinking about the actual pros and cons. Generally the first question should be *can* your system actually do stateless authentication? For many financial services for example, a business requirement will be instant reflection of updates to permissions or session revocations - to implement this in JWTs you need to constantly check a blacklisted token table - immediately nullifying the benefit of stateless auth. There's also the question for many apps - realistically how many types of action can the user make anyway that won't be hitting the database / reddis at some point already? Considering the complexity that can come with JWTs, for simple apps I often find myself reaching for session IDs first, with certain components using stateless. I've yet to work in a company where even a few minute lag between permission updates is acceptable on the app itself. There's also some hybrid patterns, the satellite app authenticates with an internal auth server, recieving a JWT. That JWT is then hashed into reddis as a session token, and sent to the user for user <-> api auth. It's important people actually ask these questions to the interviewer before picking their solution!
@PalataoArmy
@PalataoArmy Ай бұрын
Sir, this is golden. Thank you!
@interviewpen
@interviewpen Ай бұрын
Thanks for watching!
@DavidDLee
@DavidDLee Ай бұрын
Here are some of the issues in this design. 1. The cache and timeline construction are the most difficult to solve, yet we know too little on how it is arranged 1.1. Sure, if you have only 2 users, it will scale well. But, what if you have 180M followers to Musk? Will you fan-out 180M cache and database updates for a single tweet? 1.2. It completely ignores geography. What if the DB shard for Elon is in Texas and his followers are spread across the world? 1.2.1 Where do you store data for a user from a specific country? What if they travel? 2. Social graph. 2.1. It sounds like on every tweet write, you query the social graph to figure out where to fan out. How does this work to scale? How many shards do you need to read to know even where to fan out too? 2.2. What if a user unfollows? 2.3. Where is the graph stored. The design presented will not scale well to the millions and billions of users.
@interviewpen
@interviewpen Ай бұрын
Thanks for the thoughts. You're right that this design fans out to all followers, so we're sacrificing write speed for users with many followers in order to maintain read performance for the majority of users. As you note, there's many other details we could dive into, such as using a social graph and implementing geographic sharding. Thanks for watching!
@DavidDLee
@DavidDLee Ай бұрын
Client supplying timestamp "is a bad idea. Let's do it anyway"
@webcorejuan
@webcorejuan Ай бұрын
Awesome, which software do you use?
@interviewpen
@interviewpen Ай бұрын
We use GoodNotes on an iPad. Thanks for watching!
@webcorejuan
@webcorejuan Ай бұрын
Thanks for the video! which platform are you using to note?
@interviewpen
@interviewpen Ай бұрын
We use GoodNotes on an iPad.
@Travala
@Travala Ай бұрын
Thanks, I really like the videos! But (in my personal opinion) it would be much easier to perceive information if you took some pauses when you speak. Otherwise, videos are really helpful! And one of the topics I would love to know more about is how systems like Apache Spark or Hadoop work internally, what are the specific use cases and etc. Thanks again!
@interviewpen
@interviewpen Ай бұрын
Ok, thanks for the feedback. We do have multiple videos on Spark/Hadoop in our full course on interviewpen.com :)
@congminhluu5068
@congminhluu5068 Ай бұрын
I'm dumb so any help would be appreciated. Why are hash join on 100 rows tables faster than hash join on 10 rows tables ?
@interviewpen
@interviewpen Ай бұрын
It isn’t-we prefer the plan that filters the tables first, since fewer rows have to be joined that way. Thanks!
@xxbighotshotxx
@xxbighotshotxx Ай бұрын
Thank you for sharing this! This seems to be a common system design problem. I've gotten a variant of this at least twice now from companies that I've been interviewing with
@djseber3357
@djseber3357 Ай бұрын
would you be available for consulting
@interviewpen
@interviewpen Ай бұрын
Sorry, not at the moment. Thanks for watching!
@Kevin-cg7qk
@Kevin-cg7qk Ай бұрын
I feel like my Pokemon is about to evolve!
@tonynguyen-mq3tb
@tonynguyen-mq3tb Ай бұрын
🎯 Key points for quick navigation: 00:00 *📚 What is a database and how queries work?* - Database takes in SQL queries to retrieve data. - SQL is declarative, focusing on what data is needed not how to get it. - Internal complexities of a database translate declarative queries into execution steps. 02:09 *🧠 Process of executing a query in a database* - Database query process involves parsing, query planning, and execution. - Parser translates SQL query into a data structure for the database to use. - Query planner optimizes query execution and evaluates different plans based on database characteristics. 03:32 *🔍 Role of parser in database query execution* - Parser converts raw SQL text into a parse tree for easier database evaluation. - Parse tree organizes query components like select, from, and where clauses for database use. - Use of parse tree allows the database to recursively evaluate query components. 08:12 *⚙️ Query planner in optimizing database query execution* - Query planner considers table statistics, cost constants, and available indexes for query optimization. - It generates multiple plans, evaluates costs for each, and outputs the most efficient plan. - Optimizing query planning leads to faster and more efficient database query execution. Made with HARPA AI
@amirphl7834
@amirphl7834 Ай бұрын
This interview misses critical discussions about the way we send new tweets to the user. I think this system doesn't work as expected. specially having a limit list in Memcached. For example, what if someone has 30 million followers?
@interviewpen
@interviewpen Ай бұрын
Yes, having a large number of followers would increase latency when making a new tweet. This is a tradeoff-we’re optimizing for fast timeline loads over fast posts. Thanks for watching!
@mohitnagpal
@mohitnagpal Ай бұрын
Your videos are very helpful and to the point.
@interviewpen
@interviewpen Ай бұрын
Glad you like it :)
@thelostandunfounds
@thelostandunfounds Ай бұрын
Solve the payment processing by switching to bitcoin only payments.
@kspv2806
@kspv2806 Ай бұрын
Awesome thanks a lot
@interviewpen
@interviewpen Ай бұрын
Thanks for watching!
@ak-gi3eu
@ak-gi3eu Ай бұрын
how algorithms works video plz
@Zmey5656
@Zmey5656 Ай бұрын
Thank you a lot for your video. Maybe next time tell us about the pros and cons of SQL? For example, that is invented in the 80s and that it is ineffective when working with a large amount of data?
@interviewpen
@interviewpen Ай бұрын
Absolutely--we have a full video about different data models and storage formats (like NoSQL) on interviewpen.com :)
@saramshshrestha7641
@saramshshrestha7641 Ай бұрын
CS degree help me understand it pretty clearly. 😅
@NimaqAlizadeh
@NimaqAlizadeh Ай бұрын
Nice🎉
@interviewpen
@interviewpen Ай бұрын
Thanks!