DEV Community

Cover image for Quickie on Cloud vs IPFS
sydneylai
sydneylai

Posted on

Quickie on Cloud vs IPFS

There's been a lot of chatter about the metaverse, so I wanted to explore how we as humanity will build the various verses. This reminded me of how there are various cloud service providers ranging from Azure, IBM, AWS to Google Cloud. As I dove into IPFS this theme reminded me of the LAN parties of the 90s, with various gaming worlds operating simultaneously and peer-to-peer.

Now this article will not be detailing the metaverse backend architecture, I will first begin with looking at cloud infrastructure vs IPFS infrastructure as a primer, as this is a fundamental shift of how we once understood programming. Instead of creating one database with 20M user profiles, now you would create one JSON file per user profile.

Storage is saving data information on a hard-drive. Then came cloud storage, where a company came in to offer storage services for you so that you did not have to lug around your hard drive. Cloud storage allows you to store internet data through a provider who manages and operates data as a service. You can retrieve your data on demand. IPFS introduces storage across a network of storage providers rather than a centralized provider such as Google Cloud.

Difference between Cloud vs IPFS

Cloud developers can access their builds across their work computers in Google Cloud Console. Sharing documentation and access rights with colleagues allows for a remote team not tied down to where the company's on prem servers are. If developers ever want to access their Cloud service, they would still need internet connectivity and pay their subscription fee. The key disadvantage for cloud storage is that it only works with an internet connection. Although, most situations in work and life provide for internet access, there are places and times when this just isn’t possible. Thus, you run the risk of not all parties being able to work on the same project.

Developers using IPFS have no-central-administration feature, therefore a file may not necessarily be stored on one node. There may be many nodes storing small pieces of that file. This means that instead of retrieving the file from one location, you actually retrieve the file from multiple nodes at once, massively reducing bandwidth. If a portion of your data is compromised, not all your information is in jeopardy as your information is dispersed. IPFS provides efficient data storage, distribution, and data permanence that allows for offline-oriented paradigms.

Why This Matters

To explain the architecture I'll use a consumer-based approach. When a user uploads data, that data is sent to servers run by Example Startup, and those servers store that data on a company owned IPFS node.

This is how IPFS commonly works today (web2.0 style, use server to make available over IPFS) but ultimately the goal would be for the client itself to make it available over IPFS (Step 1, already available over IPFS), then contact the company owned IPFS node, and ask it to help persist it (or/and ask your peers).

"This is how IPFS commonly works today (web2.0 style, use server to make available over IPFS) but ultimately the goal would be for the client itself to make it available over IPFS (Step 1, already available over IPFS), then contact the company owned IPFS node, and ask it to help persist it (or/and ask your peers)." - Discordian, Developer Advocate at Filecoin

For data to be available on the IPFS network, at least one node has to be hosting the data. Thus, IPFS allows us to retrieve that based on what the data is, not where the data is. This means no more fishing around your cloud folders trying to remember which folders you had put those company documents.

If you share a viral TikTok with everybody, your friends. The way the video clip would be retrieved is everyone clicking on the link to the video. This then takes them to the website that the video is hosted on and every single one of your coworkers’ computers has to individually reach out to the website’s server to download the video. This situation puts enormous strain on our internet infrastructure and is why certain sites are not designed for traffic load capacity crashes.

IPFS does not use a website’s server to send the video to every single person that’s trying to view it, IPFS looks for the video’s CID, or “content identifier”. The CID is akin to the hash for the content. This CID is based on what the content is, not where the content is located. The site will ask the IPFS network for the video that corresponds to the CID it was just given, regardless of where it is stored, rather than fetching that content from the website’s server.

Introducing IPFS to a developer’s stack requires a mindshift change on how one develops in web3.

Resources:

If you'd like a detailed document of how I build the technical architecture of the metaverse, please comment below to request, or if any other build requests.

IPFS Docs: https://ipfs.io/#install
NFT Storage: https://nft.storage/
Tutorial on how I make & store NFTs: https://dev.to/sydneylai/create-and-host-nfts-with-25-lines-of-code-4l4e

Top comments (0)