You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Systems from 8388608 to 16777215 will be assigned to registered systems
High 40 bit - entities inside system
High 40 bit also contains:
Server suffix (for horizontal scaling)
NodeId can be calculated (Id - server suffix) % nodes and NideId can change each restart, based on node count
Terms and Definitions
System - is a separate data storage having its own user accounts and granted permissions, own horizontal sharding with suffix tree, own routing map with registered servers. System can have one way replication with other systems on selected categories. Replicated objects will not change Ids. System contains 1 or more servers.
Server - is a single device running multiple nodes (2 or more, one for server monitoring and orchestration, second for business-logic, storage and serving requests). Each server have its own storage accessible for all nodes, but nodes will read/write just entities bound to certain nodeId.
Node - is a process holding in memory multiple entities. Id % nodeCount = nodeId
Entity - storage unit (record of certain category with its multiple detail records of other categories, relations and constraints). Each entity (with details) should be stored and processed in one certain
Server and inside it in one certain node.
To be implemented
Id generation service
Id routing API
Replication mechanism between systems
Sharding inside system (including server cloning)
Storage redundancy for persistence instead of backups
Id structure
0
1
to8388607
are reserved8388608
to16777215
will be assigned to registered systemsHigh 40 bit also contains:
(Id - server suffix) % nodes
and NideId can change each restart, based on node countTerms and Definitions
System
- is a separate data storage having its own user accounts and granted permissions, own horizontal sharding with suffix tree, own routing map with registered servers. System can have one way replication with other systems on selected categories. Replicated objects will not change Ids. System contains 1 or more servers.Server
- is a single device running multiple nodes (2 or more, one for server monitoring and orchestration, second for business-logic, storage and serving requests). Each server have its own storage accessible for all nodes, but nodes will read/write just entities bound to certainnodeId
.Node
- is a process holding in memory multiple entities.Id % nodeCount = nodeId
Entity
- storage unit (record of certain category with its multiple detail records of other categories, relations and constraints). Each entity (with details) should be stored and processed in one certainServer and inside it in one certain node.
To be implemented
Examples
System registry example:
System infrastructure example:
Globalstorage Id API
Ids will be generated and stored in special service. It will have following configurable parameters with default values:
gs.parseId(Id: BigInt): { system: Number, server: Number, node: Number }
gs.route(Id: BigInt): { system: { host, port }, server: { host, ports }, node: Number }
- find targetgs.generateId(callback(err, id))
gs.generateBunch(count, callback(err, ids: Array of BigInt))
gs.systems: Map
// this systems collection keyed bysystem Id: Number
gs.servers: Map
// this system servers collection keyed byserver Id: Number
gs.system: Number
// this system Idgs.server: Number
// this server suffix (not including system Id)gs.serverBits: Number
// number of bits for this servergs.serverMask: Number
// bit mask(2 ** serverBits) - 1
to extract server suffixgs.node: Number
// this node Idgs.nodeCount: Number
// Node count on this serverThe text was updated successfully, but these errors were encountered: