Skip to content

algo#

Consistent Hashing

This post is an AI-generated summary of the Medium article Advanced Algorithms Every Senior Developer Must Know: Part 2 — Consistent Hashing from Sourav Chaurasia. It is intended as a concise reference to the key ideas.

Consistent hashing solves one problem: when the number of servers changes, not every stored key should have to move to a different server. Here, a key can be a cached object, a user session, or a database record. If almost every key gets remapped after adding or removing one server, caches are invalidated and a lot of data has to be redistributed.

Merkle Trees (Hash Trees)

This post is an AI-generated summary of the Medium article Advanced Algorithms Every Senior Developer Must Know: Part 1 — Merkle Trees from Sourav Chaurasia. It is intended as a concise reference to the key ideas.

What Is a Merkle Tree?

A Merkle tree (also called a hash tree) is a binary tree structure invented by Ralph Merkle in 1979. It recursively hashes and combines data blocks to produce a single root hash, which serves as a cryptographic fingerprint of the entire dataset. It is used in many systems like Bitcoin, Git, IPFS, and Cassandra for efficient data verification and integrity.