When would I want to use document data store and when key-value data store??
Thank you!
When would I want to use document data store and when key-value data store??
Thank you!
There isn't a clear distinction.
In a key value store, you have a key (usually a string) that corresponds to a bag of bits. An example is, Memcached. You can put anything in your "value" part: a JSON document, a serialized data structure, a compressed or encrypted file, etc. Generally speaking, it's just bits.
A document store, on the other hand, implies that you need to store data in a certain format. An example is MongoDB, which uses a binary version of JSON. The database might provide indexing by looking at the contents of the document, or might allow some form of querying. You get some extra features, but you're also constrained a bit by the format. For example, if you had a document store that worked with JSON, your data will likely take up way more space than if you stored a compact serialized format like Protobuf, and will be slower to parse.
Ultimately, those categories don't mean much. Every database technology is different, and each has pros and cons (though they'll all claim to be the best thing since sliced bread). Figure out what your needs are, and evaluate DBs based on that. Some things you may want to consider: