mafintosh / hyperdb

Distributed scalable database
MIT License
753 stars 75 forks source link

Optimal HyperDB usecases #34

Closed mjp0 closed 6 years ago

mjp0 commented 6 years ago

I'm been researching browser supporting distributed databases and hyperdb looks fantastic. Another project with similar attributes I found is Gun (https://github.com/amark/gun).

HyperDB uses append-only logs behind the scenes while Gun is more traditional distributed database scheme but I'm curious if somebody could elaborate for which usage scenarios HyperDB is "better" than Gun? Gun seems to have more flexible query system but their data privacy & encryption still seems to be in alpha or beta stage. As far as I can see, technically both have pretty much similar decentralized properties with fault-tolerance etc.

HyperDB seems less resource-heavy than Gun and it has a certain lovely simplicity but is there something else I'm missing where HyperDB shines?

hackergrrl commented 6 years ago

I'm curious to hear about this too. I just did a bit of reading on gun, but didn't come out with a too clear understanding of how things work underneath.

m-onz commented 6 years ago

The simplicity and lack of opinions HyperDB has makes it more flexible and useful. You can create a SQL-esque/Graph/Nosql CQRS (many read models) based on an append only log.

I personally enjoy the small size and simplicity of HyperDB over something like Gun... Gun seems to be breaking the modularity principle and includes a hell of a lot of stuff that you may or may not need.

mafintosh commented 6 years ago

@0fork hyperdb really shines when doing secure partial replication (meaning you wanna replicate a set of folder as fast as possible from untrusted sources). having said that i like to see it as a kinda distributed leveldb, meaning a lowlevel easy-to-grok db you can build amazing things on top of :)

mjp0 commented 6 years ago

@mafintosh makes sense and pretty much what I had in mind also. Something like distributed leveldb would be fantastic indeed. For distribution part to be usable in real-life scenarions, hyperdb needs key revocation (as discussed in #55). I’ve been contemplating about building this into hyperdb myself because key revocation is literally the only thing preventing me from using hyperdb for anything right now but I’m a bit unsure whether I still understand the data structure and replication well enough to get it right.

@m-onz I agree 100%. The biggest issue with Gun for me is that it looks fragile because there’s many different parts that are in alpha or beta but still advertised as functionality. I have multiple use cases for something like Gun and Mark is doing fantastic job but until I find the time to evaluate it in depth, I just don’t want to take the risk.

m-onz commented 6 years ago

Maybe close this? I'm not on IRC but it would be nice to have a place for discussion of this type that is not github issues.

emilbayes commented 6 years ago

@m-onz there's also a gitter bridge to the dat channel :)

mjp0 commented 6 years ago

@m-onz Closed it for you. At least all my questions were answered.

m-onz commented 6 years ago

@emilbayes Sweet I will try and find that! @0fork Thanks for the thread... lets try and preserve it someone. I might make a blog article when I finish updating my website.