Skip to content

[Cluster] "Cache-Only" mode #4160

@shaharmor

Description

@shaharmor

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:

  1. New node is added to the cluster
  2. 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)
  3. Reassign the new slots distribution instantly without migrating any data.
  4. 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:

  1. Do nothing until the key is being read/write and then delete the data behind it.
  2. Delete all keys related to the slot when the slot is being re-assigned (Not sure how performant this can be)
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions