DistHashMap<[u8; 32], [u8; 1024]>?

Suppose we have N machines with identical hardware in a datacenter (reliable, low latency network).

We want the following functions:

insert(key: [u8; 32], value: [u8; 1024]) {
  // inserts (key, value) pair
  // we don't care which machine
}

get(key: [u8; 32]) -> Option<MachineEntry> {
  either returns None or
  a MachineEntry, which states which machine
  the object is on, which we can use to get the data
}

We don't need support for transactions.

We need insert to be atomic.

Reading from MachineEntry needs to be atomic (but we don't have to guarantee it is the same as the instant in time as when the get was called.

  1. how complicated is it to build something like this in Rust ?

  2. what crates are useful for this ?

Pre-emptive FAQ:

  1. do you need durability / store to disk ?

No.

  1. do you need transaction support ?

No.

You could pick a hash function with a random seed and compute a hash from the key, then convert that hash into a machine index, and store the value on that machine.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.