Data is a forever growing and seemingly never-ending organizational resource (anyone else tired of hearing about big data?). Modern applications must be able to efficiently and quickly work with these data sets where many are unstructured, thus traditional (or relational) methods do not apply.

The NoSQL label emerged for technologies to work with these data sources, whether they are object stores, key-value pairs, graph databases, or document storage and so forth. This takes me back to my days of working with a true NoSQL workhorse: Lotus Notes — but that is a story for a different day. The DocumentDB data service from Windows Azure is a cloud-based option from Microsoft. Here’s what the service (which is currently in preview mode) offers and instructions on how to get it up and running.

Numerous data storage options

Microsoft Azure has many options for storing and working with data, including:

  • Table storage, which provides an easy way to quickly access data using key values that describe the data.
  • The traditional relational option via SQL Azure.
  • The DocumentDB route for unstructured data, which allows you to work with data via a RESTFul interface that takes advantage of JSON — store, retrieve, and interact via JSON.

DocumentDB allows you to query all data in the document, while table storage only works with metadata outside the document.

Getting started with DocumentDB

The DocumentDB feature preview coincides with a new look for the Microsoft Azure portal home page. Figure A shows my portal page open in the Chrome browser. The portal home page is familiar if you use Windows 8 (or watch the Windows Surface commercials), as it presents the Azure features using the tile approach. It offers quick links to view billing details, service health reports, portal settings, and such.

The portal provides numerous ways for working with Azure features. The green plus sign in the lower left corner of the portal page allows you to add features. Figure B shows the list that is presented when the green plus sign is selected, with the DocumentDB option chosen.

Figure B

Selecting the New icon presents a list of features to add.

Figure C shows the window presented when choosing to add a new DocumentDB instance. A name is entered along with configuration, subscription, and location details. Select the Create button to create the DocumentDB instance.

Figure C

DocumentDB details are entered when creating a new instance.

When adding features, the portal page will display their status, as Figure D shows the new DocumentDB instance being created. The new DocumentDB instance is visible as the far right tile in Figure A.

Figure D

The portal home page shows the status of the new feature.

Once the new DocumentDB container is created, you can work with its many features via the portal (Figure E). The basic structure of DocumentDB begins with your Azure account, which can have one or more DocumentDB database instances. Each database contains users with permissions and collections, which can contain documents with attachments. Programmatically, you can add define stored procedures, user-defined functions, and triggers.

You may be shaking your head because of its resemblance to traditional SQL, but that is kind of the point — to offer an easy-to-use, somewhat familiar programming paradigm for non-traditional data. The online documentation provides a wealth of information and tutorials. (Note: The preview release does have some limitations.)

Figure E

A newly created DocumentDB instance offers many features.

The URI shown in the upper right of Figure E is the key to working with the DocumentDB service. This URI is the RESTFul interface where you can send HTTP POST commands to create new resources and execute queries or stored procedures. An HTTP GET request is used to read data.

A good way to get more acquainted with DocumentDB features is to play with RESTFul commands via the URI. Some good tools to use are Fiddler and Postman, as they allow you to dig into the details of HTTP responses and requests. In addition, there are SDKs for working with .NET, Node.js, JavaScript, Java, and Python. As it matures, I expect more will be offered. Visual Studio support is not included in this version, but hopefully more Windows Azure features will be incorporated into upcoming versions.

A cloud of NoSQL

Cloud-based computing is here to stay and, like many developers, I could not be more thrilled. Cloud allows me to use features and services without building and supporting an infrastructure.

My opinion of Microsoft Azure has improved steadily since its launch. The services continue to mature and, like Microsoft’s competitors in this space (e.g., Amazon), they are easy to set up and use.

Microsoft Azure offers a number of ways to work with the DocumentDB service (PowerShell, API, Azure Web interface, etc.), so there is something for everybody. You should consider DocumentDB and the plethora of other Azure services for your next project.