Redis Gets a New Array Data Type: 18 Commands + Server-Side Regex Matching + WASM Online Playground

Redis creator introduces a new Array data type with 18 commands and server-side regex matching.
Redis creator antirez submitted a PR adding a new Array data type to Redis with 18 dedicated commands, addressing List's performance weakness in random index access. The ARGREP command integrates the TRE regex library for server-side pattern matching and computation pushdown, drastically reducing network overhead. Simon Willison used Claude Code to build a WebAssembly-based browser Playground for zero-install online experimentation. While not yet merged into mainline, this feature holds significant implications for the Redis ecosystem and competitive landscape.
Redis Gets a Brand New Array Data Type
Redis creator Salvatore Sanfilippo (antirez) recently submitted a major PR to Redis, introducing a completely new data type—Array. This isn't a simple extension of the existing List type, but a full-fledged data structure with 18 dedicated commands, bringing powerful capabilities like server-side regex matching. Meanwhile, Simon Willison used Claude Code to build a WebAssembly-based interactive Playground that runs in the browser, allowing developers to try out these new commands online without any installation.
Salvatore Sanfilippo (known online as antirez) is an Italian programmer who created the Redis project in 2009. Redis was originally born to solve performance issues he encountered while developing a real-time web analytics system called LLOOGG. In 2020, antirez announced his departure from day-to-day Redis maintenance, handing the project over to the core team. In 2024, Redis changed its license from BSD to RSALv2/SSPL dual licensing, triggering community forks (such as Valkey, Redict, and others). This PR submitting the Array type marks his continued contribution of important new features years after stepping away from daily maintenance—a positive signal for the Redis community.
The Evolution of Redis's Data Type System
Since its inception, one of Redis's core competitive advantages has been its rich data structure support. From the original five basic types—String, List, Set, Sorted Set, and Hash—to later additions like HyperLogLog (cardinality estimation), Bitmap, Stream (message streaming), and Geospatial, Redis's type system has continuously expanded. Each type is deeply optimized for specific scenarios: for example, Sorted Set's skip list implementation excels in leaderboard scenarios, while Stream provides native support for message queue use cases. The addition of the Array type fills a gap in Redis's support for "efficient random access by index"—a fundamental data structure semantic.
Overview of 18 New Commands
The new Array type introduces a complete set of commands prefixed with AR, covering common scenarios including CRUD operations, range operations, and scan matching:
- Basic operations:
ARSET,ARGET,ARDEL,ARLEN,ARINSERT - Batch operations:
ARMGET,ARMSET,ARGETRANGE,ARDELRANGE - Traversal & search:
ARSCAN,ARSEEK,ARNEXT,ARGREP - Statistics & info:
ARCOUNT,ARINFO - Others:
AROP(arithmetic operations),ARRING(ring buffer),ARLASTITEMS(get tail elements)
The command design maintains Redis's characteristically concise command style while providing sufficiently rich operational semantics. For developers familiar with Redis's command system, the learning curve is minimal.
Why Not Just Extend List?
Redis's existing List type uses a quicklist implementation under the hood—essentially a doubly-linked list composed of multiple ziplists (compressed lists). This structure excels at head/tail insertions and pops (O(1) complexity), making it ideal for queue and stack use cases. However, when random access to middle elements by index is needed, List has O(N) time complexity, with performance degrading significantly as data grows. The Array type is closer to traditional array semantics in programming languages, supporting O(1) or near-O(1) index access, along with range operations and server-side pattern matching that List cannot efficiently provide. This explains why antirez chose to introduce an entirely new data type rather than layering features onto List.
Ring Buffer: Use Cases for ARRING
The ARRING command deserves special mention for implementing ring buffer semantics. A ring buffer is a classic data structure in computer science, also known as a circular buffer. It uses a fixed-size array that automatically wraps around to the beginning when writes reach the end, overwriting the oldest data. This structure is widely used in OS kernel logging systems, network packet buffering, audio/video stream processing, and more. Introducing ring buffer semantics in Redis's Array type means developers can natively implement "keep the most recent N records" functionality—such as recent user action logs, latest sensor readings, sliding window statistics—without manually managing array size and old data cleanup logic.
ARGREP: Server-Side Regex Matching Changes Data Filtering
Among all the new commands, ARGREP is arguably the most noteworthy. It supports regex matching (grep) directly on array values on the Redis server side, with the TRE regular expression library integrated under the hood.
TRE is a lightweight, POSIX-compatible regex library developed by Finnish developer Ville Laurikari. Unlike the common PCRE (Perl Compatible Regular Expressions) library, TRE's distinctive feature is support for approximate matching, allowing fuzzy matching within a specified edit distance. More importantly, TRE uses a deterministic finite automaton (DFA) algorithm, guaranteeing that matching time is linear relative to input length—it won't exhibit the exponential backtracking problem that some regex engines suffer from with certain patterns (i.e., ReDoS attack risk). This property is particularly important for a high-performance server-side system like Redis—it ensures the ARGREP command won't cause service blocking due to malicious patterns in user-provided regular expressions.
Previously, developers had to pull large amounts of data from Redis to the client for filtering. Now pattern matching can be done directly at the Redis layer. ARGREP supports various option combinations:
- MATCH: specify the matching pattern
- AND / OR: multi-condition logical combinations
- LIMIT: limit the number of returned results
- WITHVALUES: return matched values
- NOCASE: case-insensitive matching
Computation Pushdown: Moving Filter Logic to the Data
This design of pushing computation to where the data resides embodies the classic "pushdown" philosophy in the database field. This concept has long been standard practice in relational databases—SQL's WHERE clause is a textbook example of computation pushdown. In distributed systems and big data, this is a core principle: rather than moving massive data to compute nodes, push the computation logic to where the data lives.
For an in-memory database like Redis, although data access itself is extremely fast, network transmission is often the real bottleneck. When an array contains tens of thousands or even hundreds of thousands of elements, transferring all data to the client for filtering not only wastes bandwidth but also increases client-side memory pressure and garbage collection burden. ARGREP's server-side filtering can reduce the volume of returned data by orders of magnitude, making it especially suitable for scenarios requiring text search and filtering within large-scale array data.
In-Browser WASM Playground: Zero-Install Online Experience
Simon Willison used Claude Code (web version) to build an interactive Redis Array Playground, compiling a subset of Redis to WebAssembly so it runs entirely in the browser.
WebAssembly (WASM for short) is a binary instruction format standardized by W3C, designed to provide near-native execution performance for web browsers. WASM's core value lies in allowing programs written in C, C++, Rust, and other languages to be compiled into bytecode that runs safely within the browser sandbox. Redis itself is written in C, making it possible to compile its core logic to WASM. This approach of "bringing server-side software into the browser" has become increasingly popular in recent years—projects like SQLite's WASM version (sql.js) and PostgreSQL's PGlite have adopted similar approaches.
The Playground's interaction design is intuitive:
- Left sidebar lists all available Array commands
- Main panel provides a parameter configuration interface with dropdowns, checkboxes, and other controls
- Bottom area displays the constructed full command and execution results in real time
Developers can explore each command's behavior at zero cost, understand the effects of different parameter combinations, and try things out without locally compiling a Redis branch.
Notably, this tool itself is a product of AI-assisted development—Simon used Claude Code to complete the entire build process from Redis WASM compilation to the frontend UI. Simon Willison is the co-creator of the Django web framework and has become widely known in recent years for his deep exploration of AI tools and his open-source project Datasette (a data exploration tool). He continuously documents his experiences with various AI programming tools on his blog and is one of the most active practitioners in the AI-assisted development space.
A Case Study in AI-Assisted Development
Salvatore detailed the Array type's development process in his blog post Redis array type: short story of a long development, including how he leveraged AI programming tools to accelerate development. As the original creator of Redis, his approach to and practice with AI tools offers valuable reference points.
From this case, we can observe a noteworthy trend: not only was core feature development aided by AI, but the supporting tools around new features (such as the WASM Playground) also took shape rapidly with AI assistance. This chain effect of "AI-assisted core feature development → AI-assisted supporting tool construction" is accelerating the iteration pace of open-source projects.
Impact on the Redis Ecosystem
The introduction of the Array type fills a gap in Redis's data structure offerings. While Redis already has collection types like List, Set, and Sorted Set, Array provides semantics closer to traditional arrays in programming languages—supporting random access by index, range operations, and most critically, server-side pattern matching capabilities. These are things the existing List type cannot efficiently deliver.
The implementation is currently still in a branch and hasn't been merged into Redis mainline. However, given that the submitter is antirez himself and the feature design is already quite complete (18 commands covering major use cases), the likelihood of it landing in a future Redis release is high. It's worth noting that in the current context of Redis's license change triggering community splits (fork projects like Valkey and Redict have attracted significant numbers of users and contributors), important new features like the Array type could also become a differentiating competitive advantage between Redis and its forks.
For developers following Redis's evolution, the WASM Playground is available now to explore and evaluate these new capabilities ahead of time, preparing for future technology decisions.
Key Takeaways
- Redis creator Salvatore Sanfilippo submitted a PR adding a new Array data type to Redis with 18 dedicated commands
- The ARGREP command supports server-side regex matching, integrating the TRE regex library (DFA-based algorithm, naturally defending against ReDoS attacks), enabling data filtering directly at the Redis layer
- The Array type addresses the existing List type's performance weakness in random index access, providing semantics closer to traditional arrays
- Simon Willison used Claude Code to build a WebAssembly-based browser Playground, enabling command experimentation without installation
- Both the Array type and supporting tools were developed with AI assistance, demonstrating the trend of AI accelerating open-source project iteration
- The feature is still in a branch and hasn't been merged into Redis mainline, but holds strategic significance in the competitive landscape between Redis and its forks
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.