Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I dont know why people use relational databases other than they were first and “that’s the way it’s always been done”.

Why not use a graph database? O(1) lookups instead of O(N). Why need indices if you can just point to the data. Why use JOINs when map-reduce querying is far more flexible?



They were not first.

ISAM and VSAM come to mind. Yes it says "files" in there a lot but it got used like a database with programming interfaces like finding records in a database. If you will this method is more like NoSQL databases than a relational DB. The I in ISAM was a step towards not having to know the key (true "NoSQL"). Kind of like today's NoSQL databases all also give the ability to add indexes now.

https://en.m.wikipedia.org/wiki/ISAM


You aren't describing a property of a graph database. You're describing a property of some set of key value based systems.

The reason why you want indices is because some query patterns don't have a key to perform a look up on.


I've been interested in learning more about them and how to best utilize them in my company. What graph database and query language would you recommend (regardless of stack)?


1. Memgraph 2. Neo4j

As for query language: definitely Cypher!


You might want to read Codd's paper: https://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf


How do you do constant time lookup an graph databases?

My intuition let's me know that you can not get below O(n log n) (Lower limit for comparison based ordering)


> My intuition let's me know that you can not get below O(n log n) (Lower limit for comparison based ordering)

That intuition should point at O(log n), shouldn't it?

In any case, it totally depends how your data is stored and how/what you want to look up.

If you already have some kind of id of your node in the graph you want to look up, you can get O(1) lookup and still call it a graph database. If you have to traverse the graph, then it depends on the structure of the graph and where your entry point is, etc.

I'm rather skeptical of graph databases. Whatever they can do, you can do with a relation database and datalog. (Think of datalog as SQL plus recursion, perhaps.) See https://en.wikipedia.org/wiki/Datalog




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: