Company
Date Published
Author
Evan Cordell
Word count
656
Language
English
Hacker News points
None

Summary

SpiceDB uses a consistent hash ring to map requests to nodes, allowing for efficient dispatching of queries and caching of results. The `replicationFactor` controls the number of virtual nodes in the ring, while the `spread` refers to the clockwise movement of keys across nodes. Each node builds its own consistent hash ring, eliminating the need for consensus with other nodes. SpiceDB has recently switched to using kuberesolver, a Kubernetes resolver plug-in, to discover available nodes for dispatch. The `consistentbalancer` package in grpc-go allows developers to register their own load balancer implementation backed by a consistent hash ring, providing flexibility and customization options.