04 / 04

What is the difference between redis-server and redis-cli?

Difficulty: 4/10
redis-server, redis-cli, client‑server interaction

redis-server is the daemon process that runs the Redis instance, reads the config file, and listens on a port (default 6379). redis-cli is the command-line client that connects to a running server. Key redis-cli flags worth knowing: --scan (keyspace iteration), --bigkeys (find large keys), --latency (measure latency), --stat (live stats), --pipe (bulk insert via Redis protocol), -n <db> (select database number).

Scenario Questions

0-2 years experience

  1. 1You need to start a local Redis instance for a small feature. Which command would you run, and how would you use redis-cli to set a key and verify it?
  2. 2If you run `redis-cli` on a machine where no Redis server is running, what do you see and why?
  3. 3How would you use redis-cli to confirm that the redis-server you just started is accepting connections on the default port?

2-5 years experience

  1. 1During a deployment the service can’t connect to Redis. Walk me through how you’d use redis-server and redis-cli to diagnose whether the server process is up and reachable.
  2. 2You need to script a health‑check that restarts Redis if it’s down. Explain how you would differentiate between the server binary and the CLI in that script.
  3. 3A teammate ran `redis-cli --pipe` and got a timeout. What could be wrong with the redis-server process, and how would you confirm it using both tools?

5-8 years experience

  1. 1Our caching layer runs Redis in containers with multiple replicas. Discuss the operational implications of managing redis-server processes versus using redis-cli for admin tasks at scale.
  2. 2We must roll out a config change that requires restarting redis-server without dropping client connections. How would you coordinate this using redis-cli and what precautions would you take?
  3. 3Design a monitoring solution that distinguishes between the health of the redis-server daemon and the responsiveness of commands issued via redis-cli.

8+ years experience

  1. 1We are migrating a legacy monolith that runs redis-cli scripts for data migrations to a microservices architecture that runs redis-server as a managed service. What architectural considerations and risks does this shift introduce?
  2. 2Across several data centers we need a policy that only authorized tooling can start redis-server. How would you design a secure deployment pipeline that controls both the server binary and redis-cli usage?
  3. 3Discuss the long‑term maintenance trade‑offs of embedding redis-cli commands in CI pipelines versus using a dedicated orchestration layer that interacts with redis-server via APIs.

Follow-up Questions

  • What exact command would you use to launch redis-server as a background service?
  • How does redis-cli indicate a connection failure via its exit code?
  • Can you describe how to check the version of the Redis server you’re connected to from redis-cli?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.