Back to blog

When Should You Use IPFS Vs. The Files API

When Should You Use IPFS Vs. The Files API

Justin Hunter

When building any application that requires file storage (which is just about all apps), you have to ask yourself if the files being stored should be public or if they should be private. From there, you can start to make decisions about how to structure your app’s file storage solution. However, things get a little trickier if you also need to consider things like data portability, converting public files to private, and more.

In this guide, we’re going to talk about how to think about file storage and how to decide when to use the Interplanetary File System (IPFS) vs. the Files API.

When To Use IPFS

IPFS is a great solution for ensuring open access to files and data in a performant way. When a file is on IPFS, it is accessible to anyone in the world, and they don’t need any sort of permission. For that reason, it’s important to understand that if you choose to use IPFS, you should effectively assume that the file will be public and available for anyone forever.

In reality, that’s not exactly how IPFS works, and the file will only be available as long as someone has it “pinned” to an IPFS node. But because anyone can access the file and pin it themselves, putting a file on IPFS should be something you do with intention.

IPFS has been closely linked with blockchain applications, but it originally started as a solution to a much broader set of problems. IPFS is great for blockchain apps, but it can be great for many other use cases. For example, Activity Pub is a wonderful open standard for publishing open data. This is what Mastodon uses. IPFS is a nice compliment in the sense that IPFS can handle the related media files while Activity Pub handles the data and actions.

When To Use Private Files

The Pinata Files API was built to address a gap between what many developers need and what IPFS provides. Over the years, we heard from countless developers about the need for private file storage. Encrypting files and storing them on IPFS can be a solution for some use cases, but in reality, it’s not the best solution.

Having truly private files, where each developer has complete control over access, provides a broader solution to this problem. The vast majority of apps should probably start with the assumption that they want to use the Files API instead of IPFS.

For example, let’s say you are building a podcasting app where podcasters upload their audio files, edit, then eventually publish when they are ready. Up until the moment the podcaster hits publish, the audio files should be private and protected. Only the podcaster and their collaborators should be able to access it. The Files API is the perfect solution for this.

Why It Matters

As you design your application’s file storage strategy, the choice between IPFS and the Files API is crucial. With IPFS, you get an open, decentralized solution that makes your data accessible to anyone worldwide—ideal for public content that benefits from being openly shared. On the other hand, Pinata’s Files API offers a secure, private storage solution tailored for situations where access control and data protection are paramount.

The real power of Pinata lies in its flexibility. Whether you’re building for Web2, Web3, or somewhere in between, Pinata has you covered. You can use IPFS for public, community-driven data and the Files API for private, secure data, all within one cohesive ecosystem. Many apps today blend both public and private content, and Pinata is designed to support this complexity with ease.

Start with IPFS or the Files API—or both!—and see how Pinata can streamline your file storage needs while keeping your content secure, accessible, and scalable. Whatever your vision, Pinata is here to help bring it to life.

Ready to dive in? Get started today with the best of both worlds in file storage.

Subscribe to paid plan image

Share this post:

Stay up to date

Join our newsletter for the latest stories & product updates from the Pinata community.