Тёмный

URL shortener system design | tinyurl system design | bitly system design 

Tech Dummies Narendra L
Подписаться 157 тыс.
Просмотров 449 тыс.
50% 1

System design for URL Shortener or bitly or tinyurl app.

Опубликовано:

 

30 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 953   
@hnasr
@hnasr 5 лет назад
Big respect for your knowledge and how you unselfishly share this. There is no one on RU-vid that does this in such details. Keep doing what you are doing man.
@ujjwalbansal1070
@ujjwalbansal1070 3 года назад
Ya, true man, @gauravSen, and this guy are providing this valuable information. If you know anyone like these guys on youtube reply back
@karimkhan9713
@karimkhan9713 3 года назад
Hussein my man you also share you knowledge Love you
@savithak.6516
@savithak.6516 3 года назад
Nice work... any thoughts on this review ? medium.com/double-pointer/review-of-grokking-the-system-design-course-c8613c28f3a1
@TaherAhmed16
@TaherAhmed16 3 года назад
@@ujjwalbansal1070 Check out Hussein Nasser's videos, they are very informative and fun to watch.
@Taming0fTheShru
@Taming0fTheShru 3 года назад
Oh my god!! Life has come full circle for me. Finding a Hussein Nasser comment on Narendra L's video. You two are my idols!!
@conorlieu4635
@conorlieu4635 4 года назад
For anyone wondering, apparently a "lakh" or "lac" as he was saying at 29:57 "is a unit in the Indian numbering system equal to one hundred thousand" - Wikipedia
@eeyore345
@eeyore345 3 года назад
Thank you! I was scratching my head about what that means... :)
@nagu890000
@nagu890000 3 года назад
Yeah, indian numbering doesnt go up in terms of 3 digits like (thousand, million, billion, etc..) It goes up in 3, 2, 2, ... eg . 1,000 -> Thousand 1,00,000 -> Lakh 1,00,00,000 -> crore ...
@0anant0
@0anant0 3 года назад
@ 20:10, he represents 1 million as 10,00,000 as 10 lakhs (see position of commas)
@snader128
@snader128 2 года назад
You should either stick to the metric system or use a global system that doesn't rely on localized counting systems. This would be a red flag for me.
@selamicoban6340
@selamicoban6340 2 года назад
Thanks a lot . I enabled subtitles, but no luck ☺️.
@ragingpahadi
@ragingpahadi 3 года назад
This was more clear than Ganga water in Gangotri : ] Thanks again for awesome explanation!
@AmarjeetAnandsingh
@AmarjeetAnandsingh 3 года назад
😂
@gleventhal
@gleventhal 5 лет назад
You have the best Systems Design videos on youtube as far as I've seen. Well done! Subscribed.
@mannion1985
@mannion1985 4 года назад
An additional strategy: have one or more background worker processes generating the base 62 random strings, checking they don't collide and adding them to a stack, creating a buffer of safe random values the app servers can just pop and use. Fantastic video, thank you.
@youngcitybandit
@youngcitybandit 4 года назад
Whoa im completely new to soft dev at this level but that seems like a really good idea to me. If someone disagrees please lmk why
@dElectroBuddha
@dElectroBuddha 2 года назад
This is basically the same as using the zookeper pregenerated 'ranges of keys' presented in the video.
@petar55555
@petar55555 2 года назад
Great video, maybe you can start with the API calls, Functional and Non Functional req to make it clear where are you going which will help you define your writes and reads and you could split the app servers to optimize your design. Also, I would like to know more about your approach on the reassigning or cleaning of ranges as those could go fast if you have such a limited number of characters for the short URL and reusability would be a factor as your number will be used completely within the first two years according to the analysis you had.
@sitanshushrestha2629
@sitanshushrestha2629 2 года назад
This is way more comprehensive than any other video or article. Even the article in educative doesn’t guarantees collision avoidance. THANKS A LOT.
@happyfreeky
@happyfreeky 3 года назад
Excellent tutorial, great presentation. Your confidence and knowledge of the material goes a long way to making this a very informative lesson.
@devendrawangikar2890
@devendrawangikar2890 4 года назад
THE BEST SYSTEM DESIGN VIDEO SERIES. I've seen other channels, I must say they are nowhere in the competition, because all they do is talk, and but You are doing fantastic work - You have your own study, references, alternative solutions to every system design problem and the way you deliver is fabulous. Simply loving this series. Thank you for everything - Keep up the best work !
@TechDummiesNarendraL
@TechDummiesNarendraL 4 года назад
Thanks a lot :)
@piyushgupta7582
@piyushgupta7582 3 года назад
Very well explained with all pros and cons way of implementations and finally landed with a robust and scalable solution. URL shortener looks simple but very hard and I rarely found anyone else reaches close to your solution and way of explanation. just advice will be better if you explained with UML and ER diagram representations as well.
@SundaramANI
@SundaramANI 2 года назад
Simply amazing! The level of detail is beyond incredible! Your passion for both technology and teaching comes through so clearly in your videos.
@saikishorer
@saikishorer 4 года назад
Great job Narendra. The way you explained is "very clear ,easy to understand and provided in-depth in short time". Thanks a lot.
@whatdoyouwant1234
@whatdoyouwant1234 4 года назад
you rock! a pleasure to watch!
@cowscanclimbtoo
@cowscanclimbtoo 4 года назад
The student teacher relationship analogy was pretty clutch. Thank you!
@aniwigiastuti4323
@aniwigiastuti4323 3 года назад
oh oh 🙏
@kumarabhishek7877
@kumarabhishek7877 2 года назад
The way you explains it seems like I can go back to my workstation and do it now. Hats off to your explanation.
@himanshusingh-yq3wi
@himanshusingh-yq3wi 2 года назад
Excellent... from then i opened account 12 years ago.. i had not commented this world.. hats off bro to the capacity of sharing knowledge... only a few are there.. you are one among
@junhuagu3812
@junhuagu3812 4 года назад
I passed the interview with similar approach two years ago :)
@marinoduran8077
@marinoduran8077 3 года назад
Great video! Some helpful feedback so that viewers also know this. Your base62 function has a typo. Instead of doing the regular division of deci and 62 ( deci /= 62 ), it needs to be an integer division so that you are not infinitely dividing because you will continue to output a value as you approach zero. The function will not exit until you are so close to zero that python will basically consider it zero and exit the while loop. So it should read deci //= 62 instead. Thanks again, cheers.
@jimhiggins5027
@jimhiggins5027 2 года назад
The single slash means integer division in a lot of languages.
@nskeip
@nskeip Год назад
it's actually not a typo, because it's in Python 2 (see the print operator below) :)
@ganzee6928
@ganzee6928 2 года назад
Excellent video Narendra. Well structured, easy to understand, breaking down complex concepts in a crystal clear manner - superb!
@ChitrankDixit
@ChitrankDixit 5 лет назад
This is a very nice explanation to the question that is frequently asked in interviews. cheers.
@sukanyasukku8459
@sukanyasukku8459 5 лет назад
thank you, preparing for my aws system design interview :)
@dayvince3117
@dayvince3117 2 года назад
Did you get the offer?
@sondn87
@sondn87 5 лет назад
Thanks for your work! One thing I noticed is that if you use the counter method, it may generate multiple new 7-character strings for the same long URL. A malicious client may keep sending requests for the same long URL and the system may run out of keys.
@MegaKorth
@MegaKorth 5 лет назад
@Abhishek ChandelRate limiting can stop user for certain period of time only.
@chitaranjansatapathy6788
@chitaranjansatapathy6788 5 лет назад
Simply Great!!! The way you explain, its fabulous.
@tianchengxie1365
@tianchengxie1365 2 года назад
Software Engineer in Google, I barely write any comments, but you really did good job by making those impressive videos. Really appreciate your work, inspired me a lot and I learned tons of knowledge from those.
@kingroger007
@kingroger007 5 лет назад
Thanks for the excellent video. learned a lot. A follow up question : if we set expiration date for short URL, how can we collect or recycle the numbers used for those expired short URLs? Thanks.
@jain007neeraj
@jain007neeraj 4 года назад
So there are a couple of approaches as explained in Grokking the System Design interview and I am quoting them here : "If we chose to actively search for expired links to remove them, it would put a lot of pressure on our database. Instead, we can slowly remove expired links and do a lazy cleanup. Our service will make sure that only expired links will be deleted, although some expired links can live longer but will never be returned to users. Whenever a user tries to access an expired link, we can delete the link and return an error to the user. A separate Cleanup service can run periodically to remove expired links from our storage and cache. This service should be very lightweight and can be scheduled to run only when the user traffic is expected to be low. We can have a default expiration time for each link (e.g., two years). After removing an expired link, we can put the key back in the key-DB to be reused. Should we remove links that haven’t been visited in some length of time, say six months? This could be tricky. Since storage is getting cheap, we can decide to keep links forever."
@sombudhya
@sombudhya 3 года назад
Hi, If I reuse one of the expired link again then is it possible that a customer tries to access a very old URL and gets redirected to a wrong URL ( recently used post clean up) . This might cause an issue if , a system needs to provide short URLs and keep the mapping for 10 years . Any solution for this?
@abdullahahmed7781
@abdullahahmed7781 2 года назад
@@sombudhya That is genuinley good question and to be honest I think you may be right... according to this design I cant see imagine thaa a mapping will guarantee no repetiion of url "keys". But if you look at it pragmatically, to run out of 62^7 addresses your service needs to have to go through 3.5 TRILLION Writes which is alot 😂 but.... a busy service *could* use that up very quick..... a simple solution to that problem could be to transition to 8 character spaces on top of precious 7 character, that is over 22 TRILLION URLS! and Im pretty sure for any system to loop back from that counter, so much time would have passed that the distributor of old links would have realised themselves....
@rustamhussain4139
@rustamhussain4139 4 года назад
@Tech Dummies How will it insure that tiny url length is 7 char? Since we are pasing an integer and what if we passed big integer and that return more than 7 char from base62 method.
@devpriya4693
@devpriya4693 3 года назад
I think this can be controlled in the code of generating the unique code. generateUniqueCode(deci) { const a = [0...9a...zA...Z]; while(deci>0 && len
@prat534
@prat534 4 года назад
Thank you so much for the detailed explanation. Don't need to refer any other sources once you go through this material.
@DariusAlixWilliams
@DariusAlixWilliams 2 года назад
I am new to system design and find your explanations clear, thorough and insightful. Thanks!
@kckalavacharla
@kckalavacharla 3 года назад
One quick question. I did write the implementation of base62 encoder and converted a simple text to Base62. The number of characters in the output is proportional to the length of the input. As the input increases, the encoded string length increases. In that case, how can u control the code to generate only 7 or 8 characters? taking the first 7 chars might not be a good idea. What is the solution?
@RandomShowerThoughts
@RandomShowerThoughts Год назад
good question, I think the cut off might be the only solution, or we have to randomize until we reach 6 characters
@gauravsaraf38
@gauravsaraf38 3 года назад
Thanks for this video. I really liked how in-depth you went in this one. I know it’s been a while since you created this video, but I would like to ask couple of questions: 1) We could just use the counter as the unique id for the short URL. This has the drawback of not generating enough combinations as each character only supports 9 combinations. 2) To solve the above problem, we are using Base62 encoding on the counter, which will always be unique because the counter will be unique. The question is how do you limit the encoded string to only 7-characters when the counter reaches a certain limit such that the encoding produces more than 7 characters.
@metaversity3586
@metaversity3586 2 года назад
Like you said we will use base 62 on the counter. Because we're using base62 we will actually have 62 different combinations for each character. Because counting in base 62 would include all these characters [0-9 A-Z a-z]. instead of just [0-9] 2) If you go to the highest number in base 62 which would look like: zzzzzzz this will equal a little over 3.5 trillion. Which is an extremely high number of unique IDs and that would take a significant amount of time to reach. But, after reaching that number then I assume they would probably clear out old data that aren't being used anymore and restart the counter... but if for whatever reason they could not keep up then I think, and I could be wrong, the solution would be to increase from 7 character limit to an 8. Which would make the number of ID's insanely high, over 200 trillion.
@nicholaslorio2985
@nicholaslorio2985 2 года назад
@@metaversity3586 I think Sarafs 2nd question was more in line with how do we use the base 62 encoding to generate a 7 (or a different specific number) char encoding? Do we simply take the first 7 chars of the encoding we get by converting the long URL to base 62 using the auto incremented id? Wouldn't this result in the same potentially non-unique issue as the MD5 encoding approach? This is something I am confused about as well.
@abhaysoni8631
@abhaysoni8631 2 года назад
you are great narendra, you explain everything so clearly and easily
@hedonist_traveller
@hedonist_traveller 2 года назад
This is brilliant .. I have seen ppl leave out the distributed part in system design but you nailed it bud 👍
@mariakhan628
@mariakhan628 4 года назад
How are we making sure that base62 conversions gives a 7 length unique number
@CengizAkarsu
@CengizAkarsu 3 года назад
Thanks for this top-quality content and video. Is that Zookeeper has the potential of a single point of failure here?
@travellingsLenses
@travellingsLenses 2 года назад
Even i am thinking of same.
@neel3297
@neel3297 2 года назад
zookeeper can be configured as single server or in quorum mode with multiple servers
@abhishekgupta4360
@abhishekgupta4360 5 лет назад
You made it so simple to understand. Great work
@vm1662
@vm1662 4 года назад
Great video! Thanks for all the work you put in each of these video!
@grandstarchief3226
@grandstarchief3226 5 лет назад
I have been asked this question yesterday. Now I find the answer.
@ssssahil
@ssssahil 4 года назад
In btech level interview?
@grandstarchief3226
@grandstarchief3226 4 года назад
@@ssssahil yes....so it's very very easy, isn't it?
@FrequencyModulator
@FrequencyModulator 4 года назад
Amazing video! But had to use the captions to understand that the used word is "lakh" and means 100000 :))
@jessicest
@jessicest 3 года назад
ah, thank you! I was re-watching minutes trying to figure out what that was!
@user-oy4kf5wr8l
@user-oy4kf5wr8l 3 года назад
Thank you Naren!😌 amazing video as usual
@abc1993able
@abc1993able 4 года назад
For the first time, I don't quite understand, and I watched twice, and now I fully understand, nice explanation.
@pawel93pe
@pawel93pe 4 года назад
3:00 - isn't it enough to keep 7 characters for each shortened url? The base of the url is going to be the same for all shortened so at this scale it would be quite significant waste of space to repeat the same thinh so many times if I'm correct.
@dilipkumar2k6
@dilipkumar2k6 4 года назад
yaa, there are many flaws in the soln discussed. I shared a list of problems in my comment.
@yasserakbbach7342
@yasserakbbach7342 4 года назад
absolutely right we only need to store the unique generated string 👌
@shreysom2060
@shreysom2060 3 года назад
@@yasserakbbach7342 You can have the primary the table link value as primary and unique in that case it won't happen voila
@mohammadmiyan7205
@mohammadmiyan7205 3 года назад
Thanks for sharing such wonderful knowledge. I have a doubt here - Why cant we use timestamp number with prefix of server id and pass it to Base62 function to generate the short URL
@beyourbestwithdr.prithikac4770
@beyourbestwithdr.prithikac4770 3 года назад
When you perform Base62 on the Timestamp and prefix of server ID, the resulting string will contain more than 7 characters. Since the tinyURL cannot have more than 7 , you will forced to choose only first 7 or last 7 (as per your choice). This will create collisions.
@dhanyaravindranathan931
@dhanyaravindranathan931 5 лет назад
The best explanation on Bitly..Thanks much!
@chabhishyam
@chabhishyam 4 года назад
Amazing work bro. Keep uploading such kind of good content. Thanks a lot .
@wishniks
@wishniks 4 года назад
Nicely covered in a simple, lucid manner. Easy to understand. Thanks for the same. Just one thing. How will the last solution handle the repeated shortening of URLs? Meaning, if the same URL is given twice for shortening, although counter will generate a new short URL, guess the system won't check in DB if the shortened URL exists or not for the same long URL. This can lead to lot of duplication, I suppose.
@madeofhuman
@madeofhuman 3 года назад
From what I understand of URL shorteners, what you described is actually a desired feature, especially in order to provide accurate metrics for the user (eg. if two users shorten the same long URL and want to know which shortened URL had the most visits, each shortened URL must be unique, not the long URL).
@tushargoyaliit
@tushargoyaliit 2 года назад
@@madeofhuman thanks
@a1988ditya
@a1988ditya 5 лет назад
Can you do a video on Zookeeper architecture and applications? Thanks
@TechDummiesNarendraL
@TechDummiesNarendraL 5 лет назад
Sure, when time permits!! :)
@mohitdiwan22
@mohitdiwan22 4 года назад
@@TechDummiesNarendraL What happens when Zookeeper service goes down, doesn't that introduce a single point of failure or should we think of a backup?
@IC-kf4mz
@IC-kf4mz 3 года назад
@@mohitdiwan22 What happens when a server goes down? Same thing. Multiple copies.
@harishaseri
@harishaseri 4 года назад
Hi Naren , I really liked you videos . such a detailed and simple explanation for every system design video. Thanks for this selfless effort man
@hvp9111
@hvp9111 4 года назад
This is nice informative video. I had implemented Scheduler Server in past where zookeeper was in BETA on AWS cloudformation. Which worked pretty much but it is nice to use available services since it is such a pain to maintain separate code base.
@franciscoadan2921
@franciscoadan2921 3 года назад
Great video, thanks for the explanation. One question though. How do we make sure the short URL is always 7 chars long regardless the counter number (1 - 3.5 trillion)?
@biggbossfootage
@biggbossfootage 2 года назад
we can base64 encode the counter numbers and as explained in the video all the numbers between 0 to 62^7 can be encoded to create a string of length
@vyomrastogi7308
@vyomrastogi7308 3 года назад
For the counter approach at 18:48 you said that counter will give unique B62 value and we don't need to check in DB. I agree that counter will give unique B62 value, however we are only picking first 7 characters from encoded string, which might still result in collision. Is that right?
@user-jp5ck4xw2t
@user-jp5ck4xw2t Год назад
I was also wandering the same thing until I look again at the code and played with and I got the answer. Notice that the base62 code that he showed is oblivious to the origin url, it is only output the counter in base 62. In this approach we ignore the original url while generating the key and only map counter in base62 as key to the original url
@lostgoat
@lostgoat 11 месяцев назад
​@@user-jp5ck4xw2t Does that mean our Counter would need to start at a number high enough to generate 7 characters on its own since 1 for example = n which would not work in this case. Also what if the 7 digit prefix of 2 numbers is the same would this cause a collision?
@jewishbag
@jewishbag 4 года назад
Extremely high quality video. Great job and thanks for the information!
@rishabhjain2404
@rishabhjain2404 4 года назад
Good solution! I just want to add that if the application server goes down, the URL that was getting processed will be lost. To save us from that, we have to implement a temporary storage(with checkpointing) for a single app server or a distributed message queue for multiple app servers.
@adamhughes9938
@adamhughes9938 3 года назад
FWIW this exact question was asked of me at an amazon interview as well.
@gsb22
@gsb22 3 года назад
Did u get in?
@varunmadhavan3227
@varunmadhavan3227 2 года назад
Thanks a lot for this! A few interesting questions: 1. How are the counters/addresses recovered after a 5 year cycle or when all of the 3.5 Trillion hashes are exhausted? 2. Does the zookeeper come with redundancy assurances? Or is it a bottleneck for the entire service?
@vippan
@vippan 2 года назад
I believe we can remove the entries which are used or expired.
@fb_a
@fb_a 4 года назад
Wow...!This kind of explanation with such good analysis is really awesome!
@hemlataidnani9828
@hemlataidnani9828 2 года назад
Wow this is the best video new technology and you are making such neat and clear video thanx
@ABHISHEKRAI-td9pf
@ABHISHEKRAI-td9pf 4 года назад
The explanation is awesome. However, I have a query: if "A" generates "XX" as hash value (common first 7 chars) and "B" generates "XX" as hash value(common first 7 chars) then why can't counter value C1 -> generate "YY" (common first 7 chars) and C2 -> generate "YY" (common first 7 chars)? If yes, then there can't be a "No collision guarantee" + here insertion is done without checking presence in DB.
@andrewireland8426
@andrewireland8426 4 месяца назад
It's been 3 years and no reply... The counter solution does not use a hash. It's just a number represented in base 62 so there won't be a collision if the same counter values are not used
@candysnatcher6916
@candysnatcher6916 4 года назад
Hey I really like your content, loads of respect for you. I'd like to add to this that you can very easily use a combination of unique values and dropDups at schema level in mongoDB (NoSQL) to tackle the duplicate issue like this: new Schema({ shortID : { type : String , unique : true, required : true, dropDups: true } }); Unique alone is very powerful but in very rare cases it might not work if index is not refreshed, for those situation dropDups comes to the rescue. dropDups means that MongoDB will "drop" any queries which try to create a record with a schema value that already exists in the database. For ex: if you already have a record with name : bob and you try to insert another record with name : bob then this insertion will fail due to dropDups.
@KrishnaPatel-qu6nh
@KrishnaPatel-qu6nh Год назад
i like this information...thank you for sharing it
@dyms11
@dyms11 Год назад
Your video is so good, you have a natural gift for teaching others. I liked how you explained Zookeeper, like a class with teacher and students.
@digvijaysingh521
@digvijaysingh521 3 года назад
Your way of explanation is simply great. Since we are using counter to generate the hash key. For same long URL requests, you will store different hash keys which will unnecessary increase DB size.
@andrewpryshchepa6703
@andrewpryshchepa6703 5 лет назад
Is zookeeper become single point of failure in your solution ?
@TechDummiesNarendraL
@TechDummiesNarendraL 5 лет назад
Zookeper is distributed system. If one fails you will have one more node to take care.
@adamhughes9938
@adamhughes9938 4 года назад
Zookeepr is deployed as a cluster - typically you would have 3, 5, 7 or more zookeeper nodes managing many instances of an app (say 20-200 instances). Zookeeper knows how to synchronize itself so if app instance 5 went down, all zookeeper nodes will eventually (and rather quickly) know about it.
@anastasianaumko923
@anastasianaumko923 11 месяцев назад
@@TechDummiesNarendraL Thank you for the videos! Amazing job! One question - if we need to restart all Zookeeper nodes in the cluster, how Zookeeper would know the actual count of the counter ranges when it goes up? Do we need to store it somewhere?
@bdc225
@bdc225 2 года назад
Awesome video! Something that is still unclear that every 'Build TinyURL' video/article doesn't explain is an example of actually generating the url. So we agree that we use the distributed counter and then base62 encode it. However when you encode a somewhat large number (much less than 3.5 trillion), you get a string that is longer than 7 characters! Ex. 1234567 ==[Base62]=> MTIzNDU2Nw That number is not even 1.5 million and we're way over the 7 character limit. If we truncate that and only take the first 7 characters, then we have the exact same problem as truncating the MD5 hash: collisions! Any help would be appreciated thanks!
@amanand727
@amanand727 2 года назад
probably your conversion is incorrect, in my code b62(3000000000000) = QODkgKc which is in seven characters.
@AI6NET_link_shortener
@AI6NET_link_shortener 4 года назад
Great analysis of the system design of a URL Shortener, we hit several of the caveats here especially when building the defender application, however; our job is far from done.
@vm1662
@vm1662 4 года назад
You are amazing! Thank you so much for putting so much effort into these videos. I am loving the system design series right now! :)
@Atpugtihsrah
@Atpugtihsrah 5 лет назад
Just wanted to point out that the output of MD5 hash is 32characters long to be specific.
@andylinkOFFICIAL
@andylinkOFFICIAL 5 лет назад
at that point you can truncate the hash to 7 characters
@messerschnitt7943
@messerschnitt7943 4 года назад
It seems to me that you didn't solve anything by adding the Zookeeper... Then the Zookeeper becomes the single point of failure, right? I.e. what if the Zookeeper is down? Also, the counter will give a bit strange short URLs, in particular they will be successive. Which could perhaps even be a security issue in some circumstances (it will be possible to guess valid short URLs).
@nickitataranov7497
@nickitataranov7497 4 года назад
We can consider ZK as a single service, but it is not a single server. It will remain available as long as majority of the under the hood machines stay alive. I'm pretty agree with you about "non randomness" of the resulting urls is a problem. Because your service is pretty DDoS-friendly :). But you can made this approach better almost for free. Say, you were given the range [2^16, 2^24]. You can generate some random number M from [2^16, 2^24]. And let your counter currently having value C. Then you can use (C xor M) instead of just C. This makes your urls not so much consecutive (you should not forget about the case when C equal to M :) ) Obviously, you can use more sophisticated hash functions as long as they are injective.
@NiloGarciaSilveira
@NiloGarciaSilveira 2 года назад
Thank you very much!!! I had this question in my Interview and this vídeo was a great help!!!!
@harrishm5841
@harrishm5841 3 года назад
Well explained. Thanks for making these system design videos! These are dope af.
@SanketBarapatre
@SanketBarapatre 4 года назад
Hey Hi, Thank you for sharing your knowledge. Just one question, what if I use the same url to shorten it twice..it will generate 2 short urls..is that breaking a test case..or fine. I think we may need to keep a track of all the long urls also in a set so as to return same shorten url.
@saikishorer
@saikishorer 4 года назад
Same URl wont be converted to Short URL again. It returns the existing one from DB. If the URL doesn't exists in DB, Then it generates a new SHORT url.
@karthikmucheli7930
@karthikmucheli7930 4 года назад
@@saikishorer So does it have to check from database?
@SuhailKhan-lo4kd
@SuhailKhan-lo4kd 4 года назад
@@saikishorer But what if two user try to shoten the same url at the same time , then in that case there will be two entry of the same URL , how can we avoid that.
@kaushalgour
@kaushalgour 5 лет назад
Amazing explanation. Sir could you please add IRCTC System design.
@TechDummiesNarendraL
@TechDummiesNarendraL 5 лет назад
Sure, Some time
@banerjeesaikat6
@banerjeesaikat6 5 лет назад
IRCTC please
@aloksharma3246
@aloksharma3246 5 лет назад
@@TechDummiesNarendraL irctc on demand
@srinivaslingamgunta4056
@srinivaslingamgunta4056 6 месяцев назад
very clear and great explanation. I especially liked the MD5 hashing part, you clarified it very well for me. A big thank you.
@yasserakbbach7342
@yasserakbbach7342 4 года назад
WOW 'm amazed, thanks sir for appearing in my life 🙏
@neelabhsingh1986
@neelabhsingh1986 5 лет назад
Thanks for the URL shortener system design Tutorial. As you mentioned to avoid collision we can concatenate the counter value range [1 - the size of data type] if we consider counter as Integer then it will be 4 bytes, So it will increase the key size which is currently 7 characters long. Suppose if we append an increasing counter to each input URL. I think still it does not work because we are taking only 7 characters after converting from base64 or MD5. I didn't understand your point. Could you explain more it. Thanks
@studiousguy8138
@studiousguy8138 4 года назад
*Did he ask to concatenate? I think you can just store mapping of input long url to counter value in your DB that should be good enough and will guarantee zero collisions.*
@rishabhjain2404
@rishabhjain2404 4 года назад
@@studiousguy8138 but how will you map the hash in the URL with the counter. When the user uses the short URL, how would map it to the counter in the DB
@shreysom2060
@shreysom2060 3 года назад
@@rishabhjain2404 Hi! Rishabh it will not map to counter it will take it from database you can make the unique id as primary index and then while fetching it will be faster. SO when user click the shorten URL it will take the unique id fetch from database via primary index and as long url will be stored with short url you will get it.
@hoyiya
@hoyiya 3 года назад
@@shreysom2060 I think the question is, multiple integers can be mapped to the same hash using Base62. How to retrieve the long URL now if you only have the hash, as it may be mapped to multiple long URLs?
@shreysom2060
@shreysom2060 3 года назад
@@hoyiya i think he mentioned that every shortened url will be unique right,in that case it can act as primary index in rdbms and user can fetch it right? I will watch the video once again though
@keatmin
@keatmin 2 года назад
Thanks for the great tutorial, one qs I am wondering how to ensure we always generate 7 base62 characters with random integer/long as input. I tried with the lib I have, the number of characters is not quaranteed.
@DjVilez
@DjVilez 2 года назад
Im also wondering about this
@kentonWang0826
@kentonWang0826 2 года назад
how about taking it as a digit system with 62 characters, that meas we have abc....xyzABC...XYZ012...789 corresponding to 0...61, so an input 0 will have output aaaaaaa, and input 1 will be aaaaaab, so aaaaaba will be 62. For numbers from 0 ~ 62^7-1, we can have exactly 7 characters.
@jeantimex
@jeantimex 5 лет назад
Thank you so much! I have learned a lot!
@nickang6647
@nickang6647 2 года назад
In depth and clear explanation. Thanks Narendra!
@chopradimpy
@chopradimpy 3 года назад
WIh final solution, I understand that if 2 requests come with same long URL then there will be 2 different tinyUrls assigned to each request?
@SuAmigo12
@SuAmigo12 3 года назад
It is OK to have the scenario you described. You could have two different shortURL point to the same longURL, but not the other way around. In the example he provided, two different longURL (said longURLA and longURLB) resulted in the same shortURL (us.com/GA29x51). As a result, when shortURL (us.com/GA29x51) was referred and translated back to its corresponding longURL, redirection could go either longURLA or longURLB, which is not deterministic.
@IC-kf4mz
@IC-kf4mz 3 года назад
Yes. Does it matter to have different short URLs? Depends on the requirements.
@davudsafarli5356
@davudsafarli5356 3 года назад
There is one thing that bothers me is we solve problems by adding new technology (ZooKeeper in this example) and saying that it's highly available and never thinking about the case where the ZooKeeper fails :/
@MohammedDawoodAnsari
@MohammedDawoodAnsari 3 года назад
Correct! for that we need to design a system failover, and the same is also applicable on DB unavailability.
@RandomShowerThoughts
@RandomShowerThoughts Год назад
this is a legit gold mine in terms of information. Really informative and you get to understand the details
@UmangMundhara
@UmangMundhara 2 года назад
This was wayyyy tooo good. Fully detailed and amazing explaination. God bless you sir.
@nilanjanmhatre1960
@nilanjanmhatre1960 5 лет назад
hell lot of metrics. is it expected in an interview?
@Shogoeu
@Shogoeu 4 года назад
Yes, but once you start talking and they see you know your stuff, they will interrupt you.
@charan775
@charan775 4 года назад
Not for entry level positions. For positions like sde2 , sde3 these are the deciding factors
@NaveenMohan918
@NaveenMohan918 3 года назад
Great video! Really informative. Thanks a lot. I think there is still a missing component for invalidating the short url post expiration which was discussed during the core structure, but need to be discussed.
@mdnayab5839
@mdnayab5839 8 месяцев назад
Best explanation on internet, Thanks a lot 🙂
@anumonto
@anumonto 4 года назад
great explanation.. u gave all answers to questions which came to mind while watching the video.. superb!! looks like u were reading the mind
@vishwas13485
@vishwas13485 Год назад
Thanks a ton for making such kind of videos. It helps a lot to understand system design.
@Sevkai
@Sevkai 3 года назад
thank you - that was a great explanation! Imho, the only thing missing, worth mentioning is that app should have thundering herd protection - so e.g. if tweet gets viral we should avoid cache misses
@ankitagarwal4914
@ankitagarwal4914 4 года назад
It is very intutive and facinating to learn how these systems works behind the scene, i am watching this series as i if i am watching discovery channel.Thanks for sharing
@PritamKumar-jh4te
@PritamKumar-jh4te 3 года назад
Your explanation of system design is very succinct and easy to grasp. Thank You.
@MySWESpace
@MySWESpace 2 года назад
This was a really good video. I read the solution in a different resource but it wasn't as clear and concise as this. Thanks for sharing your knowledge.
@aditijalkote6356
@aditijalkote6356 3 года назад
Thank you very much for the video. You have explained all the pieces very nicely. You made it quite easy to understand the design.
@arthamsreenivas8858
@arthamsreenivas8858 4 года назад
thanks a ton Narendra, this looks a bit long video but it is very clear after watching the whole video.
@johnyepthomi892
@johnyepthomi892 Год назад
Hats off, very valuable content.
@MohamedSugal-ko4ut
@MohamedSugal-ko4ut 2 месяца назад
This was great. One more thing I would've added is database partitioning.
@rajugoud6465
@rajugoud6465 Месяц назад
Great Video and very good explaination Man........
@pawandeepchor89
@pawandeepchor89 5 лет назад
keep it up buddy, amazing work... cheers !
@vishalreddy
@vishalreddy 5 лет назад
You are doing great job ,keep up the good work!
@kumarc4853
@kumarc4853 2 года назад
one of the best videos for generating uniqueIDs, thank you
@RahulBhammarker
@RahulBhammarker 4 года назад
Subscribed and loved it
@BestURLShortenerBioPageQRCode
@BestURLShortenerBioPageQRCode 8 месяцев назад
Really really awesome video. Thank you for your great efforts!
@Atharva555
@Atharva555 3 года назад
Great video man! loved it! your way of teaching was phenomenal keep up the good work man
Далее
BRAWL STARS x DRAGONFORCE: A Draco Tale
03:46
Просмотров 9 млн
System Design: Design a URL Shortener like TinyURL
16:00
What is an API and how do you design it? 🗒️✅
15:26
What happens when you type a URL into your browser?
5:20
Do you know Distributed transactions?
31:10
Просмотров 225 тыс.
Whatsapp System design or software architecture
27:40
Просмотров 249 тыс.
How I Mastered System Design Interviews
10:22
Просмотров 75 тыс.
Amazon System Design Interview: Design Parking Garage
29:59