System Design: TINDER as a microservice architecture

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ค. 2024
  • Looking to ace your next interview? Try this System Design video course! 🔥
    interviewready.io
    We design the system architecture of Tinder. Designing these apps starts with clarifying the system requirements. In an interview, Tinder has multiple requirements.
    When designing the system, we will be drawing logical components and defining their interactions with other services based on the microservice architecture. We assume that any internal details can be handled with our prior knowledge of system design concepts. This includes load balancing, message queues, databases, etc...
    The Tinder system has four requirements: storing profiles, recommendations, noting matches and chatting with matches. Storing profiles is trivial except for the image storage, where we argue on BLOB vs File storage. The distributed file architecture seems best when storing images.
    Direct Messaging or chatting with matches can be done using the XMPP protocol, which uses web sockets to have peer-to-peer communications between client and server. Each connection is built over TCP, ensuring that the connection is maintained. The session microservice can send messages to the receiver based on connection to user mappings.
    Our system is decoupled as much as possible. We try to maintain accept and reject information on the client. On swiping left or right, the client can note the action and avoid showing the same user again, perhaps using bloom filters.
    The server has a validation engine called the matcher microservice, which notes matches and allows or disallows chat between two users.
    The final requirement of recommendations needs city-wise partitioning of the user data. This is achieved using NoSQL databases like Cassandra or Amazon Dynamo. The other option is to use relational databases with horizontal partitioning. The concept is now referred to as sharding.
    If you have any doubts, suggestions, or feedback, I love to hear them below. This system is by no means complete, but it is enough for an hour-long interview.
    Disclaimer: The video does not contain or suggest the internal implementation of Tinder. The system we design is purely imaginary and has no links with the real app. I am sure the engineers at Tinder have done better than this!
    00:00 Prerequisites
    00:40 Picking features
    05:50 Storing images
    12:30 System Design
    18:22 Direct messaging for chat
    23:45 Matching algorithm
    27:16 Recommendation Engine
    34:40 Final pointers
    CDN -
    • System Design: Content...
    www.akamai.com/us/en/resource...
    en.wikipedia.org/wiki/Content...
    Consistent Hashing -
    • What is CONSISTENT HAS...
    Online Judge link: interviewready.io/learn/syste...
    System Design Playlist -
    • System Design for Begi...
    You can follow me on:
    LinkedIn: / gaurav-sen-56b6a941
    Twitter: / gkcs_
    #SystemDesign #SoftwareInterview #Tinder

