4 ms·
That's exactly correct. If you're working with a pure key-value store, the only query you have is get(), plus maybe a scan over all keys. Stores like Cassandra
by bkirwi 15y ago
That's exactly correct.
If you're working with a pure key-value store, the only query you have is get(), plus maybe a scan over all keys. Stores like Cassandra give a little more structure to the data (column families, supercolumns, etc.) and you can use that to make certain types of queries simpler, but there's still nothing like the algebra that comes with relational DBs. Anything other than the most primitive logic is going to have to be written in client-side code, which is why you see things like MapReduce used to filter down large data sets or other complex client-side transformations.
The advantage of writing on the client is that you get to use whatever the hell programming paradigm you like: pretty much any language that can deal with a hashmap can deal with NoSQL. (That's true of relational DBs, of course, since you don't have to write complex queries; but if you're not taking advantage of the relational structure, NoSQL tends to be easier / faster.)
- zzzeek 15y agoRight, this is actually what I was getting at, without even being conscious of it when I asked that. Part of the appeal of NoSQL is that programmers don't need to learn a different paradigm of thinking other than the usual imperative model. I'm not sure if I like that rationale for using NoSQL. Strikes me as being lazy up front. Or maybe you don't really need ad-hoc queries.
- SkyMarshal 15y agoAs a fan of Codd/Date/Pascal, relational algebra, and ACID, I used to feel the same about NoSQL, but have since come to appreciate it as an option. Schemaless is nicer for exploratory programming with frequent data model changes, for one example. Here's a good article on NoSQL data modeling that covers it better, along with some good discussion in the comments: http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/ http://highlyscalable.wordpress.com/2012/03/01/nosql-data-mo...