Worth watching the whole video to fully understand why you need consistent hashing in the first place.
@ShuKlaDeepti3 жыл бұрын
Thanks much. All tutorials just draw the ring and explain this concept that is hard to understand. First time I understood what consistent hashing is after watching this video!!!
@WaseemM25 жыл бұрын
One correction or clarification. The hash for two keys might not be the same for two different keys but the modulo value can be same, which is where bucket collisions occur. Though there are hash collisions they are extremely rare due to possible large values available but the mod of hash will find many collision and that's where the linked list in a bucket helps. Good video.
@sureshchandjain2504 Жыл бұрын
Nice catch !! that's what I was thinking too, whenever we talk about hashing we always keep a consideration that anyway hash function will return unique values for unique inputs. How hash function achieves that's a unique research topic in itself
@carlaludgate65974 жыл бұрын
Best explanation of consistent hashing I've seen. Thank you!
@aniliitb105 жыл бұрын
This doesn't give the complete picture (why/when). To get the complete picture, take a look at: www.toptal.com/big-data/consistent-hashing
@alexpadilla57413 жыл бұрын
Awesome video but it left unclear how it would remap data when a server gets added or removed. It still remaps, but not all data. And that’s the benefit. From above article: “So, how can this problem be solved? We need a distribution scheme that does not depend directly on the number of servers, so that, when adding or removing servers, the number of keys that need to be relocated is minimized.”
@YashSharma0605 Жыл бұрын
Nicely explained. I had seen the circular implementation of Hash Ring and was wondering how will it be implemented in the system. In theory we can have a ring but while implementing it we'll have the table like structure which confused me. This explanation was a great help to me. Thanks!!
@ersinerdem72853 жыл бұрын
Is there a load balancer out there which uses this? I cannot see any of them using it. They use only round robin etc.
@abhishek08aug4 жыл бұрын
I have a doubt on the failover part where you mentioned that if the last node is unavailable key-value will go get saved in the first node by following the cyclic order. If this is how it actually works, what happens when the last node comes back up and we make a query for the same key. Will there not be a situation that the system is trying to find this key in the last node but the key is actually saved in the first node?
@manikandansaravanan52485 жыл бұрын
how dose the rehasing happen when a new location added in the ring ?
@vishalchougule31233 жыл бұрын
In the given example, say a location is added that accepts values upto 11k, then the values in the range of say 10K-11K put in first location using ring ,will have to remapped to this location.
@mananshah34713 жыл бұрын
Excellent stuff! Coincidentally, the dog started barking exactly when called for it at 15:31 😂
@leo716484 жыл бұрын
Didn't understand the last part for 10115 no, greater key is not present and we go back and we put on first key but the rule was to find key which is greater than current hash key we got...... ???
@kchaitanya395 жыл бұрын
Doesn't 1011 location will be overwhelmed with values when a key does not fit in 9900 bucket?
@ironhide99554 жыл бұрын
i too was thinking about it. did you find an answer?
@mramit19244 жыл бұрын
Here you can find answer using virtual server kzbin.info/www/bejne/sJK1nIKEq956qJo
@aleshep4 жыл бұрын
What's the purpose of wearing a cap? Is this helps to explain hashing?
@reyou75 жыл бұрын
best explanation on KZbin, thanks man!
@TigraStyle3 жыл бұрын
+1 on that!
@DK-ox7ze4 жыл бұрын
What happens when you add another computer to the hash set? In your last example, if you add a computer with memory address 13000, it will be greater than 9000, so data will be stored there. So the data which was earlier going to the first node/computer, will now go to the last one. This will cause inconsistencies in retrieval, because data which was earlier stored in first computer will now be searched in the last one, causing old data to be never retrieved.
@ashishgandhi1686 Жыл бұрын
But that’s it. It’s just this one range, corresponding to the failed server node, that needed to be re-assigned, while the rest of the hashring and request-node assignments still remain unaffected. Contrast this with the classic hashing technique in which a change in size of the hash table effectively disturbs ALL of the mappings. Thanks to consistent hashing, only a portion (relative to the ring distribution factor) of the requests will be affected by a given ring change. (A ring change occurs due to an addition or removal of a node causing some of the request-node mappings to change.)
@preety2024 жыл бұрын
Buy a mic please
@_ipublic6 ай бұрын
9:40 Use hash to store key-values pairs, what if for N inputs we get same hashKey and appending N values by nodes. White retrieval time complexity would become linear O(N). How do we get values in constant time though? Any suggestion on that would be highly appreciated.
@shubhammehta3195 жыл бұрын
Nice Explanation, Thank you. I have one Question, What if one more server needs to be added in the hashtable. How we will assign the # function numbers. Like if we go for number 11k for e.g. we know that values for that could have been stored in the first row earlier. it Would make inconsistent as in getting that value will look for the 11k key but it was in the first raw not the last. please Explain that.
@anxiousengineer5 жыл бұрын
An obvious approach could be to transfer values from first row to the last row that satisfy this criteria. Consistent hashing isn't perfect I guess, you still have some processing to do if you add a row, but it's much less than with regular hashing.
@kisikatube4 жыл бұрын
In this case, you would move keys from 1011 to 11K location, any keys that are more than 9900. Note that in actual you would need to store the keys as well in order to relocate when a new server added. The advantage of consistent hashing is only one neighbor node need to looked at for relocating keys rather than whole data.
@ShubhamGupta-mx2hn3 жыл бұрын
Little lenghty video , even i opened it after watching 4-5 video but yes we needed the starting part to understand the consistent hasing , if u are a new person.
@PrateekMehtaABDFAN2 жыл бұрын
Thank you sir , huge fan of your videos . Superb content . Quick question:Complexity will be increased now with consistent hashing rt ? Earlier it was O(1) now it will be logn . Correct me sir If I am wrong ?
@thealgomasters2 жыл бұрын
I couldn't understand how consistent hashing is helping in here, as if we trying fetching the values for dog and cat, we will be looking to same bucket (3030).
@sharejero11216 жыл бұрын
Went through many vedios to understand this. But your explaination is very good and in laymen terms so any new person like me can also understand correctly. Thanks for posting this.
@davidespinosa19102 жыл бұрын
Consistent Hashing is a made-up story told by Akamai to get a patent. The ring that everyone draws is really an ordered map, invented around 1960.
@241praveen2 жыл бұрын
what will happen if the location is getting added back in hashtable once the node are up again in distributed env? e.g 10115 got stored in 1011 as there was no location more than it available in hashtable. but suppose 10300 got added in hashtable then what will happen? will it remap all key values?
@sanjuexplore3 жыл бұрын
"Random numbers" for consistent hashing? How do we arrive at these random numbers? And What if the server at the end is available but not the one in middle. I found this illustration incomplete. Could we get an amended one pls?
@gauravkathuria19203 жыл бұрын
Hey , What if while inserting a key, some locations were not available and due to hash ring it goes to next location (circular way) . What will happen when those locations comes back and i am looking for the key I inserted ( When those locations were down ).Will not it give me the wrong answer ?
@sergeykichuk25863 жыл бұрын
Actually is bad explanation in first standard implementation 2 different hashes can give you same bucket! And don’t understand the advantage of consistent hashing when you will try to retrieve data from the bucket that is gone
@prashanthtalla2 жыл бұрын
In case of consistent # ring, when a node is not available, how is the data retrieved? Also, when data is inserted, it will go to the next node. And when the non available node becomes available, how does the system knows where to find the data when queried? Wouldn't it look for the data in the now available node?
@saaqibz5 жыл бұрын
Your explanation is very clear and nice. Thank you! One point is I think I like the explanation of consistent hashing using a circle diagram better, but this is very useful too esp when you're thinking about implementing it.
@nreed77182 жыл бұрын
I found the table to be a nice, concrete way to explain how this would work in practice.
@himanshupanwar84085 жыл бұрын
Sir you should improve audio quality
@TechDummiesNarendraL5 жыл бұрын
Taken care in recent videos
@akhilsharma17783 жыл бұрын
In consistent hashing, you are only saving values not keys. Then how would we know what value corresponds to what key?
@rahulsaxena22732 жыл бұрын
At 12:01 when he is saying that we get wrong value. How we get wrong value because with equals key will not match so still it will return null. This same problem will occur in consistent hashing as well.
@travelbuddy40002 жыл бұрын
Hi, What happens when the node comes back on, how does the data stored on that node behave? Also, when the node comes back up, is that node added with the same random number, if it is a different random number how do we make sure the data is still consistent that was stored prior to node creation?
@tango4000164 жыл бұрын
Please strip out music. Becomes difficult to listen to especially if you are playing the video at a higher speed
@RitwikDas86904 жыл бұрын
Just talk normally, your attempt at this weird accent is ruining your presentation
@vedant91733 жыл бұрын
Brilliant explanation! So what happens if the node that was down comes back up? Will we have to remap the key that was moved to the first node? Or does it mean we would have to search all the nodes for a key?
@guidogranobles2 жыл бұрын
Good question
@ashwathhegde80504 жыл бұрын
i stopped watching right after 3 seconds because of the horrible echo
@frankhart20182 жыл бұрын
Love your videos, but what's with the fake accent?
@RitwikDas86904 жыл бұрын
Really bad presentation... Lots of mistakes too.
@AmolGautam9 ай бұрын
explained better than my college professor
@fact-wala15 күн бұрын
good explanation!! Thank you
@kristhiantiu43173 жыл бұрын
very very good explanation, thanks narendra
@atulnath14749 ай бұрын
So great video, would like to add one thing here: We have two challenges which we try to solve with consistent hashing: 1. Minimize data movement/rehashing when we add/remove servers. 2. Evenly distribute data across servers. Your video talks about the first problem and how to fix it. For the second one, we can use the concept of Virtual Servers, which allows each server to occupy multiple portions distributed throughout your hash ring. This helps with skewed data; for example, if you add a server in between 2 existing servers, then the load on other servers is technically more than this new server, and the server after this. Basically, data isn't evenly distributed amongst servers, hence skewed. Having the same server hashed in different locations over the hash ring helps solve this problem as well
@neelabhsingh19865 жыл бұрын
Hi Narendra, I have some confusion at 18:15, suppose Pair (Rat, Grt) whose hash# 9015 is mapped at bucket #9900. However, due to issue bucket, #9900 is down, If we do mapping again Pair (Rat, Grt), it will give the same hash# 9015, because bucket #9900 is down, it will be mapped to bucket #1011, which is the first bucket. So my question is what happens if bucket #9900 is online, now if we try to get Pair (Rat, Grt) whose hash# 9015 will try to locate on Bucket #9900, and finds that not available so return null, however, this Pair (Rat, Grt) is available on bucket #1011. So how this consistent mapping is helping on this. Waiting for your reply. Thank for your nice tutorial. Regards Neelabh Singh
@jaatharsh3 жыл бұрын
as mentioned when a Node goes does what happens to the data stored in it? & if during that node downtime data(ex-ABC) intended to be saved on the particular node(Ex-NodeX) is instead stored to the next Node(NodeA) in clock-wise direction what happens when another node takes dead node place? Now when ABC is searched it will check in NodeX but data for it was saved in NodeA.
@gauravanand69376 жыл бұрын
what is we want to retrieve the value from the unavailable node? how consistent hashing solves that issue?
@TechDummiesNarendraL6 жыл бұрын
@gaurav for example consistent hashing is used in Cassandra/load balancer/caching(CDN) like system. Where data is expected to be lost because of hardware failure. Hence you have to have data replicated in case of databases. But in case of caching, LB or CDN you don't need to as data will be populated back from the source.
@at_tap6 жыл бұрын
If data loss is accepted, why not in traditional hashing store the number with which you hash the data?
@kgurumurthybhat5 жыл бұрын
@@at_tap With Regular hashing, you are affecting all memory location due to one server failure, whereas with Consistent hash only those reside in that servers are affected !
@devashish8873 жыл бұрын
Thanks, man, Nicely explained. I got one question though If a system goes down or removed new value coming will be stored in the next range or cycle back to the first range, But what about if it comes back online which was failed or we want to reduce the load of first server(range) suppose lot of load coming to it. now the search will go to the new range, while the data was stored in a different range. how adding of new range works.
@RaviNarayanaGayam5 жыл бұрын
Why %8 when 2 buckets are not available, why not %10 for consistent retrieval just like ring . I don’t understand the point of ring if it’s only about keeping hash table consistent when buckets are not available
@nreed77182 жыл бұрын
Great explanation. Thank you.
@HakuSama10245 жыл бұрын
Thanks for the video. Is there any way you could use a better mic?
@bibekkakati4 жыл бұрын
When Computer 2 goes down, and at that time if an entry is made (say above 9,500 key) that will get stored in the starting key. But what after Computer 2 becme available later on?
@adamhughes99384 жыл бұрын
What happens when that location that failed comes back but some keys were written to the alternative locations. When lookups are performed, wouldn't they go back to the original location where they should have been? Does some reconciliation process occur when brining the failed locations back?
@ricardohincapie15372 жыл бұрын
Clever! Thanks!
@kajalkukreja6943 жыл бұрын
Very good explanation👍👍
@mukut5ul4 жыл бұрын
If hash number greater than last then all numbers will be stored in first location, first location linked list will grow...instead of doing all these why not use round robin and equally distribute to available slots and one more one to many mapping index to hash number just for retrieval.
@azadalishah29664 жыл бұрын
😩When u do such important and beautiful topic, environment should b silent but ur music is destroying that & losing concentration of viewers
@hank919185 жыл бұрын
legendary content! thank you sir!
@Aliaksei_bus5 ай бұрын
good example, thank you
@TheRahul01104 жыл бұрын
What is your name? My mom thinks you are from JANAM dance group...
@sonkarshailendra4 жыл бұрын
Excellent. I was just thinking, how the value will be retrieved which is stored earlier (in 1011) for keys greater than 9900, when one new location will be added, let's say 10010 or 11000.
@akshayagrawal22222 жыл бұрын
@Narendra You are the best. I see many videos on consistent hashing but the way you explained is superb
@chewoona74233 жыл бұрын
To find a bucket in Consistent Hashing, linear search is needed. Is it O(1)?
@navpreetkaur49023 жыл бұрын
thanks so much, not sure if I can really thank enough with the kind of knowledge I am gaining from all your videos, please keep up a good work like this.
@anshigupta8101 Жыл бұрын
why don't you post more videos?
@satanickid13 жыл бұрын
I was wondering how consistent hashing resolves hot partition problem ...
@talesara743 жыл бұрын
Nicely explained. Honeatly I saw many videos but none of them come even closer to this one. Thanks a lot
@prafulsinghvit3 жыл бұрын
Woaah... This is awesome. First few minutes I was wondering why are we learning hashmap here..and then all of a sudden everything made sense...boom..!! ❤️ Super explanation. Thanks! 🙏
@huseyinbarin16532 жыл бұрын
Dude, I really enjoy listening to you. Excellent teaching skills.
@dheten44624 жыл бұрын
Remapping of already existing mapped data when some servers go down in really a tedius task.
@ryan-bo2xi4 жыл бұрын
Every video in youtube has this one comment "this is the best video " ... now i have to watch every video O(N) . I hate this !
@shivaprasad.v.g75264 жыл бұрын
Its still not clear whats happens when a node which owns certain rows of the tables goes down and comes back up ?
@大盗江南4 жыл бұрын
We love u we love u we love u!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@navderm5 жыл бұрын
12:28 : Consistent Hash
@vipinkoul91293 жыл бұрын
How to connect you on linkedIn?
@prasanthmallepeddi54642 жыл бұрын
clear and concise explanation on hashing and consistent hashing,kudos.
@mudassarh42683 жыл бұрын
your explanation is the easiest to understand. I really have huge respect for you and given a chance would definitely return the favor in whatever I can. Stay blessed and keep being awesome
@shreyasrajanna73612 жыл бұрын
Meats starts at 14:00
@RahulPrajapati-jb3yh4 жыл бұрын
Thanks man for good explanation, I understood if one of the location mede unavailable, rehashing is easy i.e. move data of this location to next location(Drawback is next location will have double load now) and no need to rehash whole table but how does the rehashing happen when a new location added in the ring?
@ritingoel91024 жыл бұрын
great explanation :) and also the thing is the person who does know how Hashing works how the hash map works also able to understand because you covered from A to Z. Thanks for the Video :)
@AndhraKitchenFoods3 жыл бұрын
Great introduction presentation on consistent hashing.
@nguyenminh14022 жыл бұрын
I like this guy lol.
@amritraj67754 жыл бұрын
How it is O(1). we have to search in keys to find a fit that's O(n)
@linacao21375 жыл бұрын
Thanks for explaining the concept but would it change the time of find from O(1) to O(log n)? Or you have build a second map between key and index?
@tomtran69365 жыл бұрын
I have the same question. Why do you think it is O(log n)? My thought, the fact that key index values are picked randomly and we need to loop through the keys (generally all) to compare and find the one that is larger than hashed value makes inserting or looking time become O(n).
@cccc27404 жыл бұрын
Its O(n/k)...k being linked list size
@gagangupta12553 жыл бұрын
Great tutorial
@ishwaryachandramouleeswara2294 жыл бұрын
Very clear and solid explanation! Thanks a ton!
@bahruzaghalarov33634 жыл бұрын
It is so natural to hear dog bark when your key is "dog" in hashtable :D
@anutripathi03044 жыл бұрын
which rat makes Grr sound :)
@AShahabov2 жыл бұрын
Bad sound :(
@madhurgwa5 жыл бұрын
So, the scenario is, if we try to save any object with hash greater than 9900, say '9950' when 9900 is down then it (9950) will be saved at 1011 and whenever we try to fetch the object it will be available. But, if the location 9900 comes up and then we are trying to find the 9950 our logic will hit 9900 and return with nothing, so how this will be handled.
@TechDummiesNarendraL5 жыл бұрын
Consistent hashing is mostly used in Caching or Load balancing or NOSQL. Is case of Caching yes, It will get nothing, and duplicate cache happens(since its cache its fine) In case of load balancers you never save anything. In case of NOSQL, using gossip messages all nodes will get to know the 9900 node came back and they sync back the data from 1011 node.
@madhurgwa5 жыл бұрын
@@TechDummiesNarendraL thanks for the reply Narendra. I was mainly thinking about if we implement something similar for any database then we need to take care of sync and all like Cassandra or any other nosql db does. Btw It was very simple and clear explanation of consistent hashing.👍
@santosh05164 жыл бұрын
Very good explanation. Nicely done. Thanks man!
@amitpadgaonkar88304 жыл бұрын
Good explanation. Without BG Music would have been nicer.
@asdfffadff3 жыл бұрын
very good explanation!! thank you
@sivaprasad72785 жыл бұрын
Because if I withdraw money from atm but still reflects to core banking db,internet bank db,atm db,mobile banking db,imps/neft/rtgs db/upi db/mobile banking db etc...,how this will happen in. Back ground if I do transaction in one db through one of payment method as described earlier
@raj_kundalia3 жыл бұрын
Thank you for the explanation.
@tomtran69365 жыл бұрын
Hi, with Consistent hash ring, the fact that we need to loop through the key to find the one that is larger than hash value, makes this is not looking up with O(1) anymore but instead O(n), right?
@TechDummiesNarendraL5 жыл бұрын
Do you always need to search? No. why can't you have a mapper hash map?
@hitesharora7516 жыл бұрын
Good Work. Thanks for sharing your knowledge. Keep it up. (Y)
@rajivjha1235 жыл бұрын
can you or somebody explain the black box here which is hash function ? How is the number generated or regenerated are same ?