System Design: How to design Twitter? Interview question at Facebook, Google, Microsoft

  Рет қаралды 536,614

Success in Tech

Success in Tech

Күн бұрын

Пікірлер: 359
@SuccessinTech
@SuccessinTech 6 жыл бұрын
I'm doing a little experiment over on IGTV, the SiT VLOG. Check it out! instagram.com/tv/BkYf4GphfQz/
@hiteshbitscs
@hiteshbitscs 6 жыл бұрын
Nice effort and really explain the things. Please mention the sources you have referred. This would allow us to go in-depth of a topic. Can you please also add low level design? In some orgs they asks HDL and LLD. How would you classify this? I think these boxes you drew were HLDs but the tables and ER diagrams would be part of LLD right?
@indiansoftwareengineer4899
@indiansoftwareengineer4899 5 жыл бұрын
I wanna get into Amazon, how can I get your referral?
@thedesicoder6391
@thedesicoder6391 4 жыл бұрын
Great job!
@garrysohi5623
@garrysohi5623 4 жыл бұрын
I know html, css, js, reactjs for frontend, python for backend, and mysql. Now I want to understand how to glue these together, build an application and deploy on server. What do I need to learn next? Is this the right video?
@biswajitsingh8790
@biswajitsingh8790 7 жыл бұрын
man i cant express my happiness. you are the only one on youtube(infact the internet) concentrating on high level systen design. many companies are shifting their focus from algorithms to system design now a days. it was so hard to figure out how to come up with answers to these. Your videos are a life saver sir. You people are literally changing lives. the minimum i can do is say a big thank you to you for making these vids.
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Biswajit Singh I‘m really stoked to hear that, man! Happy I can help you out. You would do me a huge favor if you could share my videos on your social networks. There will be more interesting videos to come! 👍
@LetsBeHuman
@LetsBeHuman 6 жыл бұрын
The minimum you can do is pay your first month salary to his patreon account, if he has one.
@SuccessinTech
@SuccessinTech 6 жыл бұрын
For that I’ll make a Patreon 😄
@nikhil199029
@nikhil199029 6 жыл бұрын
companies arent shifting focus, as u r becoming senior, u r facing more architect lvl questions.
@iitgupta2010
@iitgupta2010 5 жыл бұрын
Check "Tech Dummies".. .he is much better then him
@0x00A5
@0x00A5 4 жыл бұрын
I used the caching strategy described in this video in my system design interview. You are part of the reason why I received an offer from one of my dream company. Thank you!
@ethanlyu4839
@ethanlyu4839 4 жыл бұрын
hi, what caching strategy is described in this video? The Redis fan out part? Could you elaborate more? Thanks!
@0x00A5
@0x00A5 4 жыл бұрын
@@ethanlyu4839 Yes, the Redis fan out for active users, but I wasn't asked exactly to design Twitter. I borrowed this part of the design in my answer.
@jeevithatd9221
@jeevithatd9221 3 жыл бұрын
What design interview question u got ? Can you share ? It would be of great help for me.
@CknSalad
@CknSalad 3 жыл бұрын
@@jeevithatd9221 just look up github repo for: system-design-primer . It covers a lot of the most common system design questions as well as giving you the fundamentals before giving you the problems.
@knlsha
@knlsha 4 жыл бұрын
I'm halfway there and just overwhelmed with the kind of explanation this guy has put into the videos. Probably will complete this and come back again for more such videos. Thank you!
@IdoKleinman
@IdoKleinman 4 жыл бұрын
Hi Ramon. Thanks for making these SDI videos. There are quite a few important things missing from this video to be considered a complete and correct answer in a real interview: the list of different micro/services that makes the platform run. Full database design/schemas. API commands from client to server and in between important micro services. And most importantly - “back of the envelope” estimations I.e. number of users DAU, QPS, storage requirements, throughout requirements etc. I hope you’ll continue making SDI videos that contain this info too in the future. Many thanks and best of luck
@ogookafor2137
@ogookafor2137 3 жыл бұрын
I'm committed to watching your design video once a day till i finish them... then repeat. Thank you.
@SuccessinTech
@SuccessinTech 3 жыл бұрын
Love it :D All the best!
@geetalokannashasannavar9425
@geetalokannashasannavar9425 3 жыл бұрын
I have looked into couple of other twitter system design videos, but I felt your videos are way more explanatory. Your video answered my questions like "how the redis node is choosen out of many?", "for users with thousands of followers and uncertain about their next login, will constructing home timelines for such users is worth it?". I believe your design is not complete w.r.t analytics and search functionality, but still very informative and nicely explained. Thank you.
@SuccessinTech
@SuccessinTech 3 жыл бұрын
Thank you!
@ognjengatalo
@ognjengatalo 6 жыл бұрын
Very few people explain as well as you do and cover these topics. As a software engineer, I am very interested in these topics, and the community needs more videos like this! Keep up the good work!
@Venkat2811
@Venkat2811 7 жыл бұрын
Thanks for doing this! One suggestion: You should have separate playlist for system design and algo related questions.
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Venkat Raman That’s a good point, will do! Thanks
@deathbombs
@deathbombs 2 жыл бұрын
8:06 great breakdown by system traits to design improvement. Network access availability > consistency 9:27 I like how you go into higher lvl overview with actual scenario/api for when tweets made
@koteshmeesala1630
@koteshmeesala1630 4 жыл бұрын
What I like about your explanation is that u r not rushing it by preparing the content beforehand. Many of the videos does that cramming so much information in very little time. You are carefully walking thru the solution giving us ample time to make sense of a point u made. Can you suggest some resources(books,articles,lectures,seminars, utube channels like urs) to read/watch to get good at system design
@ChocolateMilkCultLeader
@ChocolateMilkCultLeader 2 жыл бұрын
I actually shared this with my newsletter for acing coding interviews. Great way of identifying problem areas and solving them
@manos7629
@manos7629 7 жыл бұрын
Hello Mr. Lopez! I loved this video. But it is always very likely to face a system design question totally out of what you had prepared for an interview. So a video on all possible system design components and how they are used for specific use cases in real life products can be very useful. So once building blocks are available, its easier from there. For example, REDIS database with its in-memory function is a good takeaway from this video which I can use in different scenarios.
@SuccessinTech
@SuccessinTech 7 жыл бұрын
Thanks for your feedback! I‘m planning something alone those lines. Don‘t forget to subscribe ;)
@BillyOGrady
@BillyOGrady 7 ай бұрын
I have an upcoming test about distributed databases and WDM, this has been such a help in considering how to answer these problems. Thank you!
@californiaesnuestra
@californiaesnuestra 3 жыл бұрын
The best design interview videos in your channel.
@FrederickAlvarez_
@FrederickAlvarez_ 2 жыл бұрын
today I was asked this question during an interview which makes me wonder what is the gain in asking something that pretty much can be memorized from videos just like typical common algorithms questions, I really don't see too much gain in companies expecting you to play to 'design the internet' I came up with something similar to this but replacing redis with temp tables 🌬️🔥 thanks for the info
@useratuserat
@useratuserat 7 ай бұрын
Really fascinating, many thanks. Hardly in the Internet can you find such content 🎉
@macsimmy
@macsimmy 6 жыл бұрын
Awesome video. Thank you. It gives me a basic idea about how to approach system design questions. This design covers a lot of things which is used in real-world huge systems. It includes relational databases, In-memory databses, hashing, load balancers and most important how to design system based on actual requirements, like eventual read consistency in case of twitter.
@ayasswain
@ayasswain 5 жыл бұрын
Amazing video on System design. Your way of explaining things is simple and on high level. Many thanks.
@SuccessinTech
@SuccessinTech 5 жыл бұрын
Thank you!
@Byblius
@Byblius 7 жыл бұрын
Time flew, amazing stuff man. Crazy ideas are being implemented when it comes to huge systems.
@amitsrivastava-l7d
@amitsrivastava-l7d 5 жыл бұрын
It's a wonderful explanation about Tweeter Timeline, User Followers in details with respect to the system design. That really rare and deep in terms of getting advanced topics that most of the top-level organization ask to clarify and see their confidence. Thank you so much for the sharing perfect video which I was eagerly searching for. I would like to request you one more topic about - Google Map and Gmail system design in detail. Thanks in advance. Better Luck.
@mannion1985
@mannion1985 5 жыл бұрын
Fantastic video. You can also optimise ram needed and computational load by having a redis cluster per region and by tracking where reads come from per user to only rebuild their timeline in regional clusters they are likely to read it from. (Dont worry about rebuilding my timeline in the UK if I only ever read from Australia). Of course you can divide the computation that way too with at least a worker per region. Also you can optimise the read requests themselves by only loading the most recent slice of the timeline and loading in the next slice when you scroll to the very bottom.
@niravpurohit4881
@niravpurohit4881 7 жыл бұрын
Great video :) really happy to see someone explaining overall system design in depth. Waiting for more exiting videos on system design.
@ravim3052
@ravim3052 7 жыл бұрын
This is great! Your approach, time management and advise to solve the problems are spot on. Thank you and keep up the good work!
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Ravi M Hey Ravi, thank you for the kind words! Stay tuned for more videos :)
@ZsoltSafrany
@ZsoltSafrany 5 жыл бұрын
I learned interesting things from this video but it was also pretty historical. I mean, I'm not sure how much signal I got about his design skills and tech leadership capabilities; I can tell he knows how Twitter works.
@amitagrawal4660
@amitagrawal4660 7 жыл бұрын
Here are few others design / architecture which i am curious to know ... would be great if you could create them in the near future: 1. KZbin architecture and design or similar video streaming websites 2. Amazon or any E-commerce website 3. Instagram 4. Google Search Engine
@garg_hbti
@garg_hbti 2 жыл бұрын
Thankyou for sharing this descriptive video. This is definitely the cleaner strike as you were aware of some of solutions and tech stack that Twitter has already incorporated. I would however more interested to know how the tweets with the visual content would be handled. May be some exploration toward CDN and CMS related solutions? I can understand covering all aspects in one video is not possible for anyone and would look forward for more contents posted by you. Great Going!!
@Shogoeu
@Shogoeu 2 жыл бұрын
You've mentioned not to use MySQL, but what do we use for a persistent store, in that case? Redis' in-memory approach is good for speed, but does not allow persistence.
@thisissomething5903
@thisissomething5903 2 жыл бұрын
Apache Kafka might be the solution to have both speed and persistence. You have producers and consumers that the latter can always make sure all published messages are read.
@CleristonMartinelo
@CleristonMartinelo 4 жыл бұрын
I did not understand why you need 3 redis? Thanks
@youartoyube
@youartoyube 5 жыл бұрын
at 9:46 he says the tweet will hit a gateway, then proceeds to draw a load balancer. anyone care to explain what comes first and how they're related to each other? (is load balancer and gateway the same?)
@sharatvyas5466
@sharatvyas5466 5 жыл бұрын
This was amazing! Thank you so much, as a beginner on System design, you explained it beautifully.
@kitkarson4226
@kitkarson4226 3 ай бұрын
What is the DB you are using in the solution? Redis is good for caching. but there should be something to store all the tweets..thats missing here
@andiwijayas
@andiwijayas 2 жыл бұрын
I think you're missing out the application servers that handles requests from Load Balancer. It won't go to Redis without a help of application servers that builds the chronological tweets
@qazwsx808
@qazwsx808 7 жыл бұрын
This is a great video. I have a quick question with using list in Redis. The video only mentioned store the tweet_id and sender_id for Bob's list. What about the actual tweet? Is the actual tweet store in Redis and we will need to do a look up by each tweet_id to get the actual text?
@smchoudhary123
@smchoudhary123 5 жыл бұрын
I believe tweet gets also stored in redis, considering its only text+links. It wouldn't be much useful if we still have to fetch tweets from DB.
@MayurPatil
@MayurPatil 5 жыл бұрын
Saving all the tweets for entire duration could be memory and computation intensive. Hence, I believe twitter uses time expiration mechanism in Redis. redis.io/commands/ttl I can say this because it takes only few seconds in you're looking at your feed. On the other hand, it takes more seconds for a query when you search it on Twitter.
@sriramsubramanian1291
@sriramsubramanian1291 5 жыл бұрын
Why do we store 3 times in redis?
@minsukoh6290
@minsukoh6290 5 жыл бұрын
Sriram Subramanian To handle failures of cache nodes utilizing a number of replicas
@ramanpk5221
@ramanpk5221 4 жыл бұрын
after clarifying the requirements, wouldn't the next step to be understand the load patterns to the service? Wasn't jumping to the schema design a bad idea?
@danielgent6035
@danielgent6035 7 жыл бұрын
Your videos have been amazing. They are a great complement to other videos that are more algorithm focused.
@anantsaksena1989
@anantsaksena1989 6 жыл бұрын
It will be great if the architecture of maintaining hastags in twitter can also be explained: Search, top trending hashtags etc.
@vikranthpatoju
@vikranthpatoju 7 жыл бұрын
Thanks a lot for the video. it helps us to think the system design in a broader perspective. I have two questions here. You said conventional Relational Database would be a bottleneck in this kind of systems. Does NOSQL would be the ideal one here for storage?. Also during the entire video, you have talked about In Memory Database. At what point of time, this data gets persisted into the database?
@cats3xxx
@cats3xxx 6 жыл бұрын
He mentioned there should be a machine between the Load balancer and the redis clusters. I would guess that machine would take care of persisting the tweet into the database (preferably in an async manner)
@gopala5334
@gopala5334 5 жыл бұрын
Yes, it will get persisted in NoSQL for sure, As ​@cats3xxx mentioned. Initial POST and GET will always happen on Redis and I see his design shows Redis is kind of persistence cache for faster tweets flow.
@isaac48
@isaac48 4 жыл бұрын
Why is it being replicated 3 times on the redis machine though? Why isn't one redis machine enough
@Varunshrivastava007
@Varunshrivastava007 4 жыл бұрын
To avoid a single point of failure. If there would have been only one Redis machine and it failed before persisting data into the database then data will be lost.
@0xggbrnr
@0xggbrnr 5 жыл бұрын
I'm confused: Why does the request reach the Redis cache right after reaching the LB instead of the request first reaching the LB, then an application server (a service), then a Redis cache? How does the cache know which records to search for? Does that mean that the API requires that each request contain hash information for the Redis cache and that the Redis cache is set up to manage HTTP requests?
@maatlabs
@maatlabs 6 жыл бұрын
The only thing I didn't like about this video is that I can only like it once. What a great Video!!!
@skumakerguitar8708
@skumakerguitar8708 7 ай бұрын
I don’t get it how redis can maintain relationships data , how does redis know who follow who?
@BhilaiDude
@BhilaiDude 5 жыл бұрын
I think you wanted to say 'everyone that follows you' in the video at 11:13.
@ravhaak
@ravhaak 5 жыл бұрын
Miles to go before you sleep. Could you please prepare system design and LLD for the following: 1. Simulation of a cricket match, football match etc. 2. Implementation of Queue like Kafka 3. Ecommerce price drop notification system for 50M products 4. Amazon like website and order management system i.e. everything that happens after clicking checkout 5. Elevator system 6. Scrabble 7. Chess game 8. A library for evaluation of expression
@tonidezman3643
@tonidezman3643 7 жыл бұрын
Your content is amazing. You should create Udemy course on System Design Interview Questions.
@elradmerad9252
@elradmerad9252 7 жыл бұрын
Fantastic tutorial. It certainly helped me to get a perspective of the system design. Keep rocking and thanks for helping the world !
@SuccessinTech
@SuccessinTech 7 жыл бұрын
Thanks for the kind words!
@AlkaSharma-nw4zg
@AlkaSharma-nw4zg 5 жыл бұрын
Thank you so much for posting this video. This is great! Many regards.
@claratech5056
@claratech5056 6 жыл бұрын
Hi, Its an awesome video on twitter Architecture. Just a qn on, when you had said that when user tries to access his Home Timeline, if you are a follower of big celebrities, their latest tweets would be fetched from DB and inserted along with Redis data. You had missed this feature while explaining the Home timeline feature towards the end of video. Please clarify.
@SuccessinTech
@SuccessinTech 6 жыл бұрын
That is an optimization you could implement if you are somehow constrained, it‘s not strictly necessary
@will9196
@will9196 3 жыл бұрын
Great video!, just wondering why would redis update 3 times if a single request came in?
@zshn
@zshn 4 жыл бұрын
System Design is a discovery process, which means you start with a prototype stage to a production ready stage. It seems you demonstrated the final design, instead of starting with a standard design and improving on it incrementally based on the real-world challenges.
@Zhinkk
@Zhinkk 3 жыл бұрын
Exactly. It seems unreasonable an interviewee is going to come up with something like this that took Twitter years in 45 minutes. Would have been better to start form the ground up and build a reasonable system.
@aditya234567
@aditya234567 4 жыл бұрын
Where is unique tweet id created?? immediately after load balancer? How will it be consistent and unique with other distributed servers once created on fly?
@simikaur1171
@simikaur1171 3 жыл бұрын
Thank you!! Really loved the way you explained everything: crisp and clear! Can you please explain: Your use case: Alice posted tweet. Bob follows Alice. Bob's timeline updated with Alice's tweet in say Redis 1,2,3 Assume one more use case: Kate posted tweet. Bob follows Kate. Bob's timeline updated with Kate tweet in say Redis 4,5,6 When Bob is viewing the timeline and we do the HashMap lookup to find the 3 Redis machines which of the above 3 machines will be returned to display Bob's timeline? Suppose Alice and Kate stay far away, will Bob's timeline be always updated in Redis 1,2,3 only or can it change?
@mailistub4991
@mailistub4991 2 жыл бұрын
Thanks for the nice video, it is informative. I have two questions. 1) You mentioned that data will be duplicated on three reddis servers. How to are these three servers been selected? Do they intentionally choose three reddis in three different locations? For example, one in local (US), another at Asia, and another one at EU? Then, the question is what if the user travels to Australia? 2) I may missed it, is this design, sounds like one tweets will get duplicated at the home page of all followers. That means a lot of duplications, which will end up with much more memory/storage usage. Is there any way to relief this?
@suitub5710
@suitub5710 2 жыл бұрын
your every word is useful and informative!!!
@rajrebelify
@rajrebelify 4 жыл бұрын
question: if we are not persisting the tweets on the DB, how can a user access old tweets/timelines? is case of any cache cleaning activity , where will the data be retrieved from ? @success in tech
@Zealotux
@Zealotux 4 жыл бұрын
Tweets _are_ being persisted on the DB, the goal of the architecture presented in this video is simply to avoid having to call expensive queries on the DB to populate the users' timelines every time they visit Twitter. This is a form a precomputation called _materialization_ is the database world, especially with NoSQL (but not only), you prepare recurring results to limit latency and resource expenditure at load time. Users can still access their old Tweets and timeline, but this will be relatively slower than accessing the current timeline, which is fine since it's not as usual. If Redis instances gets flushed for some reasons, they can still rebuild timelines from the DB, it'll just cost a lot of resources upfront.
@RajKumar04041992
@RajKumar04041992 4 жыл бұрын
The following was not mentioned in the video, I wanted to know if this is an acceptable idea. Since twitter like most social media is read heavy, we can maintain different servers for read/write operations. This makes sense cause, we can scale our servers accordingly Ex: if read server is 50 TB, then write server could be 10 TB or similar. This way, we can also make efficient use of in-memory cache since table reads will be different for read and write and thus mixing up them in same cache doesn't make much sense.
@MrAdnan252
@MrAdnan252 5 жыл бұрын
How do you ensure consistency between the 3 redis instances? If a write to one of the three fails, are all rolled back?
@SuccessinTech
@SuccessinTech 5 жыл бұрын
That‘s the part of EVENTUAL consistency. In comparison to a system thats trades in availability to gain strong consistency, a social network favors availability and can live with the fact that you may see a tweet earlier than I do etc. Now how do you keep those instances eventually consistent? Master/slave, quorums, gossip protocols etc
@thelavishcoder2553
@thelavishcoder2553 4 жыл бұрын
This guy is awesome! Subscribed
@boombasach
@boombasach Жыл бұрын
I think what exactly is “tweet” needs to be defined first ; some aspect of it will come in sorting
@itsgrace74
@itsgrace74 6 жыл бұрын
This is great! Can you talk about how to design a recommendation system like people purchased this product also bought these other products?
@SuccessinTech
@SuccessinTech 6 жыл бұрын
Thank you :D Yeah I‘ll take a note of this
@atulkumar-bb7vi
@atulkumar-bb7vi 5 жыл бұрын
Thanks for this insight with great simplicity. Hope to see detailed videos on followup topics as well. Thanks!
@Timwangmusic
@Timwangmusic 7 жыл бұрын
Great video, thanks a lot. Shouldn't load balancer connects to servers and the servers access external persistent memory like Radis?
@true_human_007
@true_human_007 6 жыл бұрын
Radis is in-memory which is very fast compared with external database. Moreover, fetching data from external DB is much costly
@enriquejaimes3368
@enriquejaimes3368 6 жыл бұрын
Redis boxes are servers by themselves. You can decide to put your in-memory caching either in the same machines that are serving the initial HTTPs requests or have a dedicated fleet (most used).
@tahoefor
@tahoefor 3 жыл бұрын
I love the video, thank you for doing this. To design the system like Tweeter in the time constraint of an interview, I would probably start with no caching layer whatsoever. Just bunch of distribiuted databases. In every case, REDDIS is typically in-memory and has to have a traditional database as its source. Another point I would cover is once the user is logged and receives his initial snapshot of timelines, how does Tweeter merge live updates into user timelines.. Then an interesting question is if half of your friends are local and half are on the other continent. How does twitter merge tweets with different latency profiles. In any case, thanks for doing it!!!
@aleph.5811
@aleph.5811 5 жыл бұрын
Do you have any book recommendations for these sort of high level design that we can read and get better?
@ReachGoals
@ReachGoals 5 жыл бұрын
System design can be understood by reading articles and video blogs. There is no complete books to best of my knowledge.
@GabrieleCimato
@GabrieleCimato 5 жыл бұрын
Designing Data Intensive Applications is an absolutely amazing book!
@xiaoshengliu5860
@xiaoshengliu5860 4 жыл бұрын
@@GabrieleCimato Hi! I just wonder if this book is friendly for beginners? Thanks!
@GabrieleCimato
@GabrieleCimato 4 жыл бұрын
@@xiaoshengliu5860 that's a good question, it starts from very basic stuff and then it gets more intricate. I wouldn't say it's for beginners but if you're willing to put in the time it'll give you a deep understanding of modern data management.
@xiaoshengliu5860
@xiaoshengliu5860 4 жыл бұрын
@@GabrieleCimato Thanks!!!
@eldojoseph8718
@eldojoseph8718 7 жыл бұрын
Hi, Can you please do a video on designing a service like Uber/Lyft? Including services like location based look-ups for cabs, computing route, fare etc. It seems to be a common interview question. Great job by the way.
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Eldo Joseph yes! Thats exactly what I have planned for the next system design video. Thank you!
@apbh
@apbh 7 жыл бұрын
Also designing a recommendation system please. Thank you so much for taking the time to make these videos. They are very helpful and resourceful. Glad and lucky to have come across your channel.
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Akshatha Thank you, thats always great to hear! I’ll do my best to make some more of these asap :D
@augmentos
@augmentos 4 жыл бұрын
Can you do a video on system design for a twitter or IG notification system?
@OldGeez3r
@OldGeez3r 5 жыл бұрын
Hi. Actually you didn't cover (or I failed to notice?) the USER's own tweets page. If all the tweets a user creates are only stored in their followers's own lists, what happens when the user accesses their own tweets history page? Going by the solution you've presented here, the system would have to retrieve for instance BOB's list, filtered by Alice's ID ? Is that what happens for Twitter? Thanks.
@SuccessinTech
@SuccessinTech 5 жыл бұрын
Hey Andrei. First of: I don‘t know what Twitter actually does and it shouldn‘t matter. It‘s just presenting a naive design that could work. For your own tweets page you could go multiple ways. Also precompute it (trigger by tweet creation) or just do a lookup in the tweets table (slower but maybe Ok because lower priority and lower traffic). What do you think?
@ebragimovic
@ebragimovic 5 жыл бұрын
I liked the video before i finish the first 5 mins! thanks a lot for the great video =)
@SuccessinTech
@SuccessinTech 5 жыл бұрын
Thanks! Glad to hear :)
@OmarQunsul
@OmarQunsul 5 жыл бұрын
Maybe the Hash Lookup can be replaced with precomputed Hash value in the database/table of users? in case it can be replaced in the future, or more Redis instances are added. You don't want to move the data of the existing users
@cherie12112
@cherie12112 6 жыл бұрын
Extremely grateful for your videos!
@SuccessinTech
@SuccessinTech 6 жыл бұрын
Glad you like them! If you want to support the channel and future content please share my videos and spread the word on your social media =)
@imasomebody1
@imasomebody1 5 жыл бұрын
Great video! A few things: this is more architecture than system design. Also in an interview the interviewers probably want you to focus on _your_ design rather than what twitter is already doing. And why does twitter create identical copies of the same tweet in each user list, seems redundant? Why not have each tweet only store the tweet id or something instead? Just curious ... :)
@prashanthy339
@prashanthy339 6 жыл бұрын
Can you please do a system design video on 2 topics A) how do u make sure the number of simultaneous video streams somebody watching let’s say Netflix is only 3 devices at a time. B) windows system update, how do u stream a windows system update to client computers ?
@koteshmeesala1630
@koteshmeesala1630 4 жыл бұрын
why does it redirect me to "Alice Johnson" profile when I click on link to follow on twitter
@TheAdithya1991
@TheAdithya1991 2 жыл бұрын
Thank you for the video, Sir! May I ask why you choose to mix the implementation details with the design, is it the standard practice? For instance, you mentioned Redis as a in memory DB in the diagram. Why not just leave it at "in memory DB"(the design) and leave out the Redis (the details). Much thanks!
@genuineprofile6400
@genuineprofile6400 2 жыл бұрын
Brilliant video on Twitter news feed generation. But storage of tweets was not discussed. Since 100 million tweets are created per day. Would have been interesting to know how this massive volume of tweet are stored and scaled. Thanks for video.
@swayamraina4564
@swayamraina4564 7 жыл бұрын
Hi, Can you please do a video on designing a service like google docs and how to keep everything in sync, concurrent writes by multiple users etc
@kumarmanish9046
@kumarmanish9046 3 жыл бұрын
no scale estimation ? throughput estimation ? storage estimation ?
@rajatbajpai25
@rajatbajpai25 4 жыл бұрын
From what I know Redis is more than an in-memory database, it does provide persistence. Am I wrong?
@akkineniajay8117
@akkineniajay8117 6 жыл бұрын
It was a very good head start into how I can approach a problem. Thanks a lot.
@rodrifernandeztouza1032
@rodrifernandeztouza1032 4 жыл бұрын
What's the rationale for having 3 Redis databases instead of 1? Optimize recovery time based on user location/server load? Thank you!
@dinakarmaurya8000
@dinakarmaurya8000 7 жыл бұрын
Thanks Ramon such good explanations, 1. purpose of 3 cluster ? is only for - the fastest one response to be taken as result? 2. user bob table and follower table are created in radish cache only not physical db tables?
@SuccessinTech
@SuccessinTech 7 жыл бұрын
Thanks! 1. speed and replication 2. yes they are stored in a conventional DB too, as a backup so to say.
@xosupermarc
@xosupermarc 5 жыл бұрын
are we caching ID's of tweets in redis list, or the 140 character tweets themselves? When we "fan out" and update the home timeline of all of the users who follow us, are we updating that list with id's or the actual tweet.
@shettyanvita
@shettyanvita 5 жыл бұрын
I think we store the tweets itself in the redis. Accessing the entire tweet based on tweet id by querying the database can be time costly
@smchoudhary123
@smchoudhary123 5 жыл бұрын
Can we do tweet publishing design with Websockets + queue? Not sure if twitter already used it. There is still option of Http2+Long polling or Http2+Server sent event.
@killer4238
@killer4238 4 жыл бұрын
What about a timeline that’s dominated by large, famous accounts?
@jonsnow9246
@jonsnow9246 7 жыл бұрын
Seriously, A big Thank You for these videos! What should I read to dig a bit deeper into these topics? Like technologies used etc...
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Jon Snow Hey man, glad you like them! If you want to dive deeper into real world solutions highscalability.com is really good. On the more theoretical side of things the books of Andrew S. Tannenbaum are classics but they get updated quite often. Definitely worth reading.
@tapeshbhandari4950
@tapeshbhandari4950 3 жыл бұрын
That's amazing. Just one question: Why do we need 3 redis instances? Can 1 of them not suffice?
@SuccessinTech
@SuccessinTech 3 жыл бұрын
It’s common to use Redis in clusters to increase availability, performance and available storage space.
@ankitagupta136
@ankitagupta136 7 жыл бұрын
Awesome video and stuff.. I was trying hard to get hold of Design Solutions but could not find good content.... Keep it up and continue making great videos... :)
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+ankita gupta Thanks, Ankita! I‘ll do my best :D
@md.abdullahal-alamin8059
@md.abdullahal-alamin8059 6 жыл бұрын
great video. But probably Database size, sharding and some other memory and space complexity should have also discussed
@SuccessinTech
@SuccessinTech 6 жыл бұрын
And load balancing and encryption and security and infrastructure cost and testing and monitoring and legal requirements and alarming...
@tysongood01
@tysongood01 7 жыл бұрын
Thank you so much for sharing this. But I think it is just some parts of the system design. We still have a lot of things to introduce. Redis is a memory database, but what if all the replicas are down? We should store the data in disk, with Redis itself or other no-sql databases. Shall we consider how the servers work, what servers we should have, with read and post servers respectively? How we consider the security issues, shall we user a gateway, and introduce SOA theory tools like service registry and discovery?
@SuccessinTech
@SuccessinTech 7 жыл бұрын
+Yasen Zhang Yeah, nobody expects you to cover the in‘s and out‘s of such a system in a 45min interview. Architectures like this grow over years. If the interviewer wants you to cover a specific topic then you should dive deeper into it.
@tysongood01
@tysongood01 7 жыл бұрын
Got it. I've never had a system design interview before. But I gonna take one next week. It really helps me . Thank you.
@gvrpraneeth
@gvrpraneeth 7 жыл бұрын
can we simulate a basic scalable setup like this in cloud, like AWS, and test the performance ?
@sarashamsher2273
@sarashamsher2273 4 жыл бұрын
I found your videos quite effective. Can you please put up video on system design of apps like Amazon too.
@ayasswain
@ayasswain 6 жыл бұрын
Wonderfully explained. Excellent stuff. Thank you much.
@darial3325
@darial3325 6 жыл бұрын
Thanks for the great video! I have a question regarding timeline - does the system stores the whole user's timeline from the beginning (in Redis), or some portion of the timeline? For example, from last login?
@SuccessinTech
@SuccessinTech 6 жыл бұрын
Depends on what your goals/constraints are, right?
@gauthamg
@gauthamg 4 жыл бұрын
According to the source video, they store about the last 800 tweets from a user's home timeline.
@DadBodSwagGod
@DadBodSwagGod 5 жыл бұрын
It would be very useful to have a version of this that isn’t sped up while you’re drawing things. It’s not as important, but I do get some anxiety trying to figure out how (or if) to fill the awkward silences during stuff like that
@SuccessinTech
@SuccessinTech 5 жыл бұрын
That‘s a super interesting point, thank you. I‘ll try to address this in my next video!
@chrisharding4011
@chrisharding4011 5 жыл бұрын
This was great! I thought fan-out was asynchronously sending a message to a number of recipients (e.g. when you submit a tweet it gets sent to the search pipeline, to the user timeline pipeline, plus other pipelines). But you seem to suggest fan-out has something to do with the Redis precomputation step?
@SuccessinTech
@SuccessinTech 5 жыл бұрын
Hey chris, thank you. The word fanout is very generic. It just means that there is one or more entities which are then duplicated and sent to a number of recipients. The context is important. In this case a tweet is duplicated across 3 replicas of Redis during precomputation.
@vasusharma1192
@vasusharma1192 4 жыл бұрын
Doesn't twitter store its tweets in some database permanently or it stores everything *in memory* redis databases ? Like , what if the redis machines malfunction one day .
@Aum1031
@Aum1031 7 жыл бұрын
Love ur tutorials. Please do a system design for a ecommerce website
@llliiillliiilll404
@llliiillliiilll404 6 жыл бұрын
Why tweeting is PUT request and not POST?
@artemos3344
@artemos3344 5 жыл бұрын
agree, PUT used for update
@marcushines4172
@marcushines4172 5 жыл бұрын
The idea is that you’re UPDATING your followers list of tweets, adding to the list which is stored in the in memory DB, not creating a brand new tweet in a relational database. PUT request is correct.
@OldGeez3r
@OldGeez3r 5 жыл бұрын
@@marcushines4172 Not necessarily. From my point of view, a PUT would require sending the whole LIST object with updated values, whereas in this case only a new tweet is being sent. We don't know what data structure (software / hardware) actually holds the list of tweets for BOB's homepage, but we could suspect an INSERT-like operation is taking place there. So POST would maybe be the better answer in this case ?
@heenasurve
@heenasurve 6 жыл бұрын
This might be a rather basic question but I was wondering what is the best way to maintain a followers table? Is it just userId and followerId - for a celebrity that would mean millions of rows! And I don’t suppose a list of follower ids for every user Id is ideal in relational databases. Any suggestions
@matthewhenschke9933
@matthewhenschke9933 4 жыл бұрын
Why use 3 Redis clusters? Is that arbitrary?
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Twitter system design | twitter Software architecture | twitter interview questions
36:56
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,2 МЛН
Twitter System Design | System Design Interview Question
47:54
codeKarle
Рет қаралды 123 М.
Episode 06: Intro to Architecture and Systems Design Interviews
49:15
Jackson Gabbard
Рет қаралды 494 М.
Design Twitter - System Design Interview
26:16
NeetCode
Рет қаралды 551 М.
Google Systems Design Interview With An Ex-Googler
59:59
Clément Mihailescu
Рет қаралды 771 М.
Google system design interview: Design TikTok (with ex-Google EM)
1:09:18
IGotAnOffer: Engineering
Рет қаралды 206 М.
Интервью по System Design. Александр Поломодов (Тинькофф)
1:26:41
Distributed Systems in One Lesson by Tim Berglund
49:00
Devoxx Poland
Рет қаралды 420 М.