Posts categorized under: Gists

Archive Redis to Riak

Redis is nice for dealing with data as it is relevant and changing, but once it goes a little stale, you probably want to archive it to free up resources. Wouldn't it be nice to be able to archive it and still be able to query it?

Using my ...

Redis Lua: Updating a Key and Lookup Hash

Yesterday I mentioned that you should maintain a lookup hash as you update keys.

So today, I decided to put that together. The only real gotcha is deleting the lookup to the old attribute value before updating the lookup hash.

Largely the same caviates apply as yesterday. We could flesh ...

Redis: Generating a Hash Lookup with SCAN

Using a keystore efficiently is all about anticipating how the data will be looked up. If you can't do that, you may be better using a relational database.

Generating lookup tables and indexes can be helpful for finding the key you're looking for. For example, if you store ...

Redis Lua: Collate Redis Key/Value Results

Any Redis command that returns key/value pairs returns the results as a single list of alternating keys and values. If you need to work the results in a Lua script, you'll likely want to collate them in a Lua table.

This script takes a Hash key and returns ...

Redis Lua: Storing and Checking Hashed Passwords

See the update at the bottom: this approach isn't secure (but I still think it's interesting).

Storing passwords in plain text is bad. Time and time again, databases get hacked and passwords get leaked. Hashing a password creates a consistent string from a password that you can store ...