This content originally appeared on Bits and Pieces - Medium and was authored by Alicia Jones
IPFS — the out of the world file system for the distributed web
If you take a look back at the past, you will realize how far we have come as a tech community. From standard dial-up connections with squeaky noises to ultra-high-speed fiber connections, it is truly astonishing.
Yet the way the Internet has been structured has been pretty much the same to date. HyperText Transfer Protocol(HTTP) is the technology that carries most of the responsibility of data communication of the Internet. HTTP has its own downsides and it is high time another technology steps up for the challenge. We will be looking at the InterPlanetary FileSystem(IPFS), which is considered to be a direct alternative to HTTP’s standard of the web.
Before we dive deeper, let’s revise our knowledge of what HTTP is.
HyperText Transfer Protocol
Hypertext Transfer Protocol (HTTP) is an application-layer protocol for transmitting dynamic documents, such as HTML. It was primarily designed for the communication between web browsers and web servers. HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. It pretty much deals with how servers deal with requests and how browsers manage them.
Data is stored in centralized servers and accessed by location-based addressing. This makes it easier to distribute, manage, secure the data, and scale the capacity of both servers and clients.
HTTP was adopted into the web in 1996 and is still used widely. It is almost 25 years old and in the world of technology, that is quite ancient I must say. IPFS is a newer, faster, and more secure protocol that can be used instead of the “ancient” HTTP.
Let’s have a look at some of HTTP’s pitfalls that turn out to be IPFS’s advantage.
Downsides
- Centralized — As the files are hosted on servers that are mostly owned by large companies such as Google and Amazon. This makes it easy for governments and hosts to censor and modify content.
- Web page history — The average lifespan of a web page is 100 days before it’s gone forever. It’s not good enough for the primary medium of our era to be this fragile.
- Cost — It is very expensive to serve data on HTTP, especially when the server is on another end of the world. HTTP downloads files from one computer at a time instead of getting pieces from multiple computers simultaneously. HTTP was mostly designed to transfer web pages not large amounts of data. With the modern-day lifestyle revolving around data, we started developing powerful computers and improving our cloud architecture. But the fundamental architecture of the web still remains the same.
InterPlanetary FileSystem(IPFS)
IPFS is a peer-to-peer hypermedia protocol designed to make the web faster, safer, and more open. It is an open-source peer-to-peer distributed file system, much like BitTorrent.
The IPFS was named in tribute to J.C.R. Licklider’s vision for an “intergalactic” Internet and was created by Protocol Labs, an R&D lab for network protocols and former Y Combinator startup.
Several components such as distributed hash tables, block exchanges, Merkle DAG build up the IPFS architecture. These components are essential for the functioning of this protocol.
- Distributed Hash Tables
A hash table is a data structure that stores data in the form of key-value pairs. In a distributed hash table, the data is distributed across a network of computers and coordinated for efficient access amongst nodes.
- Block Exchanges
IPFS implements a generalized version of BitTorrents data exchange protocol called the BitSwap. This protocol enables IPFS to coordinate the data transfer between millions of nodes with ease. FileCoin was also based directly on this protocol.
- Merkle DAG
Merkle DAG is a blend of Merkle Trees and a Directed Acyclic Graph(DAG). Merkle trees ensure that data blocks exchanged on peer-to-peer networks are accurate, whole, and unchanged. This verification is done by organizing data blocks using cryptographic hash functions.
Why Choose IPFS?
Not Relying on Servers
When a server dies or is moved to a new location, the content links associated with that server will also stop working. Whatever data that existed on that server cannot be retrieved unless you had grabbed it before or get a hold of the new server location.
HTTP uses location-based addressing to access data stored on the servers. But with IPFS, data access is based on content-based addressing. Instead of relying on one server for the data, you get the required data from one of the millions of computers that have a copy of that file, similar to BitTorrent.
Decentralization
The present Internet is pretty much the exact opposite of what was initially expected from it. The initial expectation was for a pure decentralized web. Comparing that with what is at present, you can pretty much understand how we are at an exact polar opposite.
IPFS stays true to the original vision of an open, flat web. A genuinely decentralized web would be the perfect solution for individual privacy.
Cost Reduction
As we have already mentioned before, the cost of serving large files over HTTP is extremely large. According to the IPFS website, P2P IPFS can reduce bandwidth by up to 60% for videos. Large streaming services such as Netflix have also known to research implementing P2P solutions for their content streaming.
An IPFS blog post estimates that Google would have spent at least $2,742,860 on the distribution of Psy’s Gangnam Style through Youtube. Although that might not be a huge cost from a large corporation’s perspective, from the eyes of a medium scale company, that is a lot of money.
IPFS would enable you to download content from within your own ISP, and thereby removing the need for the additional hops across several networks. Even the biggest files can be downloaded as each file will be broken into several chunks of 256 KBs.
Challenges
Not User Friendly
The content addressing format is not user-friendly. A typical IPFS link would like this.
ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq
As you can see, the InterPlanetary Naming System(IPNS) contains some sort of a key code. In fact, it is the hash of a public key. It is associated with a record containing information about the hash it links to that is signed by the corresponding private key.
IPFS provides another variant called DNSLink which is faster than IPNS and more user-friendly.
Storage Availability
One of the most important issues faced by IPFS was keeping files available at all times. Since files were retrieved from the cache of nodes in the network, if all of the nodes who have a copy of the file go offline, the file will be unavailable for everyone in the network. This is very similar to torrents without seeders.
To prevent this problem, IPFS built a protocol that provides incentives to storing and sharing data on the distributed web. This protocol was called FileCoin.
Further Reading
Since IPFS is a huge concept that cannot be explained in a small article, I highly advise you to visit the IPFS website to know how to get started with IPFS.
IPFS Powers the Distributed Web
Furthermore, I would recommend you watch the below video to expand your knowledge further.
You can read the documentation if you wish to dig deeper into the technicalities of this protocol.
Although IPFS has been under development for more than 5 years, it recently gained the spotlight after being integrated with Brave browser — a browser that prioritizes privacy. I must note that it too early to say whether IPFS will change the world for good, as it is up to the community to accept this novel technology into their livelihoods.
Build & share JS components with Bit
Bit is an extensible tool that lets you create truly modular applications with independently authored, versioned, and maintained components.
Use it to build modular apps & design systems, author and deliver micro frontends, or share components between applications.
Learn More
- The Dark Side of Javascript: A Look at 3 Features You Never Want to Use
- Web Caching Best Practices
- The BFF Pattern (Backend for Frontend): An Introduction
Resources
Article by Dan Price
IPFS
Brave
Wiki
TechCrunch
Hackernoon
Is The HTTP Replacement Here? was originally published in Bits and Pieces on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Bits and Pieces - Medium and was authored by Alicia Jones
Alicia Jones | Sciencx (2021-08-19T17:45:24+00:00) Is The HTTP Replacement Here?. Retrieved from https://www.scien.cx/2021/08/19/is-the-http-replacement-here-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.