elixir simple nosql db with hashing -


i'm writing simple distributed cache in elixir(just poc, nothing important). idea simple, have n nodes (each 1 of them contains region or cache partition) , 1 orchestrator node. every request goes orchestrator, orchestrator selects node (based on key) , writes it. is: if req put, orchestrator calculates node , writes it; if req get, orchestrator calculates key should , reads node. overall, system working. have implemented failover/takeover scheme orchestrator layer.

my question is: function selects node stateless(no previous state needed i'm using [hash mod n] based algorithm given same key, returns same node). say, every req indepent of each other. in iex, can spawn 1000 processes , put/get requests in parallel said before node selection completly stateless( example asume 500 "get" requests , 500 "put" requests).

however i'm not 100% sure of scheme.

do need serialize reqs through intermediary process receives req, gets/puts to/from given node, , reply client ?

if that, i'm turning process bottleneck, but, on other hand i'm ensuring "proper" sequential access.

with actual scheme, every req independent of each other(could be) , therefore access no sequential.


Comments