Redis Introduces New Array Data Type: 18 Commands Explained & Browser WASM Playground Experience

Redis creator adds native Array data type with 18 dedicated commands and server-side regex search.
Redis creator antirez submitted a PR introducing a native Array data type with 18 AR-prefixed commands covering CRUD, ring buffers, and regex search (ARGREP), addressing List's poor random access and Sorted Set's score requirement. ARGREP uses the built-in TRE regex engine to push data filtering down to the storage layer. Simon Willison built a WebAssembly-based browser playground using Claude Code for zero-install experimentation. Both development efforts extensively leveraged AI assistance.
Redis Welcomes a Brand New Data Type: Array
Redis creator Salvatore Sanfilippo (antirez) recently submitted a major PR to the Redis repository, introducing a native data type—Array. This isn't a simple wrapper around the existing List type, but rather an entirely new, feature-rich data structure equipped with as many as 18 dedicated commands. Meanwhile, Simon Willison leveraged Claude Code to build a WebAssembly-based interactive playground that runs in the browser, allowing developers to experiment without installing anything.
Salvatore Sanfilippo (known online as antirez) is an Italian developer who created the Redis project in 2009. Redis was originally a side project he built to solve performance bottlenecks in real-time web analytics, which quickly grew into one of the world's most popular in-memory data stores. In 2020, antirez announced his departure from Redis's day-to-day maintenance, handing the project over to the core team at Redis Labs (later renamed Redis Ltd.). In 2024, Redis changed its open-source license from BSD to a dual license (RSALv2 + SSPLv1), sparking widespread community controversy and giving rise to forks like Valkey. Antirez's return to submitting code to Redis marks his re-engagement with Redis core development to some degree—itself a focal point of community attention.
Overview of Redis Array's 18 New Commands
The new Array type introduces a complete command set prefixed with AR:
- Basic operations:
ARSET,ARGET,ARDEL,ARLEN,ARINFO - Batch operations:
ARMGET,ARMSET,ARGETRANGE,ARDELRANGE - Insert and append:
ARINSERT,ARRING(ring buffer mode) - Traversal and search:
ARSCAN,ARSEEK,ARNEXT,ARGREP,ARCOUNT - Computation:
AROP(perform operations on array elements) - Tail queries:
ARLASTITEMS
This command set covers everything from simple CRUD to complex pattern-matching searches. The Array type is positioned as far more than just "an alternative to sorted sets."
To understand the significance of the Array type, it helps to understand Redis's existing data type landscape. Redis currently supports String, List, Hash, Set, Sorted Set, Stream, HyperLogLog, Bitmap, Bitfield, and other core data types. Among these, List is implemented using quicklist (a hybrid of ziplist + doubly linked list), which performs excellently for operations at both ends (LPUSH/RPUSH/LPOP/RPOP) but has O(N) time complexity for random access by index (LINDEX), making it suboptimal for large-scale data. Sorted Set uses a combination of skip list and hash table, and while it supports ordered traversal and range queries, each element must be associated with a floating-point score, adding cognitive overhead. The new Array type is designed precisely to address these structures' shortcomings in random access and flexible querying.
The ARRING command's ring buffer implementation deserves special mention. A ring buffer is a classic data structure in computer science that uses a fixed-size array, automatically wrapping around to the beginning when the write position reaches the end, overwriting the oldest data. This structure is extremely common in logging, time-series data collection, network packet buffering, and similar scenarios. In the Redis context, ARRING means developers can create a fixed-capacity array, continuously appending new elements without manually cleaning up old data—Redis automatically maintains the capacity limit and evicts the earliest entries. This is highly practical for monitoring metric collection, recent N operation records, and similar use cases, which previously required combining LPUSH + LTRIM as two separate commands.
ARGREP: A Breakthrough in Server-Side Regex Search for Redis
Among all the new commands, ARGREP is undoubtedly the most noteworthy. It allows users to perform grep-style regular expression matching directly on array values at the Redis server side.
To implement this functionality, Redis internally introduced the TRE regular expression library as a vendored dependency. TRE was created by Finnish developer Ville Laurikari as a POSIX-compatible regex library. Its standout feature is support for approximate matching—allowing a certain number of insertions, deletions, and substitutions during matching, returning results that are "close enough" to the pattern. This capability is uncommon in traditional regex engines (such as PCRE, RE2). TRE uses a variant of deterministic finite automaton (DFA) for matching, avoiding the exponential time complexity that backtracking engines (like PCRE) can exhibit with certain malicious patterns (ReDoS attacks). This is especially important for a regex engine embedded in a database kernel—server-side regex execution must have predictable performance characteristics, or a single malicious query could block the entire Redis instance. This means ARGREP may gain fuzzy search capabilities in the future.
ARGREP supports multiple option combinations:
MATCH: specify the matching patternAND/OR: multi-condition logical combinationsLIMIT: limit the number of returned resultsWITHVALUES: return matched item valuesNOCASE: case-insensitive matching
This effectively pushes data filtering logic—previously handled at the application layer—down to the storage layer. For scenarios requiring fast retrieval among large numbers of array elements, the performance improvement potential is considerable. The traditional approach of pulling all data to the client for filtering wastes network bandwidth and increases CPU and memory pressure on application servers. ARGREP executes filtering logic directly where the data resides, following the distributed systems design principle of "moving computation closer to data."
In-Browser WebAssembly Playground: Zero-Install Redis Array Experience
Simon Willison used Claude Code (Web version) to build a Redis Array Playground that compiles a subset of Redis to WebAssembly and runs it directly in the browser.
WebAssembly (WASM) is a low-level bytecode format originally standardized by W3C, designed to let programs written in C/C++/Rust and other languages run in browsers at near-native speed. In recent years, compiling server-side tools to WASM for browser execution has become a notable trend: SQLite officially released sql.js and a SQLite WASM version, the PostgreSQL community launched PGlite, and even the Python interpreter runs in browsers via the Pyodide project. The core advantage of this pattern is eliminating environment configuration friction—users don't need to install databases, configure networks, or manage processes; they get a complete interactive experience simply by opening a webpage.
This playground provides a visual command-building interface: the left sidebar lists all available commands, the main panel offers parameter configuration areas (including dropdown menus, checkboxes, and other interactive controls), and the bottom displays the generated complete command and execution results in real time. Developers can explore each command's behavior at zero cost and understand the effects of parameter combinations.
This approach of "compiling databases to the browser" is itself a noteworthy technology trend—WebAssembly is making more and more tools that previously required server-side environments readily accessible. For developer education, API exploration, and rapid prototype validation, this zero-install experience dramatically lowers the technical barrier to entry.
A Real-World Case of AI-Assisted Development
Salvatore documented the AI-assisted development process of the Array type in detail in his blog post Redis array type: short story of a long development. As Redis's creator, his attitude toward and usage of AI programming tools carries significant reference value.
Simon Willison's process of building the Playground also relied on AI—he completed the entire interactive interface development through Claude Code's Web version. Claude Code is an AI programming tool from Anthropic that supports both terminal command-line and Web usage modes. Unlike GitHub Copilot's focus on line-level code completion, Claude Code excels at understanding complete project context and executing complex cross-file development tasks, including architecture design, code refactoring, and end-to-end feature implementation. Simon Willison used Claude Code's Web version, meaning he drove the entire Playground's frontend development through natural language conversation—from HTML structure, CSS styling, to JavaScript interaction logic and WASM integration, all assisted by AI.
From Redis core data structure implementation to companion tool development, AI played a role throughout this project. Notably, antirez emphasized in his blog that AI primarily accelerated the implementation of existing design ideas rather than replacing architectural decisions—reflecting an important current consensus in AI-assisted programming: AI excels at converting clear intent into code, but system-level design judgment still relies on human engineers' experience and intuition.
Impact of Array Type on the Redis Ecosystem
The addition of the Array type fills a gap in Redis's data model. The existing List type is based on linked lists, suitable for queue scenarios but with poor random access performance; Sorted Set is ordered but requires a score field. The Array type provides true index-based random access capability, and combined with built-in regex search, pushes Redis one step further in the direction of "in-memory database."
From a broader perspective, the introduction of the Array type also reflects Redis's long-term evolution from a "caching layer" toward a "primary data store." Early Redis was primarily used as a caching acceleration layer in front of MySQL/PostgreSQL, but with the release of Redis Streams (message queues), RedisJSON (document storage), RediSearch (full-text search), and other modules, Redis is gradually becoming capable of independently handling more data processing responsibilities. The Array type, combined with ARGREP's server-side search capability, further narrows the gap between Redis and traditional databases in query flexibility.
The implementation is currently still in a branch and hasn't been merged to mainline. However, given that the submitter is antirez himself, the likelihood of this feature making it into an official release is high. Developers following Redis are advised to familiarize themselves with this new command set through the Playground ahead of time.
Key Takeaways
- Redis creator Salvatore Sanfilippo submitted a PR adding a native Array data type to Redis with 18 dedicated commands
- The ARGREP command supports server-side regex search with the built-in TRE regex engine, enabling multi-condition pattern matching
- Simon Willison used Claude Code to build a WASM-based browser interactive playground, available without any installation
- Both the Array type and Playground development extensively used AI assistance, serving as exemplary AI programming case studies
- The Array type fills a gap in Redis's data model for index-based random access and built-in search capabilities
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.