Relix is a Ruby library that makes it easy to build and use various types of secondary indexes backed by Redis. We use it heavily at Spreedly to give us fast access to our Riak-backed models (we didn’t use Riak’s secondary indexing since it didn’t exist when we started building Spreedly Core). Relix’s README is full of details on it’s philosophy and usage, and I’ll be doing a post eventually about why and how we use it at Spreedly.
Relix 2.0.0 brings a major version bump, due to the fact that it now requires Redis 2.6. This allows us to leverage Lua scripting, which is a big win for some use cases, especially since Relix does all it can to pipeline Redis requests.
The new feature driving the usage of Lua scripting is the ability to index and retrieve the list of values being indexed by a
1 2 3 4 5 6
So whereas normally you’d look up all the users with a given
lookup_values allows you to look up all the account id’s that are indexed. This is super handy for doing aggregate lookups by a multi index:
1 2 3 4
2.0.0 also adds a deprecation mechanism and uses it to deprecate direct access to
IndexSet#indexes in favor of
And let me know if you’re using Relix - I’d love to hear about anything and everything it’s being used for!