We understand how to save files in IPFS. The key is the hash. The value is the name of the file or directory and the content of the file or directory. If we were building a centralized system, our story would be finished. We would just need to add a few other things to create a piece of software to save files and search them based on the hash. This software would be similar to a database, such as SQLite or LevelDB. IPFS is neither of those; it is a peer-to-peer filesystem that is like a database but spread all over the place. In other words, it is a distributed hash table.
IPFS uses S/Kademlia, an extended version of Kademlia, as a distributed hash table. Before we discuss Kademlia, let's discuss its predecessor.
First, imagine a hash table, which is like a dictionary in Python, as shown in the following table:
Key | Value |
2 | Cat |
5 | Unicorn |
9 | ...