

Ask HN: if not SQL then what? - smikhanov

There are plenty of public complaints about SQL lately, and there were some hot discussions here on HN about SQL/NOSQL.<p>I have a toy project in Haskell, an in-memory DB implementing some limited subset of SQL and transaction support. I started doing this to first learn more about STM, then lightweight threading (forkIO). I implemented JDBC binding too, and can use it from Java.<p>Every time stumbling upon the SQL/NOSQL debate I feel myself a dinosaur: I work on SQL DB and there are some folks in the Valley who have a periodical meetup against SQL. The question is: if not SQL then what? What are the problems with SQL (I'm not addressing particular SQL implementation problems and standards compliance here, just the language implementing relational algebra per se)?<p>For example, document-oriented DBs look nice, but what's the fundamental advantage? Key-value stores look oversimplified to me. Any other approaches I missed?
======
yummyfajitas
Anyone who is meeting up _against_ SQL is a moron. SQL is a great solution 90%
of the time and only a fool says otherwise. You should use SQL until you have
a good reason not to.

10% of the time it doesn't work. It will fail due either to performance
(compare memcached to any SQL server) or expressiveness (e.g., no SQL query
will give you the path in a graph). You'll need a different NoSQL solution for
either case. Key value stores are great when you need performance without
features. Object databases are great when you need to map OO into the DB.
Tree/graph databases are great when you need to store graphs.

I think the main reason we have a NoSQL movement is that before the social
web, SQL was a great solution 98% of the time.

~~~
david927
_no SQL query will give you the path in a graph_

Could you explain what you mean there? Do you mean the path of how a graph was
traversed?

~~~
yummyfajitas
Consider a graph, e.g. the facebook friend graph. You can't write a SQL query
which will determine if I'm connected to Kevin Bacon and via which friend.

SQL expresses first order set theory, but graph connectivity is not a first
order property.

~~~
david927
Perfect. Thanks.

