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

I think if you're aiming for any sort of broad adoption (are you?), then you'll have to add... SQL.

This may sound like heresy, but in practice the following line is going to be a showstopper for most people:

  Peer.q("[:find ?entity :where [?entity :db/doc \"hello world\"]]", db); 
I don't want to learn a new query language. And I'll most certainly not even try to re-train my team on it. Maybe later I'll become curious about that fancy datalog-language to enable advanced features. But in the beginning, if you want my mindshare, you'd better spoon-feed me.

Take this lesson from cassandra. They started out with Thrift and an extremely cumbersome query-interface, which fit the cassandra data-model perfectly but not the brains of the developers.

Now recently they exposed their query-language as a SQL dialect, and suddenly cassandra is a joy to use.

You should do the same. It will be a lossy abstraction. You'll need weird, non-standard constructs to accommodate the peculiarities of your model. Purists will cry in horror.

BUT: It will look like SQL and roughly work like SQL. Everybody and their dog already knows SQL. People can jump in and bang out "select foo from bar ..." without thinking. People can re-use an entire galaxy of SQL-related tooling and knowledge that has evolved over decades. Most importantly: People can start with something they know and then adapt at their own pace to the great new things that your datastore enables.

Don't underestimate this if you're aiming for the mainstream.



I'm pretty sure SQL will be added to datomic over Rich Hickey's dead body, and that's a good thing IMO.

There are already enough SQL databases in the world. rhickey isn't looking to make a 'me too' database, he's interested in improving the state of software development.

SQL is a terrible language and needs to die. It's fine that we disagree, but don't tell the people who are convinced it's a bad idea that they need to 'join' the mainstream.


It's not about making a "SQL-Database". It's about providing an interface that resembles something people are familiar with and that can be reasonably fluently typed in a REPL without breaking fingers. Just like Cassandra did with CQL and hbase does with HQL. SQL-syntax just happens to have stood the test of time for this kind of application.

SQL is a terrible language

No disagreement here. Just out of curiosity, what would you call this language then: [:find ?entity :where [?entity :db/doc \"hello world\"]]?


Clojure exists because rhickey didn't like the current state of programming languages. Dataomic exists because rhickey didn't like the current state of DB design. SQL is an anti-goal.

"Familiarity" is a terrible metric for new things. New things are not always familiar. As rhickey said in one of his talks, there's a difference between what's simple, and what's familiar. "I don't know German, does that make it unreadable?". German may or may not be the ideal thing, but the fact that it isn't english is not an argument against it.

> Just out of curiosity, what would you call this language then: [:find ?entity :where [?entity :db/doc \"hello world\"]]?

Datalog (or a dialect of it). Datalog is a variation on prolog, designed for querying databases. Just as there are many lisps, there are many datalogs. This one is interesting because datomic querys are valid clojure data structures. It's a great example of code as data. It's trivial to write clojure functions that return data that can be passed as a query to datomic. If you wanted, you could probably even write datomic queries that return other queries. Try doing that with SQL ;-)


Thanks, I understand (now).

I made my first comments under the assumption that this aims to be a general purpose database, but multiple people have made clear now that this is not the case.

Obviously it makes no sense to argue for an intermediate QL (and one as half-baked as SQL) when the project is ultimately aimed at Lisp-purists[1].

[1] This is not meant derogatory, it's just a critical distinction from a DB that, say, my junior-admin who knows his SQL and Python and not much else could be expected to get along with.


Just out of curiosity, what would you call this language then: [:find ?entity :where [?entity :db/doc \"hello world\"]]?

What exactly do you see as the problem with this example? Or with SQL for that matter?

Honestly, I'm interested in what your criticism is. Is it the syntax?


Yes, the syntax (or lack thereof, whichever you prefer).

Obviously I'm not entitled to tell anyone how to design their databases. I'm just saying there's good reasons why so many DBs stick to a SQL-like syntax, and that is because the alternatives are usually worse (think: familiarity, tooling, scripting, REPL, etc.).

For example, using the MongoDB REPL, which is probably close to what a datalog-REPL would look like, is rather painful.

This may all be a non-issue when a LISP-language is exclusively used on the client-side. That query-style probably just snaps in naturally there (I don't know lisp).

But if the database is supposed to be general purpose, accessed with lesser languages, scripted, quickly fixed by half-drunk humans at 4am in a REPL... then it certainly matters to have a sane intermediate lingo. Otherwise, at the least, every client-platform is going to invent their own.

I think the example of Cassandra is really a good one to study. They went through an interesting learning-process that seems very applicable here.

Edit: Please see my other comment above. It seems I have misunderstood the project goals and this is in fact not meant to become a general purpose DB. Under that premise my concerns obviously don't apply...


Datomic is, as far as I'm aware, a general purpose database. What it isn't designed to be is a familiar database.

SQL is what people are familiar with, and even some NoSQL databases have distinctly SQL-inspired query languages (e.g. SimpleDB). The problem is that SQL is a godawful query language, and if we want to do better we need to do something different, and therefore unfamiliar.

SQL tries to look like natural language, which has resulted in a syntax is complex, inconsistent and monolithic, just like the language it tries to imitate. If we want a syntax that is simple, consistent and modular we need to throw away the idea that a query needs to read like English.


This isn't obvious if you don't know Clojure, but that's actually a data structure. In Datomic, queries are data you pass to the database, not a special syntax at all.


Knowing the guys on the development team for datomic, I think their #1 concern is to produce a highly reliable and well-designed system.

Also, they are big on developing systems that are very modular, and since datomic is built on Lisp, adding a SQL frontend would certainly be very easy (like a weekend project.)

I'm sure once these guys have higher priority features addressed, you'll see a SQL feature as well (if folks from the clojure community don't beat them to it and create it first.)


Davy Suvee created a Dataomic Blueprints implementation (http://datablend.be/?p=1641) so you can run Gremlin (https://github.com/tinkerpop/gremlin/wiki) queries on it.




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

Search: