When you hear the term ‘pinning’, what do you think of? Some people might think about a cork board that they pin photographs and other paper items onto in a collage format, while others might think about putting a decorative pin into a hat or jacket. The intent, however, is the same - whatever you are pinning, you want it to persist in the location you pinned it to in order for it to serve a purpose.
What is Pinning?
Pinning, in regards to IPFS, is similar to the idea of pinning a photo onto a cork board.
The InterPlanetary File System, or IPFS, is a decentralized peer-to-peer protocol that enables nodes to store and transfer files between one another. IPFS isn’t inherently a network itself - it's a communication protocol that outlines the workflow and components that enable the IPFS network to exist. Software like the IPFS daemon and IPFS desktop provide nodes the ability to participate in and interact with other nodes running the same software, thus creating a network of peers storing and sharing files between themselves.
When a file is stored on an IPFS node, it is stored in the node’s cache storage unless it is ‘pinned’. When a file is pinned on an IPFS node, it is stored in the node’s permanent storage, for long-term, persistent availability. Think of it like pinning a photo onto a cork board. The photo will remain on the cork board until you remove the pin.
Why Files Need To Be Pinned
If a file on an IPFS node isn’t pinned and remains in the node’s cache storage, the file will be removed during the next run of the automatic IPFS garbage collection process. Garbage collection is an automated process that frees up used resources on IPFS nodes to make space for new files to be stored in the node’s cache storage.
IPFS pinning is important if the file you upload needs to be accessible for a long period of time. It’s difficult to determine how long a file will be persistent on the IPFS network when it’s not pinned since while it can exist in one node’s cache storage, it can also exist in the cache storage of other nodes if those nodes have recently retrieved the file from the original node that was storing it. The garbage collection process might run at different times across these nodes, so while the original node might not store the file anymore, it might still be cached on another node or several other nodes.
Pinning ensures that no matter how many nodes have the file cached, it will always be available on at least one node. Most pinning providers only pin files on one IPFS node, which creates a single point of failure. If this single node goes offline, so do the files that it is pinning. While the files might be cached on other nodes, there is no guarantee that they are.
When a file is uploaded to a Filebase IPFS bucket, it is automatically pinned onto the IPFS network with copies stored on 3 different nodes across 3 diverse geographic locations in the United States, London, and Germany. This creates automatic 3x redundancy for all files pinned to IPFS through Filebase.
By using Filebase for IPFS pinning, files aren’t at risk of being inaccessible due to a single point of failure. 2 of the 3 IPFS nodes pinning your file on the Filebase infrastructure could be offline, and your file would still be persisted on the network. This ensures that files maintain the highest level of reliability possible in comparison to other IPFS pinning services that only pin files once on a single node.
Pinning Content to IPFS Through Filebase
Create an IPFS Filebase bucket. Then select ‘Upload’ and select either ‘File’ or ‘Folder’ to pin a single file or a folder of multiple files to IPFS.
Filebase also supports re-pinning existing CIDs. This means you migrate from pinning files on your own local IPFS node, or from another pinning service provider, and pin those files to Filebase without having to re-upload the files. Simply select ‘Upload’ then ‘CID’, instead of file or folder.
IPFS Pin Sync
If you have hundreds or even thousands of IPFS CIDs that you want to migrate to Filebase and re-pin, it can be tedious and time-consuming to re-pin them one by one. That’s why we developed the IPFS Pin Sync tool, which synchronizes all pinned CIDs from one IPFS pinning service to Filebase.
Using IPFS Pin Sync is as easy as logging into the provider you’d like to migrate from, like Pinata, then logging into Filebase, and clicking ‘Sync’.
The Filebase IPFS Pin Sync tool is available in-browser here, and is free to use.
You can sign up for a free Filebase account to get started with your IPFS journey today.