ความคิดเห็น • 1K

  • @abdoulbarry8111
    @abdoulbarry8111 3 ปีที่แล้ว +221

    dude!!!! This is how colleges are supposed to teach. Why am I learning more on youtube than my $40k degree has ever presented to me 😭😭 You are awesome man!!!!!!

    • @kumar309
      @kumar309 3 ปีที่แล้ว +7

      @@thisisneeraj7133 and Any professor who has real experience won't go back to teaching and become professors!!!!!!! U have to understand that teachers can only provide basic information. We as students need to digest every possible available information and filter out the ones we need to progress. then only we can succeed in life. simply saying, nobody taught me well is not acceptable. This is why Internet plays an important role in getting information from multiple sources.

    • @Cory816
      @Cory816 2 ปีที่แล้ว +1

      I agree partially. While the content that places like TH-cam provides can be as good or better than what we see in college, the major advantages that colleges have are the structured tasks and feedback that you get. I can watch this video and call it a day, but college puts us in a situation that forces to apply what we have just learned, and does so in a way that builds upon previously taught concepts. Sure I can do that on my own too, but its a lot easier after experiencing that style of learning already.

    • @clbreeze909
      @clbreeze909 2 ปีที่แล้ว +1

      ​@@kumar309 infact there are many who goes back to teaching and research. any University with high focus on research will have excellent professors. Sadly quality of research and education in India is not good enough except some chosen ones like IITs.

  • @victortrevino4169
    @victortrevino4169 5 ปีที่แล้ว +1104

    Its inevitable that this channel will be successful. You got the goods man. Intelligence, eloquence, and the positive energy. Thankful for your work, will definitely pass the channel along

    • @gkcs
      @gkcs  5 ปีที่แล้ว +16

      Thanks Victor!

    • @victortrevino4169
      @victortrevino4169 5 ปีที่แล้ว +25

      No Problem Gaurav SenPai!

    • @anshumanv
      @anshumanv 4 ปีที่แล้ว +4

      SenPai! 🙏

    • @Imujjwalanand
      @Imujjwalanand 4 ปีที่แล้ว +2

      Datte Bayo!

    • @nitinkulkarni7942
      @nitinkulkarni7942 4 ปีที่แล้ว +18

      @Peter Lustig Rather than saying the design has flaws, you should have spent time describing them. It is easy to just sit there and criticize.

  • @92AkshaySharma
    @92AkshaySharma 4 ปีที่แล้ว +95

    The ear to ear grin when he talks about getting matches, makes this video more interesting

  • @praveensg
    @praveensg 2 ปีที่แล้ว +82

    17:48 - A good use case for an image service would be when you need to send different resolutions or sizes depending on the client (e.g. mobile, desktop, print etc.)

    • @man904u
      @man904u ปีที่แล้ว +2

      Mostly tinder is phone only. So phone only priority is considered by default. But good usecase.

    • @DJ-bo4pz
      @DJ-bo4pz หลายเดือนก่อน

      @@man904u yup, but a good use case would be for profile picture (shown while chatting) vs profile picture shown as a card when swiping - same image but different resolutions.

  • @davidsandovalrios7952
    @davidsandovalrios7952 3 ปีที่แล้ว +28

    Engineering universities need this kind of real world problem solving exercises like your videos, I'm even surprised that I'm learning from this for free.

  • @adamberry7536
    @adamberry7536 3 ปีที่แล้ว +27

    I appreciate the content from all the TH-camrs out there helping us with System Design and DS&A but I have to say, I feel like a lot of the younger ones are just doing it for monetization or popularity. Your enthusiasm really sets you apart man. Good job finding something you enjoy doing. You seem like a good dude.

  • @arjungupta250
    @arjungupta250 2 ปีที่แล้ว +66

    I can watch your series on System Design with more interest than most of the web series coming these days. Please keep up the good work!

    • @ashwanisingh3291
      @ashwanisingh3291 8 หลายเดือนก่อน

      this is so relatable man
      kudos to you gaurav sir for this wonderful playlist

  • @Jacob-cg9fd
    @Jacob-cg9fd 2 ปีที่แล้ว +13

    Not only the content is of high quality, ur passion and energy make this even better. Really like ur videos!

  • @lawrencechang7609
    @lawrencechang7609 3 ปีที่แล้ว +48

    "if your interviewer gets too deep into cryptography [grin] best of luck" haha that was awesome lol! keep up the great videos!

  • @anamigator
    @anamigator 4 ปีที่แล้ว +20

    One thing to remember about databases are they aren't storage wise different from files. What a database provides you is multi user concurrent access without corrupting your data and acid aspects. In theory there's hardly a case where you'd put a big blob in your database. Most often just use paths to big files and keep those paths in the database table. The paths could be on an NFS or whatever distributed file system there is. Your NFS can then deal with geolocation etc. You could create read only mount points across multiple geographical locations for the same file. I'm just leaving this here for anyone to discuss these points further with me. Great video btw!

    • @NikhilTulseja
      @NikhilTulseja 2 ปีที่แล้ว +2

      How will NFS deal with geolocation?

  • @SameerSrinivas
    @SameerSrinivas 4 ปีที่แล้ว +5

    Hey Gaurav, just wanted to say big thanks to you. Recently, I was asked the choice of storing images bw dfs and sql table in a design interview. Having watched your videos before, I nailed that discussion. There were lot of other stuffs too in that interview, but it was super helpful to have seen your videos before. Thanks a lot for your time and efforts.

  • @callnishanth
    @callnishanth 4 ปีที่แล้ว +4

    Thank you very much for this video.Its really amazing. I know you approached this video more from an interview perspective so you can only touch on high level points, but please think of making a series about each service so that we know how the real world implementation works and how we need to approach it at a more detailed level. I liked the BLOB vs FILE talk. Keep up the good work.

  • @mrrobot6320
    @mrrobot6320 3 ปีที่แล้ว +18

    This playlist should be a series on Netflix :P

  • @ahmetakgul5426
    @ahmetakgul5426 3 ปีที่แล้ว +3

    I love the excitement and energy you talk with! Made me excited to keep listening haha

  • @shobhanksharma65
    @shobhanksharma65 3 ปีที่แล้ว +2

    You made it easy! Probably some things I feel like need to be discussed: Storage and bandwidth requirements; probably authentication and authorization can be services to note; load balancers; system interface definitions eg. acceptMatch(userId1, userId2).

  • @melikagolkaram7606
    @melikagolkaram7606 2 ปีที่แล้ว +1

    I am SO happy I found this channel! I'm watching this content like a Netflix binge watch!

  • @michelledai1106
    @michelledai1106 4 ปีที่แล้ว +11

    Love your video! feeling a bit dedddd at 5am, but your enthusiasm at 18:20 immediately lights me up lol .Good job man! And thank you for such good content and detailed explanation.

  • @devinsills1281
    @devinsills1281 2 ปีที่แล้ว +4

    RE Recommendation Engine: you can definitely have a composite index on multiple columns. The B-tree can be searched on the first column, and each of those matches will also be structured to allow further B-tree searching on the next column, and so on.

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 2 ปีที่แล้ว

    Love your enthusiasm, watching the series again and trying to co-relate it to what I have at work.

  • @nahuelalberti5963
    @nahuelalberti5963 ปีที่แล้ว +2

    Gaurav, your channel is a gold mine. What an amazing engineer you are, thank you for your content!.

  • @pallavisingh2912
    @pallavisingh2912 4 ปีที่แล้ว +5

    Absolutely love the video! I don't know when will I use these concepts but just getting to learn about it is itself an experience. Hands down the best tutor!!!

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thanks!

  • @dimiansari6047
    @dimiansari6047 5 ปีที่แล้ว +10

    35:09 saw on repeat xD anyhow, awesome videos dude! This channel is going places!! :D

  • @talharafique8913
    @talharafique8913 4 ปีที่แล้ว +1

    you really deserve the appreciation !
    i never ever saw a person discussing these complex concepts on youtube in a simple and fast way.

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thank you 😁

  • @paperguns115
    @paperguns115 2 ปีที่แล้ว

    I absolutely love your channel and how you present material. Thank you so much for all of these videos and excellent explanations on difficult and important concepts!

  • @gkcs
    @gkcs  5 ปีที่แล้ว +246

    Hey guys!
    This video is my attempt at designing Tinder. Points to keep in mind are: clarify requirements, design the basic system, modify per feature, use concepts learnt earlier to meet requirements.
    Also, if you are preparing for a system design interview, try interviewready.io 👍
    Cheers!

    • @madhuvamsimachavarapu5267
      @madhuvamsimachavarapu5267 5 ปีที่แล้ว

      love ur videos,,thank u my friend

    • @akshaythakare5165
      @akshaythakare5165 5 ปีที่แล้ว

      We could setup webRTC data channel based messaging thus avoiding the message being send via a server. And it's better for privacy.

    • @scube1272
      @scube1272 5 ปีที่แล้ว

      Ladhki

    • @himadri_nath
      @himadri_nath 5 ปีที่แล้ว +3

      WebSockets - create TCP connection to server, and keep is as long as needed. Server or client can easily close it. Bidirectional communication - so server and client can exchange data both directions at any time. It is very efficient if application requires frequent messages. WebSockets do have data framing that includes masking for each message sent from client to server so data is simply encrypted.

    • @ketulvinayshah
      @ketulvinayshah 5 ปีที่แล้ว +3

      In addition to sharding what we could also do is to keep a db field called preferences which is a bit set of user interests in different activities. Using that we can then for each shard create a k nearest neighbors chart for this preferences fields which should give us users nearest to us which we could then recommend.
      Also not totally sure but how about using distributed ledger (nosql append type) i.e. file for storing chat history indexed by hash of both users in chat. And a message queue that is used for transporting any new message typed by any of the users?
      Would love to hear your thoughts on above.

  • @philipg.5316
    @philipg.5316 5 ปีที่แล้ว +4

    Thanks so much for your awesome systems design video. You really provide the shining part of design, which is taking customer use case into consideration and go from there, and also break down web service/application layer/db & DFS when comparing different approaches and see which one fits the best.

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      😁

  • @romainbey
    @romainbey 4 ปีที่แล้ว

    Thanks very much. I've been learning Django through tutorials and books for couple of weeks now and i couldn't understand the structure behind apps. This makes everything much clear. i'll probably watch all your videos.

  • @vivianbezerradesathiebaut4720
    @vivianbezerradesathiebaut4720 3 ปีที่แล้ว

    As usual, great video! I started watching your videos to get ready for interviews, but I keep watching your channel just because I love how much a learn in such short videos. Thanks for sharing your awesome work :)

    • @gkcs
      @gkcs  3 ปีที่แล้ว

      Thank you 😁

  • @MrDroy13
    @MrDroy13 4 ปีที่แล้ว +3

    This was a really fun exercise. I tried to put down my thoughts and then watched the video.
    Keep making such Architecture videos.

  • @yukizhuo4124
    @yukizhuo4124 4 ปีที่แล้ว +5

    Thank you so much, really appreciate it! It’s a good inspiration for me to start thinking an application from the system level of view. Well done!

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thanks 😁

  • @NoOne-oy5vs
    @NoOne-oy5vs 2 ปีที่แล้ว

    Once I know that I am going to have a system design interview, this is the first place I know that I must come.
    Not to copy the answer, but to understand how you came up with the design, the process of thinking, the required knowledge that I might miss; what should be used because of what and so on.

  • @SudeeptaSood
    @SudeeptaSood 2 ปีที่แล้ว

    I have seen the video 15+ times and everytime I think I have to watch it again lol. Kudos to you!

  • @hit023
    @hit023 5 ปีที่แล้ว +43

    That was one really well-thought out video. Is it possible for you to talk about a few prevalent DBS technologies(NoSQL etc) and how they are used in System Design in a future video? Many of us CS undergrads have limited knowledge in DBS; only upto RDBMS. Cheers!

    • @gkcs
      @gkcs  5 ปีที่แล้ว +7

      I'll try and get that next 😋

  • @sindhusp8935
    @sindhusp8935 3 ปีที่แล้ว +30

    Great video :) One comment - To implement recommedations, we could build composite indices on the profile table which can index on, say, (age, location) in traditional RDBMS databases such as PostgreSQL. It's slightly misleading to say we can only have indices on single columns.

    • @gkcs
      @gkcs  3 ปีที่แล้ว +3

      Nice tip!

    • @suvajitchakrabarty
      @suvajitchakrabarty 2 ปีที่แล้ว +2

      Also you can have multiple single indices on a table (not referring to composite indices here), even though they wouldn't be very helpful in this case, but it is possible. Great video, nonetheless.

    • @shruthirakesh7827
      @shruthirakesh7827 2 ปีที่แล้ว +8

      Apart from DB indicies, recommendation system can use quad tree kind of in memory lookup that saves userids per location. So all users near by area would be in a single leaf node of the quad tree and can easily suggest people for matching.

  • @aldogutierrezalcala3047
    @aldogutierrezalcala3047 2 ปีที่แล้ว

    There is a huge difference in your channel, you really shows that you really love to teach and enjoy as well, good luck Gaurav, really love your channel.

  • @AbhishekGupta-zz2rv
    @AbhishekGupta-zz2rv 3 ปีที่แล้ว

    I come back to your videos very often to brush up my understanding. Just because you make the explanation so easy going.. #Respect

  • @alfazahmed
    @alfazahmed 3 ปีที่แล้ว +17

    "A lot of these might sound like jargon, so ... STUDY!"
    Perfect! xD

  • @yoshcode
    @yoshcode 3 ปีที่แล้ว +15

    Great video! One particular part that I think goes beyond what was mentioned in the video is the part about sharding the database based on geolocation of users. Let’s say we create one DB for each radius of 50 sq miles, the problem is that some people live on the edge of that 50 sq mile circle, so only a portion of that dB would be relevant for them. Also, certain 50 sq mile radius may have multitudes more people/usage than others. I myself am not sure on the ideal solution though, would love to hear people’s thoughts.

    • @NikhilTulseja
      @NikhilTulseja 2 ปีที่แล้ว +1

      In that case, shard further?

    • @dhruveshkhandelwal8104
      @dhruveshkhandelwal8104 2 ปีที่แล้ว

      at one point you have to make a merge query
      and based on use case you can come up with own method to divide data

  • @cristianouzumaki2455
    @cristianouzumaki2455 3 ปีที่แล้ว

    Gaurav you have the best resources on internet. So much learning in just one video. Your attention to what, why and pros and cons is simply awesome. I have learnt a lot from this channel.

  • @hamsddxn
    @hamsddxn 3 ปีที่แล้ว

    I'm system designer, but your channel helps me to grow up in domain, Great video

  • @siteshp
    @siteshp 5 ปีที่แล้ว +18

    Great one Gaurav.
    Keep it up. You are really helping out people like us who are beginners in this field but want to excel. Always remember people watch your videos, so keep posting amazing content.

    • @gkcs
      @gkcs  5 ปีที่แล้ว +3

      Thanks Sitesh!

  • @MilMike
    @MilMike 3 ปีที่แล้ว +19

    if a developer can't get matches on tinder, he creates own tinder. ;) - I just want to say thank you for your hard work. Very useful content. Keep up the good work.

    • @satyasanatan3677
      @satyasanatan3677 2 ปีที่แล้ว

      I am doing the same!

    • @bharathb4803
      @bharathb4803 2 ปีที่แล้ว +1

      He'd still be alone in the system 🙄😞

  • @hafizusamaali4380
    @hafizusamaali4380 4 ปีที่แล้ว

    This was very informative. It would be nice it you dig deeper into the recommendation service little more and tell it from the perspective of how it is actually implemented by various companies. Another video I'd to see would be on the authentication and security. This applies to pretty much all the mobile apps these days.

  • @zeewang
    @zeewang 3 ปีที่แล้ว +1

    I wish all teachers are gifted with teaching like you! (I appreciate all teachers but man this is so clear and good

  • @gauravnagpal28
    @gauravnagpal28 4 ปีที่แล้ว +8

    Hey Gaurav, great content! Really learning a lot from your videos. Had a question about sharding on location. How would you handle when a user opens the app in a new city or country? Would you have to find that user, delete their record, and move it to the new location's shard?

  • @suchismitagoswami5609
    @suchismitagoswami5609 2 ปีที่แล้ว +9

    Great content! Once the basic design of segregating responsibility into multiple services are done, Could you please also talk about how to meet non-functional requirements by introducing concepts in the same design, like
    - Finding out single point of failures
    - How to scale individual services and also the databases
    - Introducing load balancer
    - Caching if required, etc.

    • @nidhisinha9982
      @nidhisinha9982 2 ปีที่แล้ว +1

      Exactly even i was looking for something on performance, scalability, failures, and caching questions which I got in my interviews..please answer them too that will be really helpful.

  • @nizarkadri3109
    @nizarkadri3109 2 ปีที่แล้ว

    Man got me pumped up to build systems! Great work !!!

  • @narendrachouhan5691
    @narendrachouhan5691 5 ปีที่แล้ว +2

    please make more videos of this kind. this really helped me think about how to approach any design question. thanks..:)

  • @gauravmalik5560
    @gauravmalik5560 3 ปีที่แล้ว +3

    Hi Gaurav, thank you for putting up this video. Very helpful and clear. I am into my learning phase about system designs.
    I need to ask why we haven't covered topics around the availability of the app across different geographies, scalability, fault tolerance, and load balancers in detail here. Love to hear your thoughts on the same.

  • @ajaysaini6934
    @ajaysaini6934 5 ปีที่แล้ว +6

    Hey Gaurav, This is really a nice video. Can you make a video on system design of online judges like codechef, codeforces. I am really curious about it. Please focus on high code submission volume, if you make it.
    Thanks a lot!!

  • @ankitswarnkar4392
    @ankitswarnkar4392 4 ปีที่แล้ว

    You are so psyched about it and I love it! Great smile + Great video. :)

  • @Waruto
    @Waruto 4 ปีที่แล้ว

    These are very high quality contents. Thank you for your work :)

  • @nityanandagohain4154
    @nityanandagohain4154 5 ปีที่แล้ว +3

    This is really good, thanks for making this video. Waiting for more new content like this :)

    • @gkcs
      @gkcs  5 ปีที่แล้ว +1

      Thanks!

  • @sbylk99
    @sbylk99 5 ปีที่แล้ว +20

    Thank you so much Gaurva! this is very helpful to go through separated services such as profile, chat, matches and recommendation. And I am glad you mentioned p2p in chat. But how do those services interact with each other? How to handle dB fail. It's not very clear

    • @gkcs
      @gkcs  5 ปีที่แล้ว +6

      Hey David, thanks! I'll be taking some videos on master slave architectures and API construction.
      Till then, have a look at the videos of "Single point of failure" and "Consistent Hashing" for ideas 😁

  • @dhruvpatel1717
    @dhruvpatel1717 3 ปีที่แล้ว

    This videos are really good. It got recommendation randomly but need some content like this.

  • @Collins01
    @Collins01 2 ปีที่แล้ว

    You're a very smart man, I'm totally overwhelmed

  • @rohan_mayya
    @rohan_mayya 4 ปีที่แล้ว +3

    Great video, just a couple points I'd like to add:
    1. Your gateway does not need to hit the matcher service every single time before client 1 sends out a message to client 2
    2. Last I checked, Tinder uses an ELO system (popular games such as CS:GO do so as well), that influences the kind of profiles you see, based on how many people swiped left/right on you. So it's vital to store that information too.

    • @anshulgupta1159
      @anshulgupta1159 3 ปีที่แล้ว

      Is storing left/right swpie information is only useful for ELO system? If we don't store that information, how do we support matches? A right swiped B, and later, B right swipes A. At this point, how do we know it's a match?

  • @chintanthakkar8277
    @chintanthakkar8277 4 ปีที่แล้ว +15

    Hey Gaurav, amazing video. Just one suggestion that the , should be probably a NoSql db so as to store multiple connections as a list or a hashSet for each userId, since this would not be possible in a RDBS if userId is a primary key. Similarly for Matcher service where each userId can have many matches to track. So something like HashMap of Lists/Sets would be better I guess.
    Secondly, could you please explain a bit about how to decide when to make a new service and when to continue using same service? The service partitioning is not intuitive to me yet. Thanks

    • @anshulgupta252
      @anshulgupta252 11 หลายเดือนก่อน

      You can use RDMS as well by keeping user id as an index rather than a primary key

    • @adityajha9110
      @adityajha9110 3 หลายเดือนก่อน

      yeah since connections are unique, connectionId can be a primary key and user id would act as a foreign key.@@anshulgupta252

  • @kevonboxill9455
    @kevonboxill9455 4 ปีที่แล้ว

    I'm a 1 year old self thought dev i love every aspect of developing apps and websites.First time watching your vids. Your explanations are in-dept and helpful. This is also my 3rd or 2nd youtube comment ever and you are fully deserving of it! Will be a regular on your channel from now on! All the Best and Happy New Year Everyone!

    • @gkcs
      @gkcs  4 ปีที่แล้ว +1

      Thanks Kevon! Happy new year!

  • @mauvezebra
    @mauvezebra 2 ปีที่แล้ว

    Hi Gaurav. I understand many new concepts from your videos. You explained them so well. Now I got the job I was trying to get. Thank you so much!

  • @ArpiShah1911
    @ArpiShah1911 5 ปีที่แล้ว +8

    Great video. Learned a lot :)
    Can you please explain these topics separately:
    1. p2p | web sockets and protocols | client server - when to use what?
    2. managing sessions - possible solutions
    3. design system that involves real time location tracking like maps or uber?

    • @gkcs
      @gkcs  5 ปีที่แล้ว +1

      Interesting use cases Arpi! I'll try to get to them sometime 😁

    • @ArpiShah1911
      @ArpiShah1911 5 ปีที่แล้ว

      @@gkcs thank you very much! Looking forward to it! :-D

    • @himadri_nath
      @himadri_nath 5 ปีที่แล้ว

      @@ArpiShah1911 do u know about redis?

  • @windowcrystal4012
    @windowcrystal4012 4 ปีที่แล้ว +17

    Why did you smile when you were saying "matches" :) ?

  • @ameetmonty
    @ameetmonty 4 ปีที่แล้ว

    Apart from the great stuff, I like how candid your videos are. White boarding it all live and not using presentation with animation is also what keeps it close to the real experience of an interview.

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thanks!

  • @kennethcarvalho3684
    @kennethcarvalho3684 11 หลายเดือนก่อน

    Your positive energy is highly motivational and i am taking system design very seriously thanks to you!!

  • @TheDuhbin
    @TheDuhbin 5 ปีที่แล้ว +7

    You are f*cking awesome man! Thank you!

  • @AbhishekYadav1993
    @AbhishekYadav1993 5 ปีที่แล้ว +19

    At 5:09 , ("In Direct messaging what kind of questions you should ask"), I thought we about to get chatting/dating tips :P

    • @gkcs
      @gkcs  5 ปีที่แล้ว +2

      Hahaha!

  • @cloud4java
    @cloud4java 4 ปีที่แล้ว

    Wow! Such a great content man. Congrats on the amazing approach!

  • @shrihas3863
    @shrihas3863 4 ปีที่แล้ว +1

    Nice video. I didnt know anything about designing TINDER application, but after watching this video, I think its easy!

  • @nourkrichene1090
    @nourkrichene1090 4 ปีที่แล้ว +4

    Great work 😍
    System design of one of the real time online games like Call of Duty or Clash Royale please.

  • @UmangSardesai
    @UmangSardesai 5 ปีที่แล้ว +9

    Some additional insight as to why you would want to shard/partition by location:
    For example: Consider all users from Mumbai are stored on one shard. In this way:
    a) If you have to recommend users to someone from Mumbai, you are running your query only that shard. Hence, you are querying much lesser amount of users (Users all over India vs Users only in Mumbai). Less data to process = Faster query results.
    b) It will rarely happen that you have to "join" data from multiple shards. Users in Mumbai would only want recommendations from Mumbai.

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Great, those are additional points 😊

    • @swaroopvengali
      @swaroopvengali 7 หลายเดือนก่อน

      Recommendation of profiles is based on location(max 100miles radius). Tinder uses Elasticsearch that can have multiple data nodes -geoshard. If we can quantify the load of each geoshard (“load score”), the load score values for all the geoshards should be roughly the same.
      1st Solution (not efficient/used): Divide world map to ‘n’ shard squares. But near to ocean location, big cities, load will be different.
      2nd Solution: Balance geoshard using load score criteria - • Unique user count• Active user count• User’s queries count in an hour• Combination of the above. Formula used - “min(standard deviation(Loadscore1, LS2, …)”.
      Shard size is determining considerations - •Geoshard migration(users movement)•Querying multiple geoshards(so shards cannot be too small)•User density(based on city location). Tinder currently uses 40-100 shards based on calculations above. S2 Cell & Geosharding Algorithm - Hilbert curve.
      Reference : medium.com/tinder/geosharded-recommendations-part-1-sharding-approach-d5d54e0ec77a

  • @paridhijain7062
    @paridhijain7062 ปีที่แล้ว +1

    I have been following this playlist Daily like 2/3 videos per day. Loving the content. First System Design is Tinder, and felt interesting already. Thank you for this playlist.🙌🙌

    • @gkcs
      @gkcs  ปีที่แล้ว

      Fantastic!

  • @diegotrazzi
    @diegotrazzi 3 ปีที่แล้ว

    This is a fantastic video! and I like your positive attitude that transpires from the speaker talking

  • @darod6098
    @darod6098 5 ปีที่แล้ว +3

    Amazing video Gaurav, I am now suscribed. Maybe the best channel about System Design.
    I would love a system design video about TH-cam. It probably has a challenging system design and there are no videos in any channel about this, so can be an opportunity for you.
    Best wishes!

    • @gkcs
      @gkcs  5 ปีที่แล้ว +3

      Thanks! I'm looking into the video content server system design right now
      Will have a video out, hopefully soon 😁

    • @shoeturtle
      @shoeturtle 5 ปีที่แล้ว

      Look forward it it as well. Thanks !!@@gkcs

  • @kshitizsharma5469
    @kshitizsharma5469 3 ปีที่แล้ว +6

    "A lot of this might sound like a jargon to you. So?? Study."
    - Best Motivation Ever

    • @varuntheja
      @varuntheja 3 ปีที่แล้ว

      came down to look for this comment:D

  • @piyushj02
    @piyushj02 4 ปีที่แล้ว +1

    Every video force me to watch the next video, seems like found perfect thing for #QuarantineLife.

  • @JohannesSchmitz
    @JohannesSchmitz 4 ปีที่แล้ว +2

    Your select * nightmare face is priceless 😁

  • @user-oy4kf5wr8l
    @user-oy4kf5wr8l 4 ปีที่แล้ว +5

    Hi gaurav!!! I super super love this video, I think this might be the best starter into system design ( maybe u can change the title of this video, eg [for beginner] ) :) waiting for other amazing videos!

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thank you!

  • @simolajustice6555
    @simolajustice6555 4 ปีที่แล้ว +4

    I thought that I watch the video with 1.5 in speed !
    this is the first time I watch a video in youtube with 0.75 in speed

  • @karanverma2035
    @karanverma2035 4 ปีที่แล้ว

    Thanks alot for such important and interesting videos. You explain critical things in simple way. I also interviewed by you at uber but that time I didn't recognize and also not cracked the problem you asked. Thanks alot for system design videos. Keep posting on new things.

  • @malg5547
    @malg5547 4 ปีที่แล้ว

    Man you`re the boss. Thanks for all the effort you put on creating videos, your channel was a really good discovery and it helped me so much. Keep on it!

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      Thank you!

  • @AarshParashar
    @AarshParashar 4 ปีที่แล้ว +3

    I forgot to right swipe today. Thanks for reminding me. 😄

  • @purvadeshpande9358
    @purvadeshpande9358 5 ปีที่แล้ว +3

    Hi Gaurav, first of all thanks for making these awesome videos. Watching this, I got idea of how to think of designing a messaging system(like whatsapp or fb messenger) and recommendation system(like netflix). Great job. One question though. I watched your video on micro services and have read the links too. In this example if you see, the job of matcher is really not much, it just stores matched information of two users and checks. In this case, is there any point in making it a separate microservice than keeping it in profile service? Isn't it too small for a micro service?

    • @gkcs
      @gkcs  5 ปีที่แล้ว +3

      Thanks Purva! Good question 😋
      That's true in our case, but I'd rather keep it as a separate service for future expansion. The matching logic could quickly get involved with ML and product specific requirements.

  • @minishvaru2232
    @minishvaru2232 4 ปีที่แล้ว

    Awesome presentation. Able to learn so many things from this video. Great!

  • @fawazsullia5620
    @fawazsullia5620 2 ปีที่แล้ว

    This guy is amazing. Just found this channel today

  • @javiermendoza5173
    @javiermendoza5173 3 ปีที่แล้ว +4

    Thr youtube algorithm has lead me to your video

  • @johanneshaposannapitupulu7580
    @johanneshaposannapitupulu7580 4 ปีที่แล้ว +13

    Why I have to found this amazing channels AFTER I failed some of my system design interviews? I'm on watching frenzy on your videos now :)
    Anw, for the model of image in the DB, should it be better if only has imageId, imageUrl, and let the Profile service has profileId, then it has nullable preference on imageId? That way let the all the consumer of that service (image service) to put it on the consumers service

    • @uditsharma2536
      @uditsharma2536 4 ปีที่แล้ว

      I think it is fine. if we are putting profile Id in the image table so that can help in various use cases like when we are purging the data for the deleted profiles or we want to fetch the images by only given profileId then we don't have to make the two Database queries and each image is being uploaded by a single profile, not the multiple ones so it's better to keep the image along with the profile Id.
      Can you please share the high-level schema for the profile table or image table.

    • @susasabat
      @susasabat 3 ปีที่แล้ว

      actually, there would be 3 tables..1 profile table, 1 image table and 1 profile-image table that would have 0 or multiple rows per profile for the 1 to many relationship between profile and images,

  • @diliprathore2286
    @diliprathore2286 4 ปีที่แล้ว +1

    Hi Gaurav. Thanks for this amazing work. It's wonderful to see how you have gathered all this knowledge at such young age. Pls share your study materials with us ;P Btw, can you pls also make a video regarding backend data ingestion, data engineering, data visualization kind of frameworks on cloud. That would be really useful for lots of data analysts and engineers as well. Cheers!

  • @samboboev
    @samboboev 3 ปีที่แล้ว +1

    Thank you! That's a really useful video as a Product Manager I am learning a lot about how to correctly design the systems with my developers and other colleagues.

    • @gkcs
      @gkcs  3 ปีที่แล้ว +1

      Thank you!

  • @AnkitAgarwal01
    @AnkitAgarwal01 5 ปีที่แล้ว +3

    Hi Gaurav. Great video. How will the database shards get updated, if a user is navigating through different cities. userA belongs to cityA, has the user data stored in shardA. If he moves to cityB, his location has changed. Should the user data now move to shardB?
    Is it a good idea to keep updating user data across location based shards, as the location of the user keeps on changing?

    • @gkcs
      @gkcs  5 ปีที่แล้ว +2

      You can have a look at the geo sharding that Tinder does, they have a great blogpost on it. 😁

  • @ramamurthikumar3116
    @ramamurthikumar3116 5 ปีที่แล้ว +6

    Thanks for the video,
    I didn't understand the part that , (select * nightmare) @10.25, and you also say, select * is used often, can you plz elaborate a bit more ?

    • @MrAdy0207
      @MrAdy0207 2 ปีที่แล้ว +1

      Imagine you want to select the age of a certain user. If you store the image along with other info about the user and you execute by mistake select * from users where username = 'whatever' this would pull the image as well thus generating useless network traffic and consuming more memory than a simple select age from users where username = 'whatever'

  • @prakyathacharya303
    @prakyathacharya303 4 ปีที่แล้ว

    Thanks a ton Gaurav Sen for all these tutorial,I learnt a lot, wonderful and Great job.

  • @vimalsway1016
    @vimalsway1016 3 ปีที่แล้ว

    Thanks for explaining the concepts so easily.
    I left with two questions after watching the video. Hope you might be answering someday if you see this comment.
    1. How to store the users those have been liked by someone (right swipe and other like features e.g. Stars, super like etc) and the same with left swipe as well.
    2. How the system calculates the distance between the users by only using the location that is stored into the database. I mean what is stored into the database for the location and how it compare this value with other locations.
    Thanks in advance. Cheers!!

  • @ultrahot3559
    @ultrahot3559 4 ปีที่แล้ว +47

    18:53 the pain of not matching with other client in real life

  • @rezamonang
    @rezamonang 5 ปีที่แล้ว +4

    Hey gaurav, can you explain more about gateway service? Do you mean it like the rest api which client use?
    Nice video btw, keep it up! :D

    • @gkcs
      @gkcs  5 ปีที่แล้ว +3

      It could be exposing REST apis, yes. The gateway handles authentication and message conversion in our case.

  • @JerryJonesIndia
    @JerryJonesIndia 3 ปีที่แล้ว

    Appreciate the way you explain. Good job man! Keep it up and good luck!

  • @elias8294
    @elias8294 4 ปีที่แล้ว

    Dude this is amazing! Please keep posting system design! You earned a new subscriber.

    • @gkcs
      @gkcs  4 ปีที่แล้ว

      😁

  • @SatyanarayanaBolenedi
    @SatyanarayanaBolenedi 5 ปีที่แล้ว +4

    TCP...TCP.... Happy Happy :):)
    If you do match, things looking good now, thanks to XMPP!!

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Hahaha!

  • @isanayashiro4166
    @isanayashiro4166 3 ปีที่แล้ว +22

    You're like Tom Holland's Spiderman who became a software engineer.

  • @sumit532
    @sumit532 2 ปีที่แล้ว

    Here i get recommendation of the best channel, thankyou!!

  • @faraazkhan
    @faraazkhan 4 ปีที่แล้ว +2

    Hey nice explaination
    I know its been a year now you made that video I just found it , thank God .
    Just wanted to know ur views on how if we want to keep records of left and right swipe among matching profiles server-side rather than on clients . Just assuming as a requirement in some other designs .
    Btw gr8 job and thanks for the video .