You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- so for hash based method 1 you explained, we need to arrange them in form of ring as in consistent hashing and then allocate ranges to each nodes,am i correct?rahul sharma– rahul sharma2021-02-10 17:40:46 +00:00Commented Feb 10, 2021 at 17:40
- Not sure I can parse your question. In method 1, the hash points to the machine/machine set its located on. When the number of machine/machine sets change in the database it can change to which machine/machine set the same hashed value points to. You could make each shard independent of a machine/machine set with a cross-walk table, but if that is the case you are better to follow method 2, and partition the data instead.Kain0_0– Kain0_02021-02-10 21:31:16 +00:00Commented Feb 10, 2021 at 21:31
- method 2 can can have unbalanced partitions. What i asked was our hash fxn will be of form hash(key)%n, and now if n changes by adding or deletion of db nodes, it will effect all mappings, as new has fxn will be hash(key)%(n+1) ,assume a new db server is added, how can we make sure we get min. change in existing mappings by change of hash fxn. IS consistent hashing is the answer to this?rahul sharma– rahul sharma2021-02-11 16:07:26 +00:00Commented Feb 11, 2021 at 16:07
- Method 2: yes, the reason for having a background process break/merge/load balancing them. Method 1: Yes the reason why every shard has to be checked. There is no way to perform consistent hashing because there is no way to obtain a consistent list, except by fiat. And if you are this far, go to method 2.Kain0_0– Kain0_02021-02-12 01:09:03 +00:00Commented Feb 12, 2021 at 1:09
- I think we are on different track.What do you mean by "consistent list",If i want to scale my server count up/down later, I would need min. keys movement, so somehow i think strategy like consistent hashing might help. By consistent hashing i mean, servers are arranged in a ring by hash fxn and then keys are also arranged in similar way by going in clockwise direction if no server at hashed location.rahul sharma– rahul sharma2021-02-13 12:15:02 +00:00Commented Feb 13, 2021 at 12:15
| Show 1 more comment
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you