3 ms·
Thanks for the comment! I'll start with what you should not use gun for: It is a strong eventually consistent system (AP if you are familiar with the CAP Theor
by marknadal 10y ago
Thanks for the comment! I'll start with what you should not use gun for:
It is a strong eventually consistent system (AP if you are familiar with the CAP Theorem) which means it is a bad choice for banking/accounting. You should use a strongly consistent system like RethinkDB or Postgres instead.
Some things that people are using gun for are:
- Distributed Machine Learning ( http://myrighttocode.org/blog/artificial%20intelligence/particle%20swarm/genetic%20algorithm/collective%20knowledge/machine%20learning/gun-db-artificial-knowledge-sharing http://myrighttocode.org/blog/artificial%20intelligence/part... )
- Multiplayer VR games in the browser with WebGL.
- Realtime IoT data viz with webcomponents. ( https://github.com/Stefdv/gun-ui-lcd https://github.com/Stefdv/gun-ui-lcd )
- Peer-to-Peer electron/react-native fully encrypted social networks.
How it compares to PouchDB? PouchDB is great! They pioneered offline-first before people had even termed the phrase, very much were forward thinkers. The biggest difference is that Pouch/Couch is a document database while gun is a graph database which can support key/value, relational, document, circular references, or graph data structures. I haven't used Couch since 2011 though, so I can't speak to any of their more recent features, but their latest release looked really solid.
NoSQL was definitely a fad, so I don't blame you for not being able to wrap your head around it. We plan on introducing a SQL query extension for gun within the next 8 months. SQL is great, relations are great, and the NoSQL/document-only hype hurt the industry although it was based on some legitimate needs.
From my perspective there is no question that Postgres should be considered the best solution for Master-Slave query based databases. I do predict, obviously biased though, that the industry will slowly migrate towards Master-Master push based graph databases though. And my experience with gun, the VC funding I've raised, the pain points I've had and heard from others, and the traction we're getting is confirmation of that (or confirmation bias?).
Preventing invalid data from being saved is as simple as adding a schema ( https://github.com/RangerMauve/gun-schema https://github.com/RangerMauve/gun-schema ). Preventing hackers is as not-simple as using real end-to-end cryptography, but we're making an explainer video series to try and help consolidate these ideas for people ( http://gun.js.org/explainers/data/security.html http://gun.js.org/explainers/data/security.html ). Or you can opt to use gun in a traditional centralized server setup where all reads/writes are proxied by your app's routes, like you would normally do with any other database.
Anything else I can answer? Thanks for asking these questions!
- philippnagel 10y agoI'm currently building a P2P web app/social network that ideally should run completely in the browser and haven't looked at Gun before. Can Gun be used on top of IndexedDB? You mentioned "Peer-to-Peer electron/react-native fully encrypted social networks". Can you point me to any repos? Thanks!
- marknadal 10y agoAwesome idea! What are you building it with, then? Yes, IndexedDB has a Level down adapter which should work with GUN's Level up adapter: https://github.com/PsychoLlama/gun-level https://github.com/PsychoLlama/gun-level (or however the naming works). I don't actually know how to do this though, so ping Jesse (psychollama) if you have any problems. The best repo is a barebones P2P encrypted auth example using polymer (not electron or react native): https://github.com/swifty/gun-p2p-auth https://github.com/swifty/gun-p2p-auth , git clone it, then open ./demo/standalone.html and try the login/register forms after you run a gun server (npm install gun, cd ./node_modules/gun , node examples/http.js 8081). Let me know if this worked. If you got stuck on anything absolutely let me know so I can help. :)
- philippnagel 10y agoGreat, thanks! Currently building the app on top of http://ssbc.github.io/scuttlebot/ http://ssbc.github.io/scuttlebot/.