Redis Adds New Array Data Type: 18 Commands Explained with Browser Playground Experience

Redis creator adds native Array data type with 18 new commands and a browser-based playground experience
Redis creator antirez submitted a PR adding a native Array data type to Redis with 18 AR-prefixed commands covering basic read/write, regex search (ARGREP), ring buffers (ARRING), and more—filling Redis's gap in O(1) indexed random access. Simon Willison used Claude Code to build a WebAssembly-based browser Playground enabling zero-install experimentation. Both efforts leveraged AI-assisted development, demonstrating the maturity of AI programming tools in systems-level engineering.
Overview
Redis creator Salvatore Sanfilippo (antirez) recently submitted a major PR to Redis, introducing a new native data type—Array. Meanwhile, Simon Willison used Claude Code to build a WebAssembly-based interactive Playground that runs in the browser, allowing developers to experiment with this entirely new command set without installing anything.
This change not only enriches Redis's data model, but the development process itself serves as a textbook example of AI-assisted programming.
Redis Data Model Evolution and the Role of the Array Type
Since its release in 2009, one of Redis's core strengths has been its rich data structure support. From the original String, List, Set, and Hash, to the later additions of Sorted Set (based on skip lists), HyperLogLog (cardinality estimation), Bitmap, and Stream (message streaming, introduced in Redis 5.0), each new data type has represented a significant expansion of Redis's use cases.
The introduction of the Array type continues this tradition, filling a gap in Redis for fixed-index random-access array operations. While the List type supports index-based access, its underlying implementation is based on quicklist (a hybrid of ziplist + doubly-linked list), which differs from a true array in both random access performance and semantic expressiveness. The Array type provides O(1) index access semantics, more closely matching the behavior of arrays in traditional programming languages.
It's worth noting that Salvatore Sanfilippo (known online as antirez) is an Italian programmer who created the Redis project in 2009. In 2020, he stepped down as Redis maintainer, handing the project over to the team at Redis Labs (now Redis Inc.). After Redis changed its license from BSD to RSALv2/SSPLv1 dual licensing in 2024, the community saw forks like Valkey emerge. antirez's direct PR submission to Redis signals his re-engagement with Redis core development to some degree—an important signal for the community.
Redis Array Type: 18 Brand New Commands at a Glance
This PR introduces 18 new commands with the AR prefix in one go, covering every aspect of array operations:
- Basic Read/Write:
ARSET,ARGET,ARMSET,ARMGET— Set/get individual or batch array elements - Range Operations:
ARGETRANGE,ARDELRANGE— Read or delete elements by range - Insert & Delete:
ARINSERT,ARDEL— Insert or delete elements at specified positions - Query & Traversal:
ARSCAN,ARSEEK,ARNEXT,ARGREP— Scan, seek, iterate, and pattern match - Meta Information:
ARLEN,ARINFO,ARCOUNT— Get length, detailed info, and count - Special Operations:
AROP(arithmetic operations),ARRING(ring buffer),ARLASTITEMS(get tail elements)
This command set is clearly the result of careful deliberation, covering everything from basic CRUD to advanced queries, embodying Redis's longstanding "commands as interfaces" design philosophy. Redis's API design follows a unique principle: each operation is an independent, semantically clear command, rather than being expressed through a query language (like SQL). This design allows each command to be precisely analyzed for time complexity, subjected to permission control (via the ACL system at the command level), and routed correctly in cluster mode. The 18 AR-prefixed commands continue this tradition—each command has a single responsibility, yet when combined they cover complex scenarios, aligning with the Unix philosophy of "do one thing well."
The ARGREP Command: A Breakthrough in Server-Side Regex Search for Redis
Among all the new commands, ARGREP is undoubtedly the most eye-catching. It allows users to perform grep-style regex matching searches directly on array values on the Redis server side.
To implement this functionality, Redis has internally vendored the TRE regular expression library. TRE is a POSIX 1003.2-compliant regex library created by Finnish developer Ville Laurikari. Its standout feature is support for approximate matching, which allows specifying an edit distance (maximum number of insertions, deletions, and substitutions) for fuzzy searching. Compared to heavyweight regex libraries like PCRE, TRE has a small code footprint and no external dependencies, making it ideal for embedding in performance- and size-sensitive systems like Redis. Previously, Redis used simple glob-style pattern matching in its KEYS and SCAN commands (supporting only wildcards like *, ?, []). ARGREP's introduction of full regex support represents a qualitative leap.
ARGREP supports rich option combinations:
- MATCH — Specify the match pattern
- AND / OR — Multi-condition logical combinations
- LIMIT — Limit the number of returned results
- WITHVALUES — Include values in the results
- NOCASE — Case-insensitive matching
This means Redis is no longer merely a key-value store—it's beginning to develop the ability to perform complex queries within data structures. For scenarios requiring fast in-memory text searching (such as log buffering, message queue content filtering, real-time alert rule matching, etc.), this will be an extremely valuable feature. The traditional approach requires pulling data from Redis to the application layer for filtering, whereas ARGREP pushes computation down to the storage layer, dramatically reducing network transfer overhead and application-layer processing burden.
The ARRING Command: Practical Value of Native Ring Buffers
The ARRING command implements a ring buffer—a fixed-size data structure where new data overwrites the oldest data when capacity is exceeded. This structure is extremely common in systems programming: the Linux kernel's dmesg logs, network device packet buffers, and applications' most-recent-N-operations records all use ring buffers.
Native support for this semantic in Redis means developers no longer need to maintain LTRIM + RPUSH combination logic at the application layer to simulate fixed-length queues—they can use ARRING directly for atomic circular writes. This is particularly useful in monitoring data collection (retaining the most recent 1000 sample points), sliding window calculations (response times of the last N requests), and audit logs (retaining the last N operation records). The atomicity guarantee means no additional distributed locks are needed during high-concurrency writes, simplifying application architecture.
Browser Playground: Zero-Install Redis Array Experience via WebAssembly
Simon Willison did something truly meaningful—he had Claude Code compile a subset of Redis to WebAssembly and built an interactive Playground that runs entirely in the browser.
WebAssembly (WASM) is a binary instruction format that allows programs written in C/C++/Rust to be compiled and run in the browser at near-native speed. Compiling a Redis subset to WASM means the core logic of the entire Redis server can execute in a browser sandbox without network connectivity or server deployment. This pattern has been widely adopted for developer tools in recent years—SQLite's WASM version lets users run SQL queries directly in the browser, and PostgreSQL's PGlite project takes a similar approach. Emscripten is the most commonly used C/C++ to WASM compilation toolchain, providing a POSIX API emulation layer that enables programs like Redis that depend on system calls to run in browser environments.
This Playground provides a visual command-building interface:
- The left sidebar lists all available commands
- The main panel provides parameter configuration forms with dropdowns, checkboxes, and other interactive controls
- The bottom displays the constructed complete command string in real time
- Click run to see the returned results
This "zero-install experience" approach dramatically lowers the barrier for developers to try new features. Since the Array type currently exists only in a development branch, this Playground is virtually the most convenient way for ordinary developers to access these commands.
AI-Assisted Development: From Redis Core Code to Toolchain Building
AI participation in this project spans two levels:
First level: Development of the Redis Array type itself. Salvatore documented the process of AI-assisted C code writing in detail in his blog post Redis array type: short story of a long development. As the creator of Redis, he has firsthand observations and insights about AI's practical utility in systems-level programming. Systems-level C code demands extreme correctness—memory management, boundary conditions, and concurrency safety issues can lead to crashes or data corruption with the slightest oversight. AI's value in these scenarios lies not only in generating code but also in rapid prototype validation and exploration of edge cases.
Second level: Building the Playground tool. Simon Willison used Claude Code for web to handle the WASM compilation and front-end interactive interface development. The entire build process can be seen in PR #277. Cross-compiling a complex C project to WASM involves extensive build system configuration, API adaptation, and debugging work—AI tools demonstrate significant efficiency gains in these "glue code" and configuration-intensive tasks.
The fact that two highly influential developers in their respective fields independently chose AI-assisted development speaks to the rapidly maturing state of AI programming tools in real-world engineering.
Outlook: When Will Redis Array Officially Ship?
The Redis Array type is currently at the PR stage and likely still needs community review and iteration before official release. However, judging from the completeness of its design—18 commands, built-in regex search, ring buffer support—this is clearly not an experimental toy but a thoroughly considered production-grade feature.
If ultimately merged into the mainline, the Array type will become yet another core data structure in Redis following String, List, Set, Hash, Sorted Set, and Stream, further solidifying Redis's positioning as a multi-model database. Combined with Redis's recent modular extensions in search (RediSearch), JSON (RedisJSON), graph (RedisGraph, now discontinued), and time series (RedisTimeSeries), the addition of the Array type makes the Redis core engine itself more expressive, reducing dependence on external modules.
Key Takeaways
- Redis creator Salvatore Sanfilippo submitted a PR adding a native Array data type to Redis with 18 brand new commands
- The ARGREP command supports server-side regex search with the built-in TRE regex library, supporting multi-condition combinations and case-insensitive matching
- Simon Willison used Claude Code to build a WebAssembly-based browser Playground for zero-install experimentation
- Both the Redis core code and the Playground tool were developed with AI assistance, demonstrating the practicality of AI programming tools in systems-level programming
- The Array type design is complete; if merged into mainline, it will become another core Redis data structure alongside String, List, and others
Related articles
Tech FrontiersA Rare Quiet Day in AI: Recursive Self-Improvement Stirs Beneath the Surface
A rare quiet day in AI sees multiple sources go silent simultaneously. Behind the calm, Recursive Self-Improvement (RSI) research continues. What this means for the industry.
Tech FrontiersReve 2 vs. Ideogram 4: A Deep Dive into Layout Control in AI Image Generation
A deep comparison of Reve 2 and Ideogram 4's layout control capabilities, covering technical approaches, real-world use cases, and industry trends for designers and creators.
Tech FrontiersIn the Weights: Check Your Influence Score in the AI World
In the Weights is an AI influence search engine that quantifies your presence in the AI world with a score. Explore how it evaluates practitioners and what it means for digital identity.