The Little Redis Book
openmymind.net
openmymind.net
* Lists, sets, zsets and hashes are all means of constructing queries that act on data (or metadata) as well as key names; it's misleading to suggest that "keys are everything" in Redis.
* Sets aren't simply a way of storing things for which you don't want duplicates; they are the idiom in which flexible queries are constructed in Redis, period. redis sets : SQL joins :: register-operand instructions : C code.
* In the same vein: since probably the most important idiom in Redis is storing things indirected through keys (often incr ID keys) --- such that for instance you can index and query data through set math operations --- you might want to spend a chapter very early on explaining this idiom. It's not a weird hack to store "bob_friends=set(jack,jill,jim) bob=hash(name: bob, role: admin) &c" --- it's how you're intended to use Redis.
The very idea that one might need to store the same JSON blob in two keys so that users could be indexed both by name and ID suggests that the author hasn't really metabolized this idea. Nobody who works in Redis regularly would ever make that mistake; they'd give users an opaque incr id, and then index those ids by username in a separate key.
The idea that one might be worried about how much space those indexes consume is weird, since any other database would consume even more space to do its (much more heavyweight) indexing.
One might worry that readers new to Redis would get the impression that Redis is much more narrowly targeted than it in fact is.
The fact that I bring up duplicating values shouldn't tell you that I don't grok Redis. It should tell you that you and I differ in how we think new users will approach Redis and how the story needs to be told for them to better understand it.
I really do appreciate your feedback. Your example on set-usage is good and I'll look at adding it. But, for the rest, I think you are projecting your own understanding/knowledge onto the masses.
http://laacz.lv/f/txt/ebooks/The%20Little%20Redis%20Book%20-... (40k)
http://laacz.lv/f/txt/ebooks/The%20Little%20Redis%20Book%20-... (70k)
Command to generate epub from markdown:
pandoc -f markdown -t epub --xetex --template=template/xetex.template -V paper=$paper \
-V hmargin=$hmargin -V vmargin=$vmargin \
-V mainfont="$mainfont" -V sansfont="$sansfont" \
-V monofont="$monofont" -V geometry=$geometry \
-V columns=$columns -V fontsize=$fontsize \
-V nohyphenation=$nohyphenation en/redis.md \
-o redis.epubI'm sure this book is going to have a good effect on the Redis community.
It exposes useful constructs such as a social graph, bloom filter, full-text index, and a very fast rate limiter (http://chris6f.com/rate-limiting-with-redis).
Short is good. I've been working on my own creative commons book (4th edition of my Java AI book), and you have me at least thinking of segmenting that into several mini-books (search, machine learning, etc.).
BTW, I also liked your "Little MongoDB Book."
http://johnmacfarlane.net/pandoc/epub.html http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000...