islamic-network / alquran.cloud

Web App that powers https://alquran.cloud
GNU General Public License v3.0
317 stars 44 forks source link

Using Ipfs instead of cdn #26

Closed adelpro closed 2 years ago

adelpro commented 2 years ago

Why not using IPFS network to distribute audio and media files instead of CDN. benefits:

Im using this technique on my project QuranIPFS and its working perfectly. Details: Im hosting Ipfs node on digitalocean cloud as Backend, and using it to distribute 33 receiters audio files. My website www.quranipfs.com

meezaan commented 2 years ago

@adelpro They are different things. A CDN is there to distribute files over HTTP; speed and reliability are of vital importance, especially when doing things like streaming audio or video.

IPFS is a peer to peer file sharing protocol - it can't serve as a CDN. Even if it (and here I mean multiple nodes as a single one alone would never be reliable enough) were to be used as a data source for an HTTP proxy (to achieve the desired effect you would also need many of these) that cached as a CDN, in a real peer to peer network there is no guarantee about the uptime or bandwidth of the peers, so it would defeat the purpose.

BTW I am unable to download audio from your website. Links like https://share.ipfs.io/#/QmPuR954yoKXWjoCr5ChsJZPjGZa819i7ePuy5QfbZ2nxz get stuck at loading file list.

adelpro commented 2 years ago

Thats the point @meezaan , peers not peer, when more peers join the project these files will become more reliable and beter then a CDN distributed from one server. The project Quranipfs is a proof of concept and IPFS is on the early stage of development, How much cost distribuing files over CDN?!! And how mach data can we serve over CDN?!!

The inverse, how much cost distribuing files over IPFS and how much bandwidth and data can we serve?

IPFS is the future of file sharing especially with more and more modern browsers are adapting it by default eg Brave and Opera.

meezaan commented 2 years ago

Thats the point @meezaan , peers not peer, when more peers join the project these files will become more reliable and beter then a CDN distributed from one server. The project Quranipfs is a proof of concept and IPFS is on the early stage of development, How much cost distribuing files over CDN?!! And how mach data can we serve over CDN?!!

What makes you think a CDN runs on one server? Almost all commercial CDNs allow specification of multiple origins, and the Islamic Network CDN is no different. The assumption that more peers will make things more reliable and better is simply incorrect. It depends, like I said before, on the reliability and connectivity of each peer. Peer to peer networks do not guarantee consistent performance. Besides, this idea of when is a fairy tale - any problem needs to be solved here and now, not at some point in the future. I don't have any problems using an IPFS network to share stuff, but using it as a CDN would be plain wrong.

The inverse, how much cost distribuing files over IPFS and how much bandwidth and data can we serve?

How would the cost of operation be any different? Everyone has to pay for servers they provide to join the network and everyone has to pay for bandwidth. Then to actually be able to use IPFS as a CDN, someone still needs to pay for GeoDNS, failover, etc. etc. If anything, you could save money on bandwidth because you would not have to pay money to sync files all the time across your origins. This cost is something you would only be aware of at scale. The amount of data you distribute over a CDN or IPFS network is no different. You are restricted only by the CPU and memory required to serve HTTP requests and the network pipe.

Cost of storage - IPFS will be more expensive as it requires block storage. Object storage is 5 times cheaper than block storage at providers like Linode, Digital Ocean and Vultr, but it can't be used with IPFS.

IPFS is the future of file sharing especially with more and more modern browsers are adapting it by default eg Brave and Opera.

File sharing and a CDN are 2 different things. I think you need to understand that first. It's like comparing a ream of linen (IPFS, which a protocol) to jalabiya stitched of cotton (CDN, which is a finished product ready to use but uses a different protocol from IPFS - HTTP).

meezaan commented 2 years ago

I'll close this issue now as GitHub is not really the place for this discussion. Happy to continue it on Discord or https://community.islamic.network.