Gossip protocol based counter in a leaderless cluster with customizable chatter size and query aging.
Users will send inc(key, val) operations to any random node. Each node (single replica for simplicity) maintains it's own local store.
User will query(key) a random node and a go-routine will display the query results periodically until the user is satisfied or not-enough changes are seen.
Node gossips with random nodes for query results and we pass query pointer object (for db simulation) - to perform atomic operations. Gossip queries die away due to aging (or we can signal nodes to ignore / kill query).
- Maintains atomic store of nodes with name as primary key.
- Publishes node list as heartbeat to all nodes every 1 second (daemon).
- Maintains atomic store of key-value pairs.
- A single process-query loop daemon to process incoming queries (daemon).
- Based on query visit frequency, can either discard query or process query.
- Query process simply updates query with info and sends query to random un-visited chatter-size nodes.
- Maintains atomic store of visited node-response pairs.
- A status daemon to display node-reponse periodically.
- Tested with 1000 node cluster with perpetual requests (inc key)every 1 millisecond to random node.
- Tested for a single query (get above key)
- See loadtest_response.log simulated with 10ms delay of network latency in same datacenter.
- Implement convergence detection and end query daemon (priority).
- Loadtest under heavy writes and decent read requests (priority).
- All configurable replicas to each node and write ops (sync + async) to subset replicas (later).
- Configurable process-query loop count for each node (boring).