Where does IPFS store all the data?

When you upload something, the file is chunked by ipfs and stored in your cache folder (.ipfs).

If you check the file existance on another peer of the network (say the main gateway, ipfs.io) that peer requests the file from you and caches it too.

If later you switch off your daemon and you can still see the file on the gateway it’s probably because the gateway or some other peer on the web still has it cached.

When a peer wants to download a file but it’s out of memory (it can no longer cache), it trashes the oldest used files to free space.

If you want to dive deep into the technology, check first these fundamentals:

  • how git works
  • decentralized hash tables (DHT)
  • kademlia
  • merkle trees

The latter should give you an idea of how the mechanism works more or less.

Now, let’s answer point by point

  1. Are the blocks stored locally on my system too?

Yes

  1. Where else is the data stored? On other peers that I am connected to? Because I’m still able to access the file if I close my ipfs daemon.

All the peers that request your file cache it

  1. If this is true, and data is stored at several places, possibility of losing my data is still there, if all the peers disconnect from the network?

You lose the file when it’s no longer possible to reconstitute your file from all the peers that had a part of it cached (including yourself)

  1. Does every peer on the network store the entire file or just a part of the file?

One can get just a part of it, imagine you are watching a movie and you stop more, or less, at the half… that’s it, you’ve cached just half of it.

  1. If copy of data is being distributed across the p2p network, it means the data is being duplicated multiple times? How is this efficient in terms of storage?

When you watch a video on YouTube your browser caches it (that means a replication!)… ipfs is more efficient in terms of traffic, let’s say you switch off the browser and 2 minutes later you want to watch it again. Ipfs gets it from your cache, YouTube makes you download it again. There’s also an interesting matter on the delta storage (related to git) and from where you get it (could be inside your lan… that means blazing fast) but I want to stick to the questions.

  1. We store data uploaded by other peers too?

If you get data, you cache it so…

  1. Minimum System requirements for running IPFS? We just need abundant storage, not necessarily a powerful system?

The main daemon is written in go. Go is efficient but not as much as writing it on C++, C, Rust… Also, the tech is pretty young and it will improve with time. The more space you have the more you can cache, CPU power isn’t THAT important.

If you are interested in ways to store data in a p2p manner, here some links to interesting projects.

Leave a Comment