7 ms·
I've been using Dgraph for over a year (on/off, it's a side project). I first saw Dgraph on HN. I thought Dgraph was going to be the "secret sauce" for my app
by wiradikusuma 7y ago
I've been using Dgraph for over a year (on/off, it's a side project). I first saw Dgraph on HN.
I thought Dgraph was going to be the "secret sauce" for my app after reading the list of features (maybe I was mesmerized by the cute mascot). Few months down the line, though, sometimes I question my decision and whether I should have used the good old PgSQL. Let me explain.
1. Coming from SQL and key-value NoSQL, Dgraph was very foreign to me. It's like OOP guy learning Functional Programming. Now I'm quite comfortable with it, but it took me months to be productive. To give an analogy, learning Dgraph is like learning Scala instead of Python.
2. Actually it's worse, the resources are mostly in the forum (micheldiz is my hero) and the official website. Until recently, the navigation for the docs is horrible, everything in one big HTML file, difficult to jump in from Google search result.
3. Rudimentary tooling for development phase. When you're working on a new idea for a product, you will experiment A LOT with the schema and data. When you write wrong data, with most RDMBS you can use GUI to right-click and delete or edit. In Dgraph, you must write mutation query (assuming you remember the syntax, as it is a bespoke language). Dgraph GUI is very minimal.
4. About the mutation.. in Dgraph (as far as I know) there's no referential integrity in the DB-sense. Like, you can make FK to non-existent object, or insert something invalid without returning error (but it's not stored, since it's invalid). The "integrity check" is in your app.
5. Because of #3 and #4, I find it easier to just drop the whole database and recreate it along with seed data, every. time.
6. The documentation for the Java client library is very minimal. So there you go, unfamiliarity with the query language ("GraphQL+-"), with the Dgraph itself, and with the client library.
I still use Dgraph, it's a good fit for my app, but if you're starting on a new business idea, maybe don't use anything fancy. My mistake, being a developer, I mixed research (new tech!) and bootstrapping.
(In case you're wondering, my app is http://s.id/axtiva-android-test http://s.id/axtiva-android-test -- still version 0.0.x, but recently I'm releasing weekly)
- mrjn 7y agoHmm... That's probably not the testimonial I was hoping to get from a Dgraph user. Though, I can see part of your pain is because of the custom query language, GraphQL+-. We now offer standard official GraphQL compliance as well, which tackles a lot of these issues you ran into. 1 and 2. GraphQL is becoming very common, so plenty of resources. 3. GraphQL has many amazing editors. 4. GraphQL allows for lack of referential integrity by setting certain fields in the object as non-nullable, which can remove those objects from the results and so on -- which is frankly, the thesis we have around a distributed graph database, sharded by predicates (not nodes). 5. arrr... sad. 6. GraphQL has many client libraries and so on. Hope we could change your opinion by switching you to standard GraphQL -- particularly, if you don't need the advanced features provided by plus-minus.
- jcims 6y agoTBH I think most of those complaints are true of the graph database ecosystem in general. I haven't used Dgraph but I echo the same concerns from my experience.
- mrjn 6y agoSentiments are changing now, particularly with GraphQL. Dgraph bet on GraphQL early on, and it's really catching on as a replacement for REST.
- throwaway595 7y agoYou might consider using cayley [1] instead. If you find it easier to drop and recreate the database from scratch, then you have a source-of-record (to recreate the database from) and so it might make sense to treat your graph database as the place for doing graph analytics rather than as the place for storing the source-of-record data AND doing graph analytics. Thinking of the graph database as a graphics programmer might think of the GPU might be a helpful perspective. [1] https://cayley.io/ https://cayley.io/ [2] https://oss.redislabs.com/redisgraph/ https://oss.redislabs.com/redisgraph/ EDIT: I love dgraph, and reevaluate it anew frequently. However, I've shipped cayley and this approach works. Continue down-voting this throwaway account though.