Much like the original intent of the web, the Interplanetary File System (IPFS) is built to share data wide and far. However, much like the early web, IPFS can suffer from bottlenecks and slow performance. Fortunately, developers do not have to choose between peer-to-peer decentralization and performance when it comes to accessing content on the IPFS network. Through the use of Dedicated Gateways, developers can provide a blazing fast experience without restricting the open access to data that IPFS promises.
Let’s dive into what Dedicated Gateways are, how to set one up, then how you can use it in your app.
What is a Dedicated Gateway?
To understand what a Dedicated Gateway is, it’s important to understand how IPFS works. IPFS is a peer-to-peer protocol with a core focus on retrieving content not by its location on a central server but by the content itself. This means that if multiple IPFS storage nodes have the same content, when you make a request across the IPFS network, your request will be routed to the location closest to you with the content requested.
This only works at the peer-to-peer network level. The web today doesn’t natively support that, so we can turn to IPFS gateways. An IPFS gateway is a server attached to an IPFS node running on the network. This server accepts traditional HTTP requests and returns content when found. A dedicated gateway from Pinata adds on an additional layer of convenience by adding in data caching at the edge, image optimizations, and video streaming.
How can developers use Dedicated Gateways?
When building applications in the web3 space or applications that make use of public media, IPFS is an ideal choice. But like all applications, the tech stack you use matters. Developers can use Dedicated Gateways from Pinata to ensure scalability and reliability.
If you have a high-traffic application, platform or marketplace that requires fast and reliable access to content on IPFS, a Dedicated Gateway can provide better performance and reduced latency. Using a public gateway could mean major slowdowns. You can see the performance difference below. A Dedicated Gateway is used on the left and a public IPFS gateway offered as a public good is on the right.
In addition to the speed of a built-in CDN, a dedicated gateway gives developers a branded experience. On public gateways, the URL of your pinned files looks something like this: gateway.pinata.cloud/ipfs/xyz. With a Dedicated Gateway, you can set your gateway to point to a custom domain. Your app and your infrastructure can share the same branding through URL.
How do I set up my Dedicated Gateway?
Setting up your Dedicated Gateway is simple. Just login to your app, and navigate to the ‘Gateway’ tab. If you don’t yet have a Picnic plan or higher, it will ask you to upgrade your plan before setting up your Dedicated Gateway.
Once you get to the Gateway tab, you’ll be asked to name your new gateway.
If you’d like to add a custom domain, you can click the three dots and choose Add Custom Domain:
Follow the instructions to add records to your domain registrar’s DNS settings and your custom domain will be pointed at your Dedicated Gateway in no time.
When your app makes requests to load files, you just need to know the URL for your gateway and the content identifier (CID) for the file you want to load. If you’re building your project with IPFS and you want to reach a larger audience without sacrificing on performance, having your own personal gateway is a must. Login to your dashboard to set yours up today.
August 30, 2023
Ready to shape the future?
Explore our plans