rekord
rekord copied to clipboard
Add tracking options to sharding
Keep track of the set of shards a model is saved on. If the set of shards changes (because getShardForModel is not based on ID) then make the necessary calls (removes and creates).
Think about how this will impact users with stale or overwritten values which decide the shard.
- On
create
,all
,get
, andquery
we try to set the shards the model exists on. - On
update
we call the necessary create/update/remove methods for each shard cached on the model and newly determined by the method. - On
remove
we try to use the cached shards instead of newly determined ones.