Azure DocumentDB is finally here

At last Microsoft have taken the wraps off their fully managed, JSON document database service. As of today (21st August) Microsoft has placed Azure DocumentDB into public preview, and made it available to the following regions: –

  • US West
  • Europe North
  • Europe West

There is an increasing demand for NoSQL databases but invariably developers are craving features and capabilities inherent to relational database systems. Unfortunately NoSQL means tough choices: –

  • strong OR eventual consistency
  • schema-free with limited query capability OR schematised and rich query capability
  • transactions OR scale

Wouldn’t it be great if you could have a massively scalable, schema-free database with rich query and transaction processing using the most ubiquitous programming language (JavaScript), data model (JSON) and transport protocol (HTTP)? That is exactly what Microsoft have given us with DocumentDB.

DocumentDB provides the ability to automatically index documents without requiring any schema or secondary indices, has the ability to issue SQL based relational and hierarchical queries over heterogeneous JSON values, has the ability to integrate database transactions with JavaScript exceptions, and the ability to seamlessly operate over JSON documents.

Above all they’ve provided a multi-tenant database service which is blazingly fast and (via tenant isolation) safe and secure.

Schema-Free

DocumentDB supports SQL queries without forcing developers to create explicit schema or secondary indices or views. DocumentDB is able to efficiently index, query and process heterogenous documents via the deep commitment to the JSON data model.

DocumentDB’s SQL language is based on the JavaScript type system, expression semantics and ability to invoke JavaScript UDFs, ensuring the query grammar has a familiar SQL dialect for developers creating an efficient and natural way for you to query over JSON documents.

There is (of course) a downloadable .NET SDK which includes a LINQ provider – there is even a rumour that Microsoft are considering native JavaScript mapping to their SQL query language.

Here is a great link to understanding how to Query DocumentDB: –

http://www.documentdb.com/sql/tutorial

JavaScript as a modern day T-SQL

As we adopt NoSQL systems for their simplicity, speed and scalability, we’re often forced to give up the transactional processing capabilities of traditional RDBMS systems. Support for transactions provides a performant and robust programming model for dealing with concurrent changes, resulting in faster apps that are easy to maintain. JavaScript is an obvious choice when considering that you want application code execution within the database, but you don’t want to invent yet another procedural language.

DocumentDB has JavaScript execution deeply embedded within the database engine. All application JavaScript execution is sandboxed, resource governed, and fully isolated. As a developer you can write stored procedures and triggers natively in JavaScript, allowing you to write application logic which can be shipped using HTTP POST and executed directonly on the storage partition within a transaction boundary. JSON can be materialised as JavaScript objects and transactions can be aborted by throwing an exception. This approach frees application developers from the complexity of OR mapping technologies.

DocumentDB Open and Approachable

We really don’t need more data formats, languages or protocols – let’s face it the learning curve for new systems can be steep, and we’re all pressed for time. The DocumentDB product team claim they held a mantra of ensuring they resisted the urge to be inventive where it didn’t deliver real value to the developer.

Programming against DocumentDB is really simple, approachable and doesn’t require you to buy into a specific tool-chain or require custom encodings or extensions to JSON or JavaScript. All functionality including CRUD, query and JavaScript processing is exposed over a RESTful HTTP interface. By offering simple, scalable JavaScript and JSON over HTTP, DocumentDB doesn’t invent in the area of data models, application models or protocols.

In my opinion DocumentDB is unique in how it embraces and builds on standards that are already abundantly available and established, yet adds huge value and capabilities on top – it feels like DocumentDB gives the developer the very best of all worlds!

You can find out lots more about Azure DocumentDB at the product page here – please bear in mind though that at present DocumentDB is in preview (online cloud speak for Beta).

Feel free to drop me a line if you have any questions mark.briggs@coreazure.com