Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve one of 4 nodeId digits for zoneId for Multi DC #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pradeepdalvi
Copy link

At present nodeId ensures uniqueness of ID generated within node by collision checker and across nodes using nodeId, however it may lead to collisions in multi DC setup.

  • One workaround is to having separate prefixes in each DCs, which would push all services to modify their Id Generation logic and/or move them to config.
  • Another way (which is implemented here) could be, reserving one of 4 digits of nodeId for zoneId or fameId. This creates a room for 10 zones and also leaves adequate room for number of instances i.e. 999.

Second approach has been implemented here. This approach also makes service registry & discovery DC/zone/partition aware without change in length of id generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant