News for hackers. Stuff that matters.
Re:Gun – Distributed, embedded graph engine by _dark_matter_ on Monday April 14, 2014 @02:41PM (#7587974)
This title is bad. It's not an embedded database engine. It's not a database at all. The author mentions this directly in the article (How are you different from every other database that is trying to reinvent the wheel? 1. Because gun is not a database (NoDB), it is a persisted distributed cache.)

There are other possible issues, but this short summary doesn't give nearly enough information about the system to make a possible determination on its efficacy. I will be interested to see further work.

Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @02:46PM (#7588009)
Hey _dark_matter_,

Thanks for the comment! I'll be doing follow up posts soon on the technical details of my conflict resolution algorithms, and will be preparing Jepsen tests for gun. I just wanted to formally announce this now, though, as I have a tendency to overly-perfect stuff, and getting feedback early on is great. Mind listing things you would like me write in-depth posts on? Thanks for the feedback!

Re:Gun – Distributed, embedded graph engine by _dark_matter_ on Monday April 14, 2014 @02:59PM (#7588072)
Hey Mark, I'm interested in several different features.

First off, you make a great point about "Hosting your own database is a pain" and/or expensive. I'm sure you know about the raging debate that has been happening between MapReduce and Parallel DBs, and a big part of the reason that MapReduce (Hadoop) style has had so much support is because it's easy and cheap. In lots of instances it may run slower, but why pay for the hassle when you can just run Hadoop for free (not including server costs)? You're making the same point here. Whats the threshold on money savings? How much does it cost to use a DaaS (SQL or NoSQL) compared to what you want to do with Gun/Redis? (Also, is this going to be open source?)

Next, the conflict resolution should be interesting. What kind of eventual consistency guarantees are you hoping to have? I see you're planning on addressing this.

I'm also interested in the querying. That is, are you using Javascript? My problem with what you're saying about current query languages is that it's not really that hard to get the bare usage out of them. Simple queries in SQL are extremely straightforward. In addition, declarative languages really make things easier for the programmer, not harder. Who wants to have to deal with all the nuances of a join? Certainly not me.

Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @03:45PM (#7588374)
Realistically I won't have cost-comparisons for a while, as this project is just in the infancy and obviously needs to stabilize/mature first. Although as a quick summary, your costs should approximately be server(s) that are expensive enough to fit your smallest set of per-user active-data, plus your S3 storage amount, plus S3 API calls (I've made this part a simple options parameter, so you control how often these calls are being made - the more frequent, the more integrity from worst-case disruptions but also more expensive, less frequent and your costs go down).

What is worst-case disruption? Everything goes offline simultaneously. User's don't have localstorage fallbacks in their phone/browser so retries rely on the server cache. The server cache is running the default method, not Redis - and then your server crashes or the machine goes under. And finally, of course, there is an S3 outage and you only persisted to 1 region, not multiple regions.

I'll get into hairy situations like that in some of my following posts, but too much for here.

Yes, you have another good point about query languages. I agree with you very much - somebody else commented about this, check out my reply to muaddirac. Please keep in touch with more questions/comments, or even email me!

Re:Gun – Distributed, embedded graph engine by opendais on Monday April 14, 2014 @02:45PM (#7587996)
Exactly. "...this isn't a database" :/

Distributed caches aren't new either. [e.g. https://github.com/golang/groupcache ]

Can we get a title change to something that labels it a Distributed Cache? [e.g. Shown HN: gun – Massively Distributed Cache ]

Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @02:47PM (#7588019)
opendais, I'm curious if these other distributed caches actually support persistence? I wasn't able to find such a system. But I'm limited in my research, I'd love to learn more about other people's work! Please share more!
Re:Gun – Distributed, embedded graph engine by robterrell on Monday April 14, 2014 @02:58PM (#7588068)
Reminds me of running pouchdb in the browser and couchdb on the servers. Except for the automatic conflict resolution bit, which of course is where the real magic is.

> It gets data synchronization and conflict resolution right > from the beginning, so it never has to rely on vulnerable > leader election or consensus locking

Super curious about how this works.

Re:Gun – Distributed, embedded graph engine by daleharvey on Monday April 14, 2014 @04:19PM (#7588610)
Just as a note, conflict resolution is fairly close to automatic in PouchDB, its a matter of listening to the changes feed and providing a function which combines conflicts into a seperate document, in future versions we will make this a lot more seamless.

That aside, reading this it does sound similiar to PouchDB, we are also working on automated provisioning of servers (https://github.com/daleharvey/janus). Excited that more people are working on and becoming aware of similiar infrastructure.

Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @03:20PM (#7588200)
People are demanding answers to this the most, so it'll probably be my first follow-up post.
Re:Gun – Distributed, embedded graph engine by opendais on Monday April 14, 2014 @02:53PM (#7588042)
http://ehcache.org/ http://ehcache.org/documentation/configuration/fast-restart#...

Based on a quick googling, this looks like it would be an example of that. Frankly, I don't normally want my cache to persist so it isn't something I know much about. [e.g. I store persistent data in Cassandra or MySQL]

Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @03:12PM (#7588154)
You hit on a really good point, in the several years that I've worked in the synchronization field (I do consulting) I've found that it has actually been harder to deal with /what you don't want to sync/ than with what you want to sync. It would be really bad if our temporary variables that are used on the client and server to do transformations on our actual data got somehow jumbled up into our real data.

I have some clean delineations for this, but wow - I didn't know that this was going to explode so quickly. If I had known, I would have prepared some more resources and materials to explain this stuff. That said, everybody who signs up on the mailing list will get notified about the posts I will write on this! I'm looking forward to getting some serious counter-arguments/refutations to challenge gun.

Re:Gun – Distributed, embedded graph engine by danbruc on Monday April 14, 2014 @03:53PM (#7588426)
I would like to hear about the way you address the semantics of the data for merging. For example if the number of items in stock has a conflict because one node reports a 500 -> 1000 change and another node reports a 500 -> 400 change, then I probably want the result to be 900. If the same conflict occurs for the budget of something, then I probably want either 400 or 1000 but not 900.
Re:Gun – Distributed, embedded graph engine by marknadal on Monday April 14, 2014 @05:55PM (#7589187)
I'm not entirely familiar with your example cases, but the seem to be indicative of something where you would want strong consistency. By default, gun is only eventually consistent - but this does not mean it is incapable of strong consistency, it just means you have to write/use a plugin that abstracts this on top. Obviously such a merge would be slow, because you are giving up high availability while you sit locked waiting for ACKs from other nodes. Could you expound on your example problems more so I can address them more thoroughly?

Point being, that is the beauty of eventually consistent systems, you can always combine the together to create stronger forms of consistency - but you can't go the other way. If you start with a strongly consistent system, you can't downgrade. With gun, strong consistency is not given to you out of the box - but it is capable of being built on top when needed.

Re:Gun – Distributed, embedded graph engine by DEinspanjer on Monday April 14, 2014 @03:21PM (#7588207)
Also GridGain and my personal favorite, Hazelcast.