All questions
Showing of 33What are the different data types supported by Redis?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Redis supports these core data types, each with its own commands:
- Strings: text, numbers or binary data, up to 512MB.
- Hashes: field-value pairs, like an object.
- Lists: strings in insertion order.
- Sets: unique strings with no order.
- Sorted sets, or ZSets: unique strings ordered by a score.
- Bitmaps: a string used as an array of bits.
- HyperLogLog: a probabilistic structure that estimates cardinality, the number of unique items.
- Geospatial indexes: longitude and latitude points you search by radius.
- Streams: append-only logs of events, used as message queues.
Redis 8 adds JSON, time series and probabilistic types such as Bloom filters. It also adds vector sets for similarity search.
SET mykey "hello" # String
HSET user:1 name "John" # Hash
LPUSH mylist "item1" # List
SADD myset "member1" # Set
ZADD myzset 1 "item1" # Sorted Set
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between Redis and traditional relational databases?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Redis keeps its data in memory as keys holding data structures, while a relational database keeps tables on disk and answers SQL queries. Redis is far faster for simple reads and writes, and a relational database gives you joins, a fixed schema and full transactions.
| Aspect | Redis | Relational database |
|---|---|---|
| Storage | In memory, so data must fit in RAM | Disk-based |
| Data model | Key-value, NoSQL | Relational tables |
| Schema | Schema-less | Fixed schema |
| ACID | Limited: MULTI and EXEC have no rollback |
Full ACID compliance |
| Performance | Extremely fast, microseconds | Slower, milliseconds |
| Persistence | Optional, as snapshots or a log of writes | Always persistent |
| Query language | Commands | SQL |
| Relationships | No joins | Complex relationships |
Redis suits caching, sessions and real-time work such as counters and leaderboards. A relational database suits complex business logic and data with many relationships. Many systems use both. The relational database stays the source of truth, and Redis holds a fast copy of the data read most often.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain Redis persistence mechanisms.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Redis saves its data to disk as RDB snapshots or an AOF log, or both. A pure cache can turn persistence off.
Redis Database (RDB) saves a point-in-time snapshot at set intervals. Redis forks a child process, a copy of itself, which writes one compact binary file. That file suits backups, disaster recovery and fast restarts. After a crash you lose the writes since the last snapshot, often several minutes.
Append Only File (AOF) logs every write operation, and Redis replays it at startup. The default appendfsync everysec risks about one second of writes, and always syncs every write but is slow. The file is larger and Redis restarts from it more slowly, so Redis rewrites it in the background.
With both on, Redis restores from the AOF, the more complete copy. The AOF starts from a base file, a snapshot the logged writes follow. By default that base uses the RDB format, so it loads fast.
# RDB configuration
# Save if at least 1 key changed in 900 seconds
save 900 1
# Save if at least 10 keys changed in 300 seconds
save 300 10
# AOF configuration
appendonly yes
# Options: always, everysec, no
appendfsync everysec
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are the common use cases for Redis?
How does Redis handle memory management?
Explain Redis transactions and their limitations.
What is Redis Pub/Sub and how does it work?
Explain Redis Cluster and its benefits.
What is pipelining in Redis and when should you use it?
How does Redis replication work?
What are Redis modules, and which ones are popular?
Explain different Redis configuration parameters for performance tuning.
How do you implement Redis as a message queue?
Why should you avoid KEYS in production, and what should you use instead?
What happened to the Redis license, and what is Valkey?
What is the difference between Redis Pub/Sub and Redis Streams?
Explain Lua scripting in Redis and its advantages.
Explain Redis Stream data structure and its use cases.
What is Redis Sentinel, and how do you configure it?
Why is Redis fast even though it runs commands on a single thread?
How does key expiration work in Redis?
How would you implement distributed locking using Redis?
How do you monitor and debug Redis performance issues?
How do you implement high availability for Redis?
Describe advanced Redis memory optimization techniques.
How would you design a Redis-based caching strategy for a high-traffic application?
Explain Redis security best practices and implementation.
How do you handle Redis failover and disaster recovery?
Design a Redis-based rate limiting system.
How would you implement a distributed cache invalidation system using Redis?
Describe advanced Redis data modeling techniques for complex applications.
How are Redis sorted sets implemented internally?
What problems do big keys and hot keys cause, and how do you fix them?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Redis in pictures.
A quick recap of Redis in 30 short animated pictures, one idea at a time. About 8 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.
Pro The first chapter is free to play. The other 27 pictures come with Pro.
Redis cheatsheet
- What Redis is01
- Data types & commands02
- Keys, expiry & SCAN03
- Memory & eviction04
- Persistence & backups05
- MULTI, Lua & pipelining06
- Pub/Sub, queues & Streams07
- Replicas, Sentinel & Cluster08
- Caching, locks & rate limits09
- Monitoring & security10
- The model11
- + 5 more inside
This picture is part of Pro. The first chapter is free to play; the other 27 pictures come with Pro.
Get Pro · $10/mo Already Pro? Sign in30 of 33 Redis answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.