Skip to content

Sharding - Data Change changes shard - Sanity Checks

We need to introduce some checks on persist to raise and error when the user tries changing data that would cause the data to move between shards.

What would be sane auto behaviour instead of error?

Delete the old document in its current shard and create a new document in the new shard. This would mean that any history aka versions in document struct would be empty when the new document is loaded next time.

We could maybe put in a hook that is called when a document is perceived to change shards, and give the user an opportunity to deal with the situation them selves if they dont like the default behaviour.

What we should not do is try to keep versions between shards in sync that would just ruin sharding in the long run!!