Riak: Sort by with MapReduce
Alexander Sicular:
The focus of this post is to show you how to do the equivalent of the sql “SORT BY date DESC” using Riak’s map/reduce interface. Due to Riak’s schemaless, document focused nature Riak lacks internal indexing and by extension, native sorting capabilities.
Complete code included (and embedded below):
A couple of links you’ll probably find useful before/after reading the article:
- Riak has improved the fetching of keys in a bucket, that making MapReduce on buckets directly not so expensive
- Even if there are some saying MapReduce is complicated, take a look at how to translate SQL to MapReduce or this MapReduce explanation in simple terms
- A complete guide to MapReduce with Riak
Original title and link for this post: Riak: Sort by with MapReduce (published on the NoSQL blog: myNoSQL)
via: http://siculars.posterous.com/using-riaks-mapreduce-for-sorting