My deep interest in databases dragged me to this DocumentDB meetup in San Francisco. DocumentDB is Microsoft’s hosted platform as a service NoSQL database. A lot of similarities with other NoSQL databases, yet different in its own way. Stephen Baron did a very impressive task with the talk and an amazing task with the Q&A, I was virtually bombarding him with questions.
1. DocumentDB stores a free form JSON document.
2. All fields are indexed, unless specified otherwise. (sounds strange)
3. A collection is a group of documents, and multiple collections form a database (similar to Mongo)
4. There are limits on number of documents per collection. (The cons of PAAS)
5. Queries are similar to SQL queries, despite the data being JSON.
6. All documents have a “id” field, and this field is mutable.
7. All documents also have a system generated ID, which does not change. (Nice, since “id” field can change).
8. When you perform a query, there are limits on the data returned – 5 seconds max execution, 2 MB max data through the pipe. Again, this determines how you are billed for this service.
9. Updating documents through a REST API requires you to send back the entire document using PUT. The speaker promised partial updates using “PATCH” is in the works.
10. Document padding is not exposed to the end user in any way. (Updates to a document may cause the document to move physically in the file system)
11. SQL like queries are pretty powerful.
12. My favorite feature: Stored procedures that are precompiled and ready to go – So you can make an API call to perform a set of updates on the document. E.g. Update product count, insert into orders document, update purchase history, etc.
13. You can use client drivers – Python, JS, Ruby.
14. Transaction support – awesome. (limited to the same collection)