Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 3.36 KB

differences.md

File metadata and controls

73 lines (54 loc) · 3.36 KB

Differences with Redis

String lengths, indices.

String sizes are limited to 256MB. Indices (say in GETRANGE and SETRANGE commands) should be signed 32 bit integers in range [-2147483647, 2147483648].

String handling.

SORT does not take any locale into account.

Expiry ranges.

Key expirations are limited to 268435455 seconds (2^28 - 1, about 8.5 years) from the command's execution time. EXPIRE, PEXPIRE, EXPIREAT, PEXPIREAT, SET with EX/PX/EXAT/PXAT, SETEX, PSETEX, GETEX with EX/PX/EXAT/PXAT, and RESTORE (including ABSTTL) clamp deadlines beyond this limit. GETEX returns the existing string value when its expiration is clamped. Clamping does not replace command-specific validation of invalid or overflowing expiry values; GETEX reports invalid-expiry errors instead of returning null for an existing string key. Memcached absolute exptimes beyond the limit are clamped the same way, including GAT and GATS.

Hash field expirations reject TTLs beyond the same 268435455-second limit instead of clamping them. They use one-second precision. Deadlines are rounded up to the next whole second, so fields never expire before the requested deadline and may remain live for less than one additional second.

EXPIRE flags

EXPIRE, PEXPIRE, EXPIREAT and PEXPIREAT accept NX together with GT or LT: the expiry is set when the key has none, otherwise GT or LT alone decides. Redis rejects these combinations as incompatible.

Lua

We use lua 5.4.9. That means we also support lua integers.

As in Valkey 7, the global environment is read-only: scripts can not create or change globals, or change the library tables (redis, string, cjson, ...). Settings changed through library functions, such as cjson.encode_max_depth(), still apply to later scripts. cjson.decode and cmsgpack.unpack accept at most 50 levels of nested arrays and objects.

Script replies may nest tables at most 128 levels deep; a deeper table is replaced by the error reached lua stack limit. A table reached several times, such as a shared or cyclic one, is serialized once per reference, and a reply may expand to 2^20 elements beyond one per 16 bytes of Lua memory in use. Past that, tables are replaced by the error reached lua reply size limit.

External Authentication

Dragonfly can delegate AUTH validation to a trusted HTTP agent, which handles LDAP, Entra ID, or another identity provider outside Dragonfly:

--auth_validate --auth_validate_url=http://localhost:8080/validate --auth_validate_timeout_ms=300

These flags are startup-only. Each AUTH sends a POST request with JSON credentials:

{"username":"alice","password":"password-or-token"}

For AUTH <token>, the username is default and the token is sent in password. The agent selects the identity provider and replies with:

{"valid":true,"username":"alice"}

The returned username must name an active, pre-provisioned ACL user. An optional exp field contains Unix seconds and requires reauthentication after expiry. Rejections, HTTP errors, timeouts, and missing or invalid URLs reject AUTH without falling back to local passwords. Validation uses plain HTTP with no local caching; use a trusted endpoint. Non-admin Redis TCP connections require AUTH even when the default ACL user has no password. Admin, Unix-domain socket, and Memcached authentication behavior is unchanged.