Trusted answers to developer questions

What is a distributed hash table?

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

A distributed hash table (DHT) is a decentralized storage system that provides lookup and storage schemes similar to a hash table, storing key-value pairs.

Each node in a DHT is responsible for keys along with the mapped values. Any node can efficiently retrieve the value associated with a given key.

Just like in hash tables, values mapped against keys in a DHT can be any arbitrary form of data.

svg viewer

DHTs have the following properties:

  • Decentralised & Autonomous: Nodes collectively form the system without any central authority.
  • Fault Tolerant: System is reliable with lots of nodes joining, leaving, and failing at all times.
  • Scalable: System should function efficiently with even thousands or millions of nodes.

Just like hash tables, DHTs support the following 2 functions:

  1. put (key, value)
  2. get (key)

The nodes in a DHT are connected together through an overlay network in which neighboring nodes are connected. This network allows the nodes to find any given key in the key-space.

svg viewer

RELATED TAGS

hash table
distributed
dht
data structures
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?