redis通讯协议(RESP )是什么?有什么特点?
有提到redis通讯协议(RESP ),能解释下什么是RESP?有什么特点?
(可以看到很多面试其实都是连环炮,面试官其实在等着你回答到这个点,如果你答上了对你的评价就又加了一分)
RESP 是redis客户端和服务端之前使用的一种通讯协议; RESP 的特点: 实现简单、快速解析、可读性好
- For Simple Strings the first byte of the reply is "+" 回复
- For Errors the first byte of the reply is "-" 错误
- For Integers the first byte of the reply is ":" 整数
- For Bulk Strings the first byte of the reply is "$" 字符串
- For Arrays the first byte of the reply is "*" 数组