Using Redis as a triple store back-end requires an interesting combination of data types, operations, and multi-commands:
SORT and similar commands allows for interesting use case. Sufficiently complex query can be expressed as dataflow between inputs, intermediate results stored as temporary keys and output result returning optionally sorted and paged values. Ability to store intermediate result in temporary key is essential for performance — it allows to avoid roundtripping of intermediate results between Redis database and application server. In addition Redis enables pipelined execution where multiple commands are sent without waiting for replies. This creates condition for “stored procedure”-like execution with single roundtrip to database. Experimentally Redis supports embedded Lua scripting where instead of pipelining multiple do-and-store commands it is possible to submit single
EVAL command with equivalent Lua script.
The post exemplifies a query dataflow:
Original title and link: Redis Based Triplestore Database (NoSQL databases © myNoSQL)