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

Unique identifiers for data and servers #6

Closed
tshemsedinov opened this issue Sep 11, 2016 · 1 comment
Closed

Unique identifiers for data and servers #6

tshemsedinov opened this issue Sep 11, 2016 · 1 comment
Labels

Comments

@tshemsedinov
Copy link
Member

tshemsedinov commented Sep 11, 2016

out of date

GSID (Global Storage Identifier) is a number that can be represented in tree to map GSID to spatial-distributed servers. Any binary branch may fork or not at any bit to twice storage.

  • When we have 1 server, everything stored there;
  • For 2 servers, lower bit in GSID shows where stored data;
  • For 3 servers, two lower bits shows storage place, for example: 00 for server S0, 01 for server S1, 10 for server S2 and 11 for server S2; or we may have different case: 00 for server S0, 01 for server S0, 10 for server S1 and 11 for server S2;
  • For 4 servers, two bits encodes 4 different storage servers;
  • When we want to increase number of servers, we should separate data at certain server based on next GSID bit and copy half of data to new server;
  • Servers are mapped to geo-location (spatial sharding):
    • example for 4 servers:
      • 0 (0000) Europe and Africa,
      • 1 (0001) India and Australia,
      • 2 (0010) China, Japan, Korea and the neighbors
      • 3 (0011) the Americas,
    • then we fork into 8 servers:
      • 0 (0000) Europe,
      • 1 (0001) India,
      • 2 (0010) China,
      • 3 (0011) North America,
      • 4 (0100) Africa and the Middle East,
      • 5 (0101) Australia and Southeast Asia,
      • 6 (0110) Japan and the neighbors,
      • 7 (0111) South America.
    • and so on, but we can upgrade 4 servers to 6, e.g.:
      • 0 (0000) Europe and Africa,
      • 1 (0001) India,
      • 2 (0010) China,
      • 3 (0011) the Americas,
      • 5 (0101) Australia and Southeast Asia,
      • 6 (0110) Japan and the neighbors.
  • So we need servers map because we do not know where servers forked and where not; such map will be stored at all servers and we will have GSID resolution service for finding a place of data physical storage.
  • GSID is an integer number from 0 to ∞, with hexdecimal string representation like this 0xA83FB217;
  • Servers are also have GSID, e.g. China is 0x02 from example above;
  • Current hardware type for GSID is 64-bit integer 0x0000000000000000;
  • Sometimes we can use binary GSID e.g. 0b10101000001111111011001000010111;
@tshemsedinov
Copy link
Member Author

Closes in favor of metarhia/Metarhia#21

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

No branches or pull requests

1 participant