System Design: Design a URL Shortener like TinyURL

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

  • @vadymk759
    @vadymk759 8 หลายเดือนก่อน +6

    one of those videos where you get most from viewing time - very concise, effective, no side bs, covers edge cases etc 💜

  • @SimonAtkinsWins
    @SimonAtkinsWins 10 หลายเดือนก่อน +62

    Excellent video, I think in system design I tend to think it's going to have many more moving parts but this shows that sometimes it's just client-server-DB on steroids.

    • @codetour
      @codetour  10 หลายเดือนก่อน +6

      Yeah it’s true, this is a relatively simple example, can get potentially way crazier when taking about other common system design questions like say, how would you build Uber, or how would you build Spotify, or something

  • @rachity100
    @rachity100 10 หลายเดือนก่อน +29

    Amazed by the simplicity with which you explained everything, I think I will never forget a url shortner design now

  • @gadgetvala
    @gadgetvala 10 หลายเดือนก่อน +5

    The starting part where he explained the calculations of storage and other stuff gave me a GOOSEBUMP, just imagine explaining the same flow when the interviewer asks you this!!

  • @MrLexGr
    @MrLexGr 10 หลายเดือนก่อน +5

    Solid, concise and the perfect warm up for every time I'm doing a last minute refresh before an interview.

  • @kevinmuhia5915
    @kevinmuhia5915 10 หลายเดือนก่อน +9

    What a coincidence, i am actually building a url shortener as a personal project and your video has provided me with more than enough information to build on what i already have. Great video.

    • @jonragnarsson
      @jonragnarsson 10 หลายเดือนก่อน

      Heh, if you get a short url domain, you are bound by law to create an url shortener app. I got the last single letter domain in my country, so of course I did exactly that. Not going to post the link here, don't know if my tiny server would handle the traffic

    • @phoneywheeze
      @phoneywheeze 10 หลายเดือนก่อน

      ​@@jonragnarssonwhat's a short url domain? also, does that mean x (twitter) should provide a url shortening service on the new domain as well?

  • @prathamgarg9548
    @prathamgarg9548 7 หลายเดือนก่อน +2

    15 mins of video and hours of value, great video Loved it👍
    Would love to see more videos like this on designing systems

  • @supax2
    @supax2 10 หลายเดือนก่อน +11

    10/10 explanations and visuals. We need more!

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

    Simple and just deep enough for non coder to understand. Awsome !

  • @aidenberzins
    @aidenberzins 10 หลายเดือนก่อน +1

    Love this content wish there was more system design videos like this on TH-cam. Thank you.

  • @AaronJOlson
    @AaronJOlson 10 หลายเดือนก่อน +4

    This is the best explanation of this I have seen. Thank you!

  • @andresroca9736
    @andresroca9736 9 หลายเดือนก่อน

    What a nice piece of knowledge and thought delivery 👏👏

  • @mrkostya008
    @mrkostya008 10 หลายเดือนก่อน +1

    I love the content that youtube has finally started droppijg in my recommended

  • @binhnguyen-bi8ig
    @binhnguyen-bi8ig 8 หลายเดือนก่อน

    Thank you so much for the quality content. Please make a series of system design! I feel so struggle and inefficient when designing complex system.

  • @erezh1716
    @erezh1716 10 หลายเดือนก่อน +5

    Great video! Got an interview next week which I was told I’m gonna be designing a system similar to the one in the video, this helped me a lot.

    • @codetour
      @codetour  10 หลายเดือนก่อน +2

      Awesome! Appreciate you watching

  • @ShivamKumar-bt9nn
    @ShivamKumar-bt9nn 8 หลายเดือนก่อน

    Simple and yet scalable design compare to others. Thanks a lot...

  • @BlaBlaBlaInDaHouse
    @BlaBlaBlaInDaHouse 9 หลายเดือนก่อน

    Very nice breakdown, reveals a lot of useful information.

  • @winzkk8745
    @winzkk8745 9 หลายเดือนก่อน

    Just one word - Perfect. Something I was looking for! Thanks

  • @mohamedtag7920
    @mohamedtag7920 9 หลายเดือนก่อน

    Love the look into the details

  • @CarlosGomez-iq7pw
    @CarlosGomez-iq7pw 10 หลายเดือนก่อน +1

    Great video and easy to follow explanation! Looking forward to more

  • @ajml_hnter
    @ajml_hnter 9 หลายเดือนก่อน

    Do more system design videos. Absolutely loved it 👍

  • @sleepydogo
    @sleepydogo 10 หลายเดือนก่อน +2

    I love this kind of videos covering the theoretical part of programming! Great information on system architecture😁

  • @jl1835
    @jl1835 9 หลายเดือนก่อน

    Love the way you explain things in a smiple way! Would love to see more system design viddoes from you!

    • @codetour
      @codetour  9 หลายเดือนก่อน

      thanks! just published a new one

    • @jl1835
      @jl1835 9 หลายเดือนก่อน

      @@codetour YESSSSIR! Can't wait to watch it tonight when I get home!

  • @paulybarros
    @paulybarros 10 หลายเดือนก่อน +1

    Glad the algo picked up your video your channel is really good

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

    Hands down top 2 system design vid on TinyURL on this site.

  • @LucasAlves1
    @LucasAlves1 9 หลายเดือนก่อน

    Really amazing content. Keep it up!

  • @anotherme4638
    @anotherme4638 10 หลายเดือนก่อน +1

    Great video, It is simple, informative and ease to understand
    Thanks a lot

  • @dailyearningscalls357
    @dailyearningscalls357 10 หลายเดือนก่อน +2

    Saw this video, watched the rest of your videos, learned a bunch, and came back to say thanks.
    I really liked the system design videos. Seems like the algorithm liked it too. Keep up the good work and see you in the next one.

  • @aryog7192
    @aryog7192 10 หลายเดือนก่อน +1

    Loved your explanation. Looking forward for more videos.

  • @irshitmukherjee7943
    @irshitmukherjee7943 10 หลายเดือนก่อน +1

    Great explaination...............best one so faaaaaaar

  • @netprepare
    @netprepare 10 หลายเดือนก่อน +1

    Love It, simple and informative

  • @BhideSvelte
    @BhideSvelte 10 หลายเดือนก่อน +1

    i m just loving it

  • @dhruvsolanki4473
    @dhruvsolanki4473 9 หลายเดือนก่อน +1

    Really good explanation.

  • @ExylonBotOfficial
    @ExylonBotOfficial 10 หลายเดือนก่อน

    I'm glad I discovered thia channel!

  • @malawad
    @malawad 10 หลายเดือนก่อน

    pleaaase more of this , the format is brilliant

  • @lxdzii
    @lxdzii 10 หลายเดือนก่อน +1

    Great tutorial🎉❤

  • @AjayCoding
    @AjayCoding 10 หลายเดือนก่อน +1

    Great video

  • @sreekarswarnapuri
    @sreekarswarnapuri 10 หลายเดือนก่อน +1

    Learnt a lot of concepts in this one. Thank you so much!!😅

  • @ReinventedWeb
    @ReinventedWeb 10 หลายเดือนก่อน

    Great video. Super informative.

    • @codetour
      @codetour  10 หลายเดือนก่อน +1

      Appreciate you!

  • @cocosloan3748
    @cocosloan3748 10 หลายเดือนก่อน +1

    Amazing.. Bravo 👍👍

  • @aliadel1723
    @aliadel1723 10 หลายเดือนก่อน

    Awesome .. keep going and do more videos about SD ♥

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

    Amazing simplicity bro, keep rocking

  • @TonySoprano-r4l
    @TonySoprano-r4l 10 หลายเดือนก่อน

    Thanks for the video

  • @raofulkarim2822
    @raofulkarim2822 9 หลายเดือนก่อน

    Very nice

  • @thedebapriyakar
    @thedebapriyakar 9 หลายเดือนก่อน

    crazy good explanation

  • @wicktorinox6942
    @wicktorinox6942 10 หลายเดือนก่อน

    great video, that demonstrate the importance of thinking a bit in advance, before start coding. Eventually we end up with a cache lookup system.
    I have some questions...
    1) Do you consider validating the URLs? Is there a limitation? What if someone would basically start to use this as a free cache store...
    2) Are these tiny URLs are public or do you need the access keys to get to the real one?
    3) I am wondering if you could possibly use a simple counter and hash that, instead of the whole URL. That would be faster and the hash would have a great distribution as well.
    4) If you have the same hash for the same URL, it would be hard to delete the entry later, since other client has the reference. However, that could be a "prime" feature

  • @LocdNCoded
    @LocdNCoded 10 หลายเดือนก่อน +5

    Great video. Principal Engineer here, learned a thing or two and you touched on just enough. I liked the stats, however depending on how popular this service is these things would change a bit. An idea for more content would be to break these up into something like a hobby project, medium size (whatever that means, and enterprise level (what you displayed here).
    Regardless loved it!

  • @semosemo3827
    @semosemo3827 10 หลายเดือนก่อน +1

    waiting new Systems designs ❤❤

  • @RohitAwate
    @RohitAwate 9 หลายเดือนก่อน

    Great video, you have a subscriber! Had a couple of questions about the shortening approaches:
    1. On the key-generation approach: What's the rationale behind pre-generating keys? Are you trying to avoid a uniqueness check at creation time? Would the UNIQUE index on an SQL table be too big/slow?
    2. On the hashing approach: Does the hash function guarantee equal distribution amongst the buckets? Not sure if picking the first letter out of the hash guarantees that. If not, perhaps re-hashing the hash with a function that guarantees a uniformly random output might do the trick. All this to say that skewed shards might be a big problem.

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

    When talking about choosing between RDS vs NoSQL, IMO I was a little uncertain when it mentioned strong (RDS) vs eventual consistency (NoSQL). To RDS with a single instance, it might be confident to state that it can align with strong consistency, but when comes with replication nodes, RDS may also not guarantee consistency

  • @sandreke99
    @sandreke99 10 หลายเดือนก่อน +1

    Very useful! 🙌👨‍💻

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

    I think you should have expanded on how to compute that tinyurl. Its more relevant than explaining the lru which was very superficial

  • @amandeepsingh9935
    @amandeepsingh9935 6 หลายเดือนก่อน

    Thank you

  • @PUNEETRAIPURIA
    @PUNEETRAIPURIA 10 หลายเดือนก่อน

    subscribed👍

  • @maneeshguptanalluru7807
    @maneeshguptanalluru7807 4 หลายเดือนก่อน

    @Codetour very clear explaination. Could you share which tool you are using for drawing?

  • @abhishekwadhawan5381
    @abhishekwadhawan5381 10 หลายเดือนก่อน +2

    Great video. Couple of questions-
    1. You said there shouldn't be more than 1 short urls for a single long url. So do you check in the database if a long url already has a short url or does the "hash" function takes care of it?
    2. Do you just return the same short url for a different person if he has requested for long url already created by a previous person? If yes then why do you store the userId in the table

    • @codetour
      @codetour  10 หลายเดือนก่อน +1

      yes! great questions. 1. In theory the hashing technique (or the random keygen + dedicated db technique) should always create unique hashes so there should be no collisions. But it's cheap to just double check the DB and make sure no shortURL already exists so there are no duplicates/collisions. So we can just go ahead and do that as well.
      2. That's a great point, I honestly hadn't really considered. I think for user experience you would want to give person 2 a fresh unique tinyURL (especially if they are requesting a custom tiny url). So there would be 2 different entries in the database where the keys are different tiny hashes, but the values both include the same long URL. so to your point, yeah the userID might not be necessary

    • @abhishekwadhawan5381
      @abhishekwadhawan5381 10 หลายเดือนก่อน

      @@codetour Thanks for the reply. Looking forward to more videos on system design questions. Cheers 🍻

  • @renato.rodrigues
    @renato.rodrigues หลายเดือนก่อน

    Hi there, I really loved the way you explain, excellent video!
    Do you mind to share the tools you used to record this video and create this presentation?

  • @abhilashkumar4753
    @abhilashkumar4753 10 หลายเดือนก่อน +1

    👌👌

  • @dekooks1543
    @dekooks1543 10 หลายเดือนก่อน

    Great presentation ! One question though, how would you determine in advance which links are considered "hot" ?

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

    The estimation of cache size would be good enough? I think we should estimate cache size based on shorten urls that are more getting heated then others url. So, If it's only 20% of shorten urls that are created with in a month, we can roughly expect that it would be ((500 bytes * 100 mil) / 100) * 20 = around 9 GB.

  • @yaserahmed9721
    @yaserahmed9721 10 หลายเดือนก่อน

    Food for thought: What if we did not want the tiny url to be stored forever? Say we want it to be available for a short span of say 2 hours? What's the approach?

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

    Hi
    In article with base64 conversion there is a problem to address.
    We have a counter that is shared across servers, so that counter is critical section and race condition might arrive as diff servers can read same value and generate same short-url.
    We must ensure mutual exclucion in that case.
    Correct me if i am wrong :)

  • @thedelanyo
    @thedelanyo 4 หลายเดือนก่อน

    Subscribed 😅😅

  • @kaartiknayak4666
    @kaartiknayak4666 10 หลายเดือนก่อน +1

    what's the name of the whiteboard
    seems pretty cool

    • @codetour
      @codetour  10 หลายเดือนก่อน

      Photoshop

  • @DmitryVasilyev-um7ox
    @DmitryVasilyev-um7ox 3 หลายเดือนก่อน

    Thanks for the great video! It covers many important points. However, I think the SQL vs. NoSQL explanation isn't entirely accurate. Eventual consistency isn't exclusive to NoSQL databases; both relational (SQL) and NoSQL databases can typically be configured to replicate writes either synchronously or asynchronously. The ACID properties relate to transaction management and do not address data consistency across database replicas. Word "Consistency" in case of ACID means "DB ensures that a transaction can only bring the database from one consistent state to another, preserving database invariants like key uniqueness etc"

  • @jlee-mp4
    @jlee-mp4 8 หลายเดือนก่อน

    where does the 70GB cache storage come from? Given 60TB total storage, wouldn't 20% of 60TB be around 12 TB?

  • @enamya8188
    @enamya8188 10 หลายเดือนก่อน +1

    in 5:07, I don't think that the API key should be needed for the redirection endpoint

  • @chrissalgaj4111
    @chrissalgaj4111 10 หลายเดือนก่อน +1

    Crazy to think how much there is to even a simple seeming thing and then you realize there is still so much missing like authentication, authorization, payment handling, plans, email confirmations, internationalization of the website, possibly rate limiting for non paying customers…

  • @mutahhirkhan
    @mutahhirkhan 10 หลายเดือนก่อน

    Super mindful video, you better not get lost in any section of the video or you'll end up like, is this gibberish? 😂
    Awesome explanation 🎉

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

    "slightly inspired" by Sandeep's article 🤔

  • @whoknows3679
    @whoknows3679 10 หลายเดือนก่อน +2

    I think a more realistic solution would use cloud providers and their services which for this case is even more simple with some KV storage and serverless functions

  • @dmc8074
    @dmc8074 10 หลายเดือนก่อน

    Is there any reason for the assumption of 200:1 read: create ratio? If, then please explain.

    • @Daniel-sy3wo
      @Daniel-sy3wo 10 หลายเดือนก่อน

      No particular reason for those specific numbers. This is a napkin calculation so the idea is to say “here we’ll get way more reads than writes”. for this exercise it wouldn’t make much difference if the ratio was 400:1 or 1000:50 etc.

  • @learnwithabdulbari
    @learnwithabdulbari 10 หลายเดือนก่อน +1

    So, you just make up those numbers and define your own requirements and through a bunch of servers to do these things.
    I don't understand why people take system design interview. that's just seem to me common sense to load balance your requirements. Any software dev should know them.

  • @chessmaster856
    @chessmaster856 9 หลายเดือนก่อน

    Oh rdbms? You must be dinausaur or reptile

  • @arturf209
    @arturf209 10 หลายเดือนก่อน

    How exactly will I earn money with that scale? 😮
    Service should also provide some statistics, so users know if they draw any traffic and when. Add these to your calculations - data + load
    You said 100 years - where is expiry date? How often do you check when to delete?
    100 years idea is just stupid overkill, stretching whole budget, give few years or check traffic to each link and if something seems not used then delete it.

  • @hans_1337
    @hans_1337 9 หลายเดือนก่อน +1

    can people really do all this math in their head that quick?

  • @blizzy78
    @blizzy78 10 หลายเดือนก่อน +1

    what's with the holding your mic trend 😂

    • @codetour
      @codetour  10 หลายเดือนก่อน

      Using a microphone improves the quality of your audio much more than for example just recording straight into your phone/camera

    • @blizzy78
      @blizzy78 10 หลายเดือนก่อน

      @@codetour That's not what I meant. I get the point of using a good mic. But why not just put it on your shirt instead of holding it in your hand 😉

    • @codetour
      @codetour  10 หลายเดือนก่อน

      the sound quality is actually slightly better when the mic head doesn't rub against fabric@@blizzy78

  • @lonnybulldozer8426
    @lonnybulldozer8426 10 หลายเดือนก่อน +3

    You're a surface-level scammer.

    • @codetour
      @codetour  10 หลายเดือนก่อน

      Tell me more

    • @lonnybulldozer8426
      @lonnybulldozer8426 10 หลายเดือนก่อน +1

      @@codetour I'll be honest with you. I've been shadowed-banned many times, so I just assume all of the comments I post will never be seen.

  • @chessmaster856
    @chessmaster856 9 หลายเดือนก่อน

    First shorten it. You are talking something else.😅

    • @codetour
      @codetour  9 หลายเดือนก่อน

      Intuitively you are correct my friend but if you ever go Into an interview it’s important to clarify why, and how, you are shortening it first. Always the first thing you should do is ask clarifying questions