Live Examples
Learn Redis best practices through real-world scenarios. Click "Run It" to execute code in the terminal.
Scenario A: Cache User Session
SET session:userid:1001 "x8s7-token-value"GET session:userid:1001
Scenario B: Article Page Views
SET article:99:views 0INCR article:99:viewsINCR article:99:views
Scenario: Store Product Details
-- Set name, price, and stockHSET product:42 name "Mechanical Keyboard" price 120 stock 50-- Decrease stock by 1HINCRBY product:42 stock -1-- Read all product infoHGETALL product:42
Scenario: Email Send Queue
-- Add tasks (Producer)LPUSH mail_queue "email_to_alice"LPUSH mail_queue "email_to_bob"-- Process task (Consumer)RPOP mail_queue
Scenario: Latest 5 System Logs
LPUSH logs "Error: Connection lost"LPUSH logs "Info: User logged in"LPUSH logs "Warning: High memory"LRANGE logs 0 4
Scenario: User Skills
-- Add skillsSADD user:1001:skills "Java" "Python" "Redis"-- Try adding "Redis" again (ignored)SADD user:1001:skills "Redis"-- Check if user knows PythonSISMEMBER user:1001:skills "Python"-- List all skillsSMEMBERS user:1001:skills
Scenario: Phone OTP Code
-- Set OTP 123456SET phone:138000:code "123456"-- Expire in 60sEXPIRE phone:138000:code 60-- Check remaining timeTTL phone:138000:code
What is Redis?
Redis (Remote Dictionary Server) is an open-source, in-memory data structure store, used as a database, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets, etc. Due to its high performance (handling hundreds of thousands of operations per second), Redis is a vital component of modern internet architecture.
This Redis online editor is built with pure frontend technology, providing a simulated Redis environment. You can type commands directly in your browser and see results instantly, perfect for learning syntax and testing logic.
Includes not only a CLI terminal but also a real-time key visualization panel. You can clearly see all keys, types, and values in the database without repeatedly typing `KEYS *`.
All data is stored only in your browser memory. Data resets on page refresh. No commands or data are uploaded to the server, ensuring your learning process is completely safe and private.
Common Redis Commands Cheat Sheet
String is the most basic Redis type. A key corresponds to a value. Max 512MB.
| Command | Example | Description |
|---|---|---|
| SET | SET name "Redis" | Set the value of a key |
| GET | GET name | Get the value of a key |
| INCR | INCR views | Increment value by 1 (Atomic) |
| DECR | DECR stock | Decrement value by 1 |
FAQ
Does this support persistence?
No. This is a pure frontend simulation. Data resets on refresh. Use local Redis or Cloud for persistence.
Are all commands supported?
We support core commands (SET, GET, LPUSH, SADD, etc.). Advanced commands (Pub/Sub, Scripting) are not yet supported.
Can I use this on mobile?
Yes, the UI is responsive, but a physical keyboard is recommended for typing commands.
Is my data safe?
Absolutely. This is a pure frontend application. All data is stored only in your browser's memory and is never uploaded to any server.