-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
featureA new functionalityA new functionality
Description
After #71 we'll have all information that is necessary for calculating bucket_id by a sharding key. The proposal is to implement this helper function in the module.
Example
Schema:
TBD
Assume we serve HTTP requests:
function handler(req)
local bucket_id = ddl.bucket_id('users', req:json()['user_id'])
local ok, err = vshard.router.callrw(bucket_id, <..args..>)
<...>
endThe key point is that ddl knows, which sharding function is is use. Without the function we would do the following:
function handler(req)
local bucket_id = vshard.router.bucket_id_mpcrc32(req:json()['user_id']) -- !!
local ok, err = vshard.router.callrw(bucket_id, <..args..>)
<...>
endKasen
Metadata
Metadata
Assignees
Labels
featureA new functionalityA new functionality