Live data from Hacker News

Ask HN: If you've used a graph database, would you use it again?

news.ycombinator.com

71–80 of 84 posts

Re: Ask HN: If you've used a graph database, would you use it again?

#71
post #56
post #48

There is a lot of stigma attached to graph DBs. Would it provide good performance? Should I ever use it as my primary database? Is my data ever safe with a graph DB? If we go beyond that, assuming there was one which provided great performance, data integrity and can be reliable as a primary database — then Graph DBs are just better. First, the schema and data modeling is incredibly simple. Our minds think in graph t…

The film industry example makes sense. Partially duplicative tables make development confusing. Do you still feel there is an advantage of graph over relational when we have a known schema and known relationships without deep recursive relationships. For example, an inventory tracking system, we have items, customers, deliveries,etc...? I like the idea of being able to throw some metadata onto any of those tables qui…

Not only do I think there's a lot of benefit in representing data for which the schema is already fixed, we've actually gone to the extent of showing this by building a whole replica website for Stack Overflow.

https://github.com/dgraph-io/graphoverflow (unmaintained, so please don't complain if it doesn't work :-)).

If you build systems like inventory tracking, question answering, etc., the hard logic of relevant data retrieval can either lie in your application or within your DB. Former is the case when you use relational DBs, latter is the case when you use graph DBs.

With graph DB, you can put the data together quickly, but then have the DB do the hardlifting of "given a customer, find me all the items and the locations of delivery" (just random Q that I spent 2 seconds, not representative of real workload); or "given a question, find me all the answers, sorted by a score; top 5 comments on these answers sorted by date, with a count of total comments, count of likes, count of dislikes, etc." (real workload for QA sites). Then the application iteration becomes largely a factor of query iteration, not backend logic iteration.

^ And that's solid! That kind of stuff is what makes developers love JS over C++ (random comparison).

Re: Ask HN: If you've used a graph database, would you use it again?

#72
post #35
post #22

Earlier quoted context omitted.

> "Claiming ACID" what is ambiguous about that? Transaction support with different serialization levels, like other databases that offer it. A non-graph-database would not provide operators like deep traversals. Operations are tightly bound to ACID as a whole, not just isolation. Of course ACID would always hold if you strictly linearize everything, but that defeats the purpose of data management, and one would achie…

> A non-graph-database would not provide operators like deep traversals You can do this with a recursive common table expression.

Recursive CTEs are breadth-first, which may not always be what you need.

Re: Ask HN: If you've used a graph database, would you use it again?

#73
post #31

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 entire…

You need a hypergraph database!

Re: Ask HN: If you've used a graph database, would you use it again?

#74
post #70
post #53

Earlier quoted context omitted.

> We were solving this problem with Google's knowledge graph where we had to fit movie dataset in DB. The film industry has so many roles (director, producer, actor, cinematographer, and so on), that having a table for each, with many times same person doing multiple roles, is just super fucking hard. With hundreds of such roles, each role being a table would be insane. Representing this information in graphs is a ca…

Yeah, we were doing that with intermediate nodes. So, Bob -worked_at-> Work node Work node -from-> date Work node -to-> date Work node -employer-> WB, Disney, etc. Then each instance of Bob working would be a node in the graph. Note that (and this might be counterintuitive) this is the same as how you'd represent marriage data as well. These intermediate nodes are the only complexity that one has to think about in a…

Thanks, going to have a go at re-sketching with intermediate nodes!

Re: Ask HN: If you've used a graph database, would you use it again?

#75
post #31

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 entire…

Maybe you want a hypergraph? http://www.hypergraphdb.org/

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 again?

#76

Earlier quoted context omitted.

Is there a particular RDF store which you would recommend? It seems scaling is a bit of an issue with Apache Jena. It's very easy to bring to entire system to a crawl with certain sparql queries and enough data in the store.

Semi-related, is there a good in-browser RDF store? Say something like what PouchDB does for CouchDB (and similar) JSON document stores. For as important as RDF has been for the web, it feels increasingly less "web native" today as most efforts still seem to be highly Java-focused and Browsers mostly don't run Java anymore. (I ask because a silly project idea I have some tiny amount of notes for is something of a Twi…

This is probably the closest: http://linkeddatafragments.org/

Re: Ask HN: If you've used a graph database, would you use it again?

#77
We have a production system based on Neo4J (and Elasticsearch). We have had some hard times with Neo4J (cluster issues, deadlocks) but their support helped us figure out those issues.

Honestly, a graph database made discussions with the domain expains MUCH easier. And the schemalessness made evolutions much easier. Our technical team embraced the concept really quickly. And the domain experts have a clean mental model of the data that were otherwise split between very unfriendly technologies (XML databases, files, CSV).

We wonder whether Elasticsearch could be removed from our architecture (because managing 2 databases is a mess). But we do not know yet if Neo4J can handle both the load and the variety of search use-cases.

Re: Ask HN: If you've used a graph database, would you use it again?

#78
post #69
post #45

Earlier quoted context omitted.

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. )

Aren’t RDF stores synonymous with triple stores?

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 again?

#79
post #29

I've been using RDF and triplestores / RDF databases for the last half-decade, developing both front-end and back-end systems, and training many developers to work in RDF. If you're used to either relational databases or object-oriented design, it's a really different way of thinking about data. Just like OOP is really good for certain kinds of problems and models, and RDBMS is good for other kinds of problems and mo…

Do you know if there's off-the-shelf software (GUI) to create/edit/explore your own RDF dataset? Or does it always involve building your own front-end?

May be you can have a look at Datao: http://datao.net.

PS: I am the maintainer, and we currently have some certificate issues. Drop me a mail to datao@datao.net if you want to be notified when the problem is solved.

Re: Ask HN: If you've used a graph database, would you use it again?

#80

Earlier quoted context omitted.

Is there a particular RDF store which you would recommend? It seems scaling is a bit of an issue with Apache Jena. It's very easy to bring to entire system to a crawl with certain sparql queries and enough data in the store.

Semi-related, is there a good in-browser RDF store? Say something like what PouchDB does for CouchDB (and similar) JSON document stores. For as important as RDF has been for the web, it feels increasingly less "web native" today as most efforts still seem to be highly Java-focused and Browsers mostly don't run Java anymore. (I ask because a silly project idea I have some tiny amount of notes for is something of a Twi…

At the moment, I use N3.js for its N3.parse() function. It builds a graph of Javascript objects in memory from a RDF string, just like a JSON.parse() builds a tree of Javascript objects in memory from a JSON string.

Note: I have never understood the need for a DB on the client-side.

Post reply on HN