couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luciano Ramalho <luci...@ramalho.org>
Subject Re: UnQL
Date Fri, 26 Aug 2011 13:01:13 GMT
On Fri, Aug 26, 2011 at 4:21 AM, Mark Hahn <mark@boutiquing.com> wrote:
> I haven't got any good arguments yet, but I feel having a text-based
> SQL-like language for couch would be a big step backwards.  I do feel couch
> needs to expand it's query capabilities, and I trust it will.  But I would
> imagine the solution to be more modern than the old process of building up a
> query text string and sending it off.  Maybe it is just an emotional
> reaction after all the years of hating the impedance mismatch of the SQL
> language and all the languages I had to use it in.

I think UnQL or something like it is a huge step forward, if it is
well implemented and if it is adopted also by MongoDB, Amazon's
SimpleDB, Google's DataStore API and other similar non-relational
databases.

And the reason is not because I think it is cool to hand-assemble SQL
or UnSQL strings to send to the database. I know better, like most of
us here, I've been using ORMs for a while now. But I'd hate it even
more to have to hand-assemble JavaScript strings to create a
declarative query interface for CouchDB.

UnQL provides a standard set of operations and rules for putting them
together, in a declarative way, This is a pre-requisite for building
the optimizing query engines that modern databases have. Like Benjamin
said, the AST is what is really important here.

Note that UnQL has an "explain" command, which is real query languages
is a facility to get the query optimizer to explain how it plans to
execute a query. We don't even need that today in CouchDB because the
querying interface is so primitive that we need to actually tell the
database what to do in an imperative way, while the RDB world has had
declarative query languages for decades.

So now that a declarative query language has been proposed, at least
we are in the right path to be able, eventually, to ask CouchDB to
devise and execute query plans for us.

I am no RDB zealot [1], but we can't ignore the results of 40 years of
database research and for a second think that writing queries
imperatively is the way to go.

[1] http://journal.code4lib.org/articles/4893

-- 
Luciano Ramalho
programador repentista || stand-up programmer
Twitter: @luciano

Mime
View raw message