
DovetailDB is a schemaless, JSON-based database. It is similar in spirit to Amazon's SimpleDB, but allows for javascript to be executed on the server, and, within that context, provides full transaction support.
DovetailDB needs more (vocal) users. If you use DovetailDB, please comment in the newsgroup about any issues you uncover and suggest how the product could be improved.
DovetailDB's native JSON data format and embedding of a javascript environment makes it look like CouchDB, but DovetailDB manages the data indexing under the hood. (less developer effort, but less customizable)
It is also designed to integrate directly and easily with client-side Javascript, making it one of the fastest web application development platforms in existence. Server-side Javascript hooks may be written to enforce business rules and control access.
We'll host small datasets with low transaction volume for free (the DovetailDB server does not need to run on the same machine your serves your web pages). Alternatively, you may run your own instance of the server. It's an open-source, standalone Java application, licensed under the Apache License, 2.0.
Open up FireBug and go to the console tab (don't use FireBug? Download the javascript library here, and follow along in the environment of your choice).
First, read the following disclaimer and click on the "I agree" button to get an access key:
The dovetaildb client script (dovetail.js) has already been imported onto this page; all of its functions are namespaced under the "dovetail" object. To register your access key with the client library, enter this javascript code:
Now you can create a new database (named "SocialNet", in our example) by typing the following. You can create multiple databases to store data for different applications. (data cannot be shared between databases)
We will then tell the client library to use this new database for the remainder of our calls:
Databases can contain several "bag"s (which are similar to tables in a relational database). You don't need to declare the bags, though; they get created the first time you insert data into them. Here, we insert a object for "Bob" into the "people" bag:
We can get data out of a bag by querying for any of object's attributes. The dovetail.query function first takes the bag to query. Second, it takes an object representing the query. Finally, in normal AJAX style, we supply a callback function that does something with the results when they come back.
In your query, you can constrain on multiple attributes and you can also do range queries, "in" lists, and exclusions. Objects in the database can be changed and removed using an "id" attribute that gets implicitly assigned to each object. You can also upload javascript code to run on the server side. See the documentation for more information on all these topics.