Expand description
Self-organizing sharding for mentedb-server.
Running N nodes shards the fleet with no external coordinator: nodes gossip to
converge on the live set (engine mentedb::sharding::gossip), rendezvous
placement picks one owner per agent (every node computes the same owner), and a
request that lands on the wrong node is forwarded to the owner. Ownership is the
single-writer lock, so an agent’s database is only ever written by one node.
Off unless MENTEDB_SHARDING is set. Routing needs JWT auth (the agent id comes
from the token); without a --jwt-secret the middleware is a pass-through.
Structs§
- Cluster
- Cluster handle held in
AppState; present only when sharding is enabled. - Http
Gossip - reqwest-backed gossip transport: POST our view to a peer, get theirs back.
Constants§
- GOSSIP_
PATH - Path peers POST their gossip view to (and the reply carries ours back).
Functions§
- gossip_
handler - Handler for
GOSSIP_PATH: merge a peer’s view and answer with ours. 404 when sharding is off. - route
- Middleware: forward a request to the node that owns its agent, or serve it here. A pass-through when sharding is off, the request carries no resolvable agent, or we already own it.