Ditch Your Database for a Key-Value DB
blog.kvdb.io
blog.kvdb.io
But then there the special people out there, they spend hours blogging about their personal opinion on how the giant grey blob KV DB can solve world hunger. Because it's all they know, they are afraid of change, they are afraid of ~ gasp ~, having to learn outside the box they dug themselves into, or they think they are these amazing super programmers that have the answer to everything. And then theres that write all this fluff for their resumes without actually knowing what they are doing but the senior engineer made them use it.
Engineering sucks.
Because many "engineers" do not have a solid understanding of the field, companies have been exploiting that by using and promoting solutions that would have been otherwise dismissed with very annoyed faces. Even docker would have been dismissed, as "cool but it has safety issues, so go home and redo your implementation".
There is always a schema, whether you want your database to help you with it or not is your choice.
I‘ll leave this here for posterity:
https://www.vividcortex.com/blog/2015/02/24/schemaless-datab...
— Schemaless Databases Don‘t Exist
By the way, what i would actually love to have, is a LINQ like API abstracted over a key-value store, and access to a SQL AST also in the language.. For me i think this is the desired middle ground, where you can scale and compose data over key-value, but also not to be stuck with SQL data mappings inside your codebase.
I mean, a relational algebra API that deal with any KV store, be it LINQ or the backend of something like Presto (or the DataFrame of Spark).
If you need something like a SQL interface somewhere, you could build it by stitching the SQL AST with the engine you use directly in the language.
* looking up an item by a key
* selecting a range of items
I would never choose a key-value DB for "scalability" reasons. It's very unlikely that I will be hitting the kind of scale where it would actually make a difference.
Where I have found it useful in my particular line of work is in a fairly narrow context: working in a microservice architecture where you create a single service between your system and a 3rd party system, and it's database is essentially a mapping of your own system's IDs to the ID's of the 3rd party.
Honestly, that plus one or two secondary indexes is all I've really needed. I've done that for 3 different integrations over the course of 2 years now, and it's worked out quite well so far. The fact that we have a strict policy of not sharing db access also means that I'm not to worried about other services trying to query the data in weird ways.
There are of course more fancy patterns for structuring your data in a key-value store, but at that point the main benefit of kv stores starts to diminish once you go down that path.