16

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.

maroodb
  • 848
  • 9
  • 24

1 Answers1

20

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:

  • User account systems, including traditional username/password, and password reset (no server, fully P2P).
  • Published user data, like tweets, etc. that cannot be tampered with by anybody else (signature encryption, but not private).
  • Private data to the user (cypher encryption).
  • Secret data between 2 users, like private messages (diffie-hellman).
  • And we're currently working on making it easier to do group read/write data, which is possible, but no demos yet.

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.

marknadal
  • 6,564
  • 4
  • 20
  • 20
  • thank you Mr for your clear answer. I will take a look about orbitdb and then I will choose the suitable or why not use both of them! in fact I will not use ethereum as a business logic, but just for some use cases to verify integrity etc .. – maroodb Apr 24 '18 at 21:16
  • can we execute query on gun ? and how does it persist data? – maroodb Apr 25 '18 at 21:58