bustle / radredis

Basic redis backed object modeling for Node.
19 stars 3 forks source link

[WIP] Replacing MULTIs with EVALs #36

Closed jqyu closed 7 years ago

jqyu commented 8 years ago

This is just an experiment, might not be worthwhile to actually merge this. This is a pretty major refactor that pushes as much of the logic into redis as possible by using LUA scripts. Models generate LUA scripts to perform the operations, and each operation becomes a redis EVAL call.

Some naive benchmarks seem to suggest this is more performant, although I need to test this further. Also, now that every command is just an atomic EVAL call, pipelining becomes trivial. Will likely implement a pipelining feature before taking off the [WIP] tag.

Breaking Changes:

Notice that the new constructor is to encourage sharing a connection between models to allow pipelining. Furthermore, I'm playing around with integrating radgraph into the core radredis library becomes it seems to be a natural extension of radredis indices. This lends itself to encouraging code re-use, as well as providing nice features like true associations (retrieving related objects) rather than just an edge store for a graph.

All of this stuff is experimental though. This would mostly eliminate the boilerplate/wrappers on the radql end.

TODO: