What Is New in Redis 3.2 (summary table)
Redis 3.2 introduces significant enhancements focused on new data types, scripting improvements, and core optimizations. The table below summarizes the key changes.
| Category | Key Changes |
|---|---|
| New Features | GEO commands, Lua debugger, RDB AUX fields, memory command |
| Improvements | Lua sandboxing, Jemalloc upgrade, faster saving, better replication |
| Bug Fixes | Various fixes for replication, AOF, and cluster operations |
| Security | SSL/TLS for Sentinel, protected mode for default config |
| Deprecated | DEBUG command's OBJECT and SEGFAULT subcommands |
How does Redis 3.2 handle geographic data?
The big addition is the GEO API. This lets you store latitude/longitude pairs and perform spatial queries directly in Redis, like finding points within a radius. It's built on top of sorted sets, so you get all the performance benefits of that structure.
Commands like GEOADD, GEODIST, GEORADIUS, and GEORADIUSBYMEMBER are now available. In practice, this means you can power location-based features without an external geospatial database.
What scripting improvements were made?
Lua scripting got a major upgrade with a built-in debugger. You can now step through Lua scripts executed with EVAL, set breakpoints, and inspect state. This is a game-changer for debugging complex script logic.
The Lua environment is also more secure. It now runs in a modified sandbox that prevents scripts from executing non-deterministic commands or accessing the host's filesystem during AOF or RDB rewriting. This matters because it makes persistence more reliable.
Were there any core memory or performance tweaks?
Yes, several under-the-hood optimizations. The memory allocator was upgraded to Jemalloc 4.0.0, which helps reduce fragmentation. A new MEMORY command gives you detailed insights into how Redis is using RAM.
RDB persistence is faster for datasets with lots of small objects. There's also a new "hash" encoding for lists, which can save significant memory for lists of integers. For replication, partial resynchronization is now more robust after a failover.
Is the default installation more secure now?
Two main changes improve out-of-the-box security. First, Sentinel can now communicate with other Sentinels using TLS/SSL, securing the gossip protocol. Second, a new "protected mode" is the default.
Protected mode automatically binds Redis to localhost if no explicit bind address is set and no password is configured. This prevents accidental exposure of an unprotected instance to the network. You should still set a bind address and use requirepass for production.
What should I watch out for when upgrading?
Check your use of the DEBUG command. The DEBUG OBJECT and DEBUG SEGFAULT subcommands are now deprecated. Use the new MEMORY USAGE command instead of DEBUG OBJECT.
If you use Lua scripts that rely on side effects or non-deterministic commands during save operations, they will be blocked. Review your scripts. Also, the RDB file format has a new version (7), so ensure your tools can handle it.
FAQ
Can I use the new GEO commands with my existing cluster?
Yes, GEO commands are compatible with Redis Cluster. However, remember that all keys for a single GEO operation (like GEORADIUS) must hash to the same slot, as with any multi-key operation in cluster mode.
How does the Lua debugger work in a networked environment?
The debugger is accessed via a synchronous client connection. You use the SCRIPT DEBUG command to enable debugging mode for a session, then step through your script. It's not designed for high-concurrency debugging but is perfect for development.
What exactly does the MEMORY command report?MEMORY USAGE key estimates the memory consumption of a specific key and its value. MEMORY STATS gives a breakdown of allocator and overall server memory usage, which is more detailed than INFO memory.
Why was protected mode added?
Too many instances were deployed without a bind address or password, leading to compromised servers and data breaches. Protected mode is a safe default that forces you to make a conscious choice to expose Redis beyond localhost.
Are there any changes to replication timeouts or behavior?
Yes, the replication timeout logic was improved to better handle slow disks. Also, after a slave is promoted to master, other slaves can now perform a partial resync with the new master, reducing full sync overhead during failovers.