--- title: RPC Protocol description: An overview of the RPC protocol used in Veilid weight: 24 layout: subpage --- ### RPC Summary ### Distributed Hash Table Distributed Hash Tables are a way of storing data in records that have keys that are close to nodes in the network. #### DHT Is Just ‘Search’ It may look complicated, but all the DHT algorithms out there are just ‘search’ algorithms. Finding data that is stored on some node somewhere out there. #### Improving Search We built a better DHT by making both search and data locality more relevant. Veilid synchronizes popular data when nodes come and go from the network. a tree diagram for the search ability Locating a node by its ID. Here the node with the prefix 0011 finds the node with the prefix 1110 by successively learning of and querying closer and closer nodes. The line segment on top represents the space of 160-bit IDs, and shows how the lookups coverge to the target node. Below we illustrate RPC messages made by 1110. The first RPC is to node 101, already known to 1110. Subsequent RPCs are to nodes returned by the previous RPC. #### DHT Schema Veilid DHT is built using GetValue and SetValue RPC operations. Nodes can opt out of DHT storage if they do not want to participate. Veilid DHT records have schemas that define subkeys that are individually addressable and can have multiple writers. DHT record subkeys have sequence numbers and are eventually consistent across multiple writes and background synchronizations.
a diagram showing key-value pairs

Veilid Default DHT Schema - DFLT

To zoom in on the details, view the image directly.

a diagram showing key-value pairs, but with more fields

Veild Simple DHT Schema - SMPL

To zoom in on the details, view the image directly.

The DHT gives you full control over your data

Our DHT is not based on a blockchain or a coin

Popular data becomes more available automatically