In document databases, complex data structures like nested objects can be handled more easily. Therefore, documents stores can be more expressive than the data model of column families. They also offer the possibility to use secondary indexes, querying nested documents and to use operations like ‘and’, ‘or’, ‘between’. To launch queries, users can either rely on a rich programming APIs or a query language. Those possibilities provide document databases with a great flexibility required by multiple use cases. They are usually used for real-time analytics, logging and the storage layer of small and flexible websites like blogs. This is because they are easy to maintain.
On the contrary of the simple key-value stores, the value column in document databases contains semi-structured data and specifically the attribute name/value pairs. Furthermore, document databases support a flexible schema. Indeed, they do not have any schema restrictions and they allow storing documents with hundreds of attributes in a single column of a document scheme. So rows can receive various amount and types of attributes. It is also possible to add attributes at runtime