Skip to main content
Version: 1.3.0

Redis

Redis Serialization Protocol (RESP) for client-server communication:

Message Format

FieldDescriptionExample Value
TypeFirst byte indicates data type+ (Simple String), - (Error), : (Integer), $ (Bulk String), * (Array)
DataPayload following type indicatorOK\r\n, 3\r\n, $5\r\nhello\r\n
TerminatorCRLF sequence marking end of element\r\n

Data Types

TypeIndicatorFormatExample
Simple String++<string>\r\n+OK\r\n
Error--<error>\r\n-ERR unknown command\r\n
Integer::<number>\r\n:1000\r\n
Bulk String$$<length>\r\n<string>\r\n$5\r\nhello\r\n
Array**<count>\r\n<elements>*2\r\n$3\r\nfoo\r\n$3\r\nbar\r\n