-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Open
Description
Hi,
Many times Redis Cluster is used as a cache layer where the durability of the data itself is less important than the availability & scalability of the cluster.
For availability, slaves can be used.
For scalability though, adding more nodes to the cluster takes a lot of time and requires migrating existing data and spreading the slots between all the servers again.
A better scenario for the "Cache-Only" mode would be something like this:
- New node is added to the cluster
- The cluster sees the new node and recalculate the slots distribution amongst all nodes with the less changes to existing nodes (For example take 1/(n-1) slots from each node and assign to the new node)
- Reassign the new slots distribution instantly without migrating any data.
- Reads/Writes to nodes that no longer hold the slot will behave like they do today, telling the client that the slot has moved (Even though they might hold the old data still).
The question is what happens with the data that existed on one of the node and was re-assigned to another node.
Some options that come to mind:
- Do nothing until the key is being read/write and then delete the data behind it.
- Delete all keys related to the slot when the slot is being re-assigned (Not sure how performant this can be)
- Delete data only when the slot is being reassigned to a node, so the master doesn't serve stale data in case the slot is being re-assigned multiple times.
What do you guys think?
agolomoodysaada and XA21X
Metadata
Metadata
Assignees
Labels
No labels