I'm looking for a decentralized database for my Dapp. I found two helpful solutions orbitdb and gun but I couldn't realize the main difference and which one is more suitable for a social-media-like application that use ethereum smart contract.
GUN. js is a real-time, decentralized, offline first, graph database. Sure is a mouthful. Knowing a little bit about decentralized architecture we can understand the other features. Under the hood, GUN allows for data synchronization to happen seamlessly between all connected nodes by default.
GunDB is the Open Source Firebase alternative, a web3 data protocol. How it works. (1) Sync directly between your devices & friends. (2) Reclaim ownership and control of your data. (3) Experience a web that is truly free and open.
I'm the author of gun. I've seen OrbitDB floating around (ha, pardon the pun!) but obviously am not intimately knowledgable about it enough to speak about it. I'll leave that for them to answer. :)
It does look like OrbitDB also uses CRDTs, which means they are probably doing things right/correct. Very few people are using CRDTs, which is sad, but makes GUN pretty unique! Despite the last 4 years I've been trying to evangelize to people that they should use CRDTs, I welcome it.
Maybe a practical way to answer your question, @maroodb , is around GUN's use case for social media:
Yes, GUN is already being used for P2P social media dApps. You can do:
Here are some links that show demos, and other resources, that might be helpful in building your app:
And of course, a super friendly chat room of Open Source developers helping each other out build these kind of stuff, https://github.com/amark/gun ! :)
You'll have to ask OrbitDB for their examples/use case for P2P social networking dApps, maybe they know what makes gun different.
Note: A GUN+IPFS adapter will be out soon.
Ethereum is great, but your social network might not scale up if it is implemented primarily as an ethereum smart contract, just as a warning.
We recommend you use Ethereum for any cryptocurrency payments or transactions for your user (not GUN or Orbit).
But we do not recommend building basic social network features (profile info, posts, messages, etc.) using Ethereum.
Likely, 90 to 95% of your app will be GUN or Orbit, and possibly only 3 to 5% smart contracts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With