database/redis

Redis serialization protocol specification | Docs
Build Your own redis

Redis does not use HTTP for its communication protocol.
Redis serialization protocol (RESP) is the wire protocol that clients implement To communicate with the Redis server, Redis clients use a protocol called Redis Serialization Protocol (RESP). While the protocol was designed specifically for Redis, you can use it for other client-server software projects.

A wire protocol is:

The formal specification of how data is formatted and exchanged between two systems over a network connection.
Wire protocol - Wikipedia

redis-cli use RESP to communicate with redis-server.RESP is used by any Redis client, not just redis-cli.

RESP can serialize different data types including integers, strings, and arrays. It also features an error-specific type.You can even telnet into Redis and type RESP manually.

While RESP is technically non-TCP specific, the protocol is used exclusively with TCP connections (or equivalent stream-oriented connections like Unix Socket) in the context of Redis.

Since Redis does not use HTTP, it doesn’t have HTTP-specific features like:

  • Methods: GET, POST, PUT, DELETE, etc.
  • Status Codes: 200 OK, 404 Not Found, 500 Internal Server Error, etc.
    Instead, Redis has its own commands and error responses using the RESP protocol.
HTTP FeatureRedis Equivalent
GET /resourceGET key
POST /resourceSET key value
PUT /resourceSET key value or use HSET/JSON.SET (module)
DELETE /resourceDEL key
200 OK+OK
404 Not Found(nil)
500 Internal Error-ERR <message>
403 Forbidden-NOAUTH Authentication required.

RESP Data types

RESP Characteristics

FeatureDescription
Text-basedThough it handles binary-safe data, commands and responses are mostly text.
Persistent TCPRedis clients communicate over a persistent TCP connection (usually port 6379).
Request/Response ModelA client sends a command (like SET key value), and Redis replies with a response.

Security

Security in the Redis RESP protocol (Redis Serialization Protocol) is minimal by default — Redis is designed for trusted environments.

By default, Redis:

  • Uses plain-text RESP over TCP.
  • Has no encryption (data and passwords are visible on the wire).
  • Accepts connections from any client that can reach the port (usually 6379).
  • Has optional password auth (requirepass), but no user roles (prior to Redis 6).

SSL/TLS is supported by Redis starting with version 6 as an optional feature that needs to be enabled at compile time. This gives encrypted RESP communication, similar to HTTPS vs HTTP.
TLS | Docs

RESP Versions

VersionIntroduced InKey Features
RESP2Redis 2.xSimple, fast, text-based (used by most clients today)
RESP3Redis 6.0Adds rich data types, attribute metadata, better introspection.

In RESP3, introspection means that clients can query information about the server or the connection itself,