News for hackers. Stuff that matters.
Re:Ask HN: If you've used a graph database, would you use it... by gr__or on Thursday March 08, 2018 @06:15AM (#16543669)
I used Neo4j for a few side projects but my go-to is still PostgreSQL. The largest flaw I see with Neo4j (and probably other graph databases as well) is that it forces you to think of your entities as either vertices or edges and that line tends to be not as clear as you might expect.

For example: (:Person)-[:BEFRIENDS]->(:Person)

If we'd want to store a date with that relationship, Neo4j got your back, that's entirely possible (= relationships can have attributes). But now our requirements change and we'd also want to have an entity for Events shared by friends (e.g. friendship anniversary), now we have to remodel our data to something like:

(:Person)-[:IS_IN]->(:Friendship)-[:HAS]->(:Event)

In SQL that wouldn't have been a remodel, because there's no difference between a relationship and an entity. We would've gone from:

Person(id) Friendship(person1_id, person2_id)

to:

Person(id) Friendship(person1_id, person2_id) Event(friendship_id)

So I feel like the vertice/edge distinction Neo4j makes, gets in the way of changing data model needs and I ultimately think that modeling your data as a graph is not helpful. Though it can be extremely helpful in querying and that's where its biggest strength lies.

Re:Ask HN: If you've used a graph database, would you use it... by krona on Thursday March 08, 2018 @08:39AM (#16544216)
The problem you're describing is mostly attributable to property graph stores, and doesn't apply to named graph engines.

This is the essential difference between neo4j (a property graph engine) and most RDF stores which support quads (i.e. <subject> <predicate> <object> <context>)

Re:Ask HN: If you've used a graph database, would you use it... by kuwze on Thursday March 08, 2018 @05:25PM (#16548274)
Aren’t RDF stores synonymous with triple stores?
Re:Ask HN: If you've used a graph database, would you use it... by lolive on Friday March 09, 2018 @08:36AM (#16551600)
RDF is the serialization format for triples. The triple store is the database that stores triples.
Re:Ask HN: If you've used a graph database, would you use it... by moxious on Thursday March 08, 2018 @08:33AM (#16544188)
I see what you mean. And yet strangely, the need for that "Friendship" node can also be seen as a strength. How else would you assert metadata about that thing otherwise?

If A and B share an event via a friendship, you can keep track of things about that. Granted in an RDBMS if all you wanted was to draw the line then you could do it with an extra FK, but I think the conclusion you're drawing is going too far, specifically:

> In SQL that wouldn't have been a remodel, because there's no difference between a relationship and an entity

There is a difference in SQL; relationships are EITHER more columns, OR a join to another table, both are possible. In graphs, "hyper relationships" (e.g. relating more than 2 things) require another node, but this is apples/oranges comparison.

Re:Ask HN: If you've used a graph database, would you use it... by gr__or on Thursday March 08, 2018 @08:49AM (#16544274)
I probably should've clarified that I was talking about n:m-relationships. And for that case I don't see how it would've been an apples/oranges comparison.
Re:Ask HN: If you've used a graph database, would you use it... by pikchurn on Thursday March 08, 2018 @08:40AM (#16544225)
Maybe you want a hypergraph?

http://www.hypergraphdb.org/

Re:Ask HN: If you've used a graph database, would you use it... by vinceguidry on Thursday March 08, 2018 @10:01AM (#16544684)
I wish this were a networked database that I could just slap on a Digital Ocean droplet and query from anywhere.
Re:Ask HN: If you've used a graph database, would you use it... by gr__or on Friday March 09, 2018 @04:37AM (#16550696)
Interesting, never heard of the concept. Thank you, it seems to indeed solve that exact problem.

I hope something like this becomes as mature and usable as Neo4j.

Re:Ask HN: If you've used a graph database, would you use it... by optevo on Friday March 09, 2018 @12:35AM (#16549997)
You need a hypergraph database!
Re:Ask HN: If you've used a graph database, would you use it... by sjg007 on Thursday March 08, 2018 @10:39AM (#16544968)
Seems like a hybrid datastore is ideal then.