Pinning

In the content addressing section, we learned that different IPFS peers store the data(for example, wiki web pages) that they can share with other IPFS peers too.

But as you can imagine there is a limit on how much your device can store. Let's say an IPFS peer stores 10 GB of data. If the size of the data stored on the IPFS peer exceeds 10GB, then the garbage collector deletes the data so that the storage reduces below 10GB.

Garbage Collector deletes Un-Pinned Data

But 10 GB is not enough to store all the Wikipedia pages. So, we only store data that is important to us on our IPFS peers. Storing data selectively is called pinning the data(CID).

When you "pin" an image or a movie on an IPFS peer, it will not be deleted by the garbage collector after the storage capacity is exceeded.

Garbage Collector does NOT delete Pinned Data
In other words

IPFS nodes treat the data they store like a cache, meaning that there is no guarantee that the data will continue to be stored. Pinning a CID tells an IPFS server that the data is important and must not be thrown away.

You should pin any content you consider important, to ensure that content is retained long-term. Since data important to someone else may not be important to you, pinning lets you have control over the disk space and data retention you need.

Pinning Services

To ensure that your important data is retained, you may want to use a pinning service. Such a service normally trades money for the service of guaranteeing they'll keep your data "pinned". Some cases where this might be important to you:

  • You don't have a lot of disk space, but you want to ensure some data sticks around.
  • Your computer is a laptop, phone, or tablet that may have bad connectivity to the network, but you want to be able to access your data on IPFS from anywhere at any time, even when the device you added it from is offline.
  • You want a backup that ensures your data is always available from another computer on the network in case you accidentally delete or garbage-collect on your own computer.