We had a crazy idea: what if we could make a cloud-file-storage service, but not pay for any server space? Pretty crazy right? How would we even do that? Simple: what if we could leverage the unused space on client PCs to store other users files? If we could accomplish this, then nfinite.space could theoretically offer it's users with near infinite space, with no overhead cost of maintaining expensive datacenters.
What it does
Users can upload files, and instead of hosting those files on the server, the server breaks up the file into many chunks, duplicates those chunks for redundancy, and distributes them across connected peers hard-drives. Later, when the user requests their file from the server, the server simply calls the peers that have the file-chunks, and reassembles the file on the server, then sending the file back to the user. By having multiple copies of the same file-chunks stored across multiple different peers, we can ensure that even if one peer containing a certain file chunk does offline, the user would still be a able to get their file back.
Each user starts with 5GB of cloud storage, and if they want more, they have 2 options: 1) purchase more storage 2) offer up some of their storage to nfinite.space, in exchange for a multiple of that space in the cloud (e.g.: 1gb locally = 10gb)
With nfinite.space, our mantra is "give a little, get a lot"
How we built it
Our server-side is written in Go, with CockroachDB for storing important metadata, but no user files are ever stored on the backend. Our web-client is a React app. We run on AWS.
Challenges we ran into
- Complex logic for handling file-splitting & recombination server-side.
- Websockets on both the client and server were tricky at first, especially since the server was in Go, and the client was JS.
Accomplishments that we're proud of
At this point, we have a fully-functional, scalable, and extensible backend and frontend for Nfinite.space
What we learned
How to use CockroachDB, which we've never used before. How to write server-side services in Go. (At least for one of us) How to write React
What's next for Nfinite.space
- Performance and encryption improvements.
- Having the server inform the client about which other clients are storing their files and then using WebRTC for a BitTorrent-like P2P download, instead of having a central server do all the file splitting / recombination.