3 ms·
Ask HN: if not SQL then what?
There are plenty of public complaints about SQL lately, and there were some hot discussions here on HN about SQL/NOSQL.
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.
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)?
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 17y agoAnyone 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 17y agono 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?
- smikhanov 17y agoI guess some sort of hierarchical queries are meant here. I.e. TREE_NODE table containing ID and PARENT_ID. You cannot query all parents of a given node using simple SQL.
- Robin_Message 17y agoA family tree can be stored in an SQL database, but you cannot query them easily - e.g. Who is the first common ancestor between these two individuals?
- yummyfajitas 17y agoConsider 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 17y agoPerfect. Thanks.