redis配置与开发
docker123docker run -itd --name redis -p 6379:6379 --restart unless-stopped redisdocker exec -ti redis bashredis-cli
redis内存数据库、kv数据库、数据结构数据库对象类型有哪些?底层使用了哪些数据结构
string
int,字符串长度小于等于20且能转成整数,set teacher 1000000,type teacher,object encoding teacher
raw,字符串长度大于44
embstr,字符串长度小于等于44,cpu缓存中基本单位为cacheline 64字节,sdshdr头为9字节,加上’\0’,buf的最大长度为44,set teacher 1000000a,object encoding teacher
list
quicklist,双向循环链表
ziplist,压缩链表
hash,hmset role:1001 age 30 name mark sex 1, hgetall role:1001, hget role:1001
...