Skip to content

Redis Commands

Sailesh Mukil edited this page Jan 10, 2019 · 2 revisions

The list of commands that Dynomite supports (or does not support) can be found in the Redis.md.



Redis Lua scripting support

Dynomite supports storing and executing Redis Lua scripts with a few limitations:

  • EVAL and EVALSHA support is limited to scripts that take at least 1 key. If multiple keys are used, all keys must hash to the same server. You can ensure this by using the same hashtag for all keys. If you use more than 1 key, the proxy does no checking to verify that all keys hash to the same server, and the entire command is forwarded to the server that the first key hashes to.

    Note: Currently, Dynomite always checks to ensure that 1 key is strictly used. If you want to execute a script via EVAL or EVALSHA that does not touch any keys, pass in a dummy key to bypass the limitation. For example:

    SCRIPT LOAD "return 'hello world'"   // This will return a SHA-1 value.
    EVALSHA <SHA-1> 1 dummy-key .   // Even though the script does not access a key, we pass in a dummy key.
    

  • SCRIPT LOAD is now supported that allows the storing of Lua scripts. A SHA-1 hash is returned which is used as an identifier which allows for later execution using EVALSHA, without requiring the client to resend the same script again. More information can be found here.

    Note about SCRIPT LOAD implementation: Since a script doesn't hash to a specific token in the token ring, the script is stored in ALL nodes in the cluster. This does not have any user visible impact since the same script hashes to the same SHA-1 value across nodes.


  • Support for SCRIPT KILL, SCRIPT EXISTS, SCRIPT FLUSH is present.

    Note: SCRIPT FLUSH and SCRIPT KILL will be carried out on ALL Dynomite nodes. This could have some implication on multi-tenant clusters where different users are running different scripts. One user may clear the cache of scripts or kill a script setup by another user.