Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Which kind of message queue are you using? For example, RabbitMQ allows for clustering. Is that similar to what you need? Commented Jul 13, 2024 at 1:16
  • And by "implementing a message queue" do you mean you are choosing from an existing solution, or are you literally writing the code which will serve as a message queue? Commented Jul 13, 2024 at 1:18
  • In Kafka, changing the number of partitions only affects future messages. Existing messages remain in their partition and aren't moved around. However, brokers (nodes) in a cluster can fetch data from each other. So a client only has to connect to any node in the cluster, not to the node that happens to store the data. Perhaps you could implement a similar mechanism to internally route message reads to the correct node. But Kafka also makes some decisions (messages are immutable, clients pull messages) that make this feasible. Commented Jul 13, 2024 at 4:29
  • 2
    I am implementing my own queue from scratch, with the semantics of SQS. Commented Jul 13, 2024 at 14:28
  • 1
    If this is a cloud-first design then storage will be virtualized anyway. You may be able to share storage, or reassign volumes to another compute node with little or no downtime. Actually moving data between nodes would make scaling down more difficult. However, your main problem isn't storing/moving data, but designing a distributed system. Your problems are shared with other databases that support sharding and/or replicas. Solutions will depend on your CAP priorities/ desired consistency model. Aside from "B doesn't have the data yet", also consider "B has crashed/frozen". Commented Jul 13, 2024 at 19:50