Introduction: remember a training process of the Redis online platform
First, enter the database online training platform , find the personal information column, and connect to the Redis database online, version V6.0.
Next, click to enter the Redis training environment,
Enter the commands separately,
# View redis related command information
redis-cli --help
# View redis process information
ps -ef | grep redis
# Enter the redis window
redis-cli -p 6379 或
# 中文正常显示
redis-cli -p 6379 --raw
# redis read-storage (key-value)
# 读取
get listChargeCount
# 存储
set listChargeCount "['墨天轮','公众号','CSDN论坛']"
We see that Chinese cannot be displayed normally, here we can pass the aforementioned:
# 中文正常显示
redis-cli -p 6379 --raw
Ok, now, the basic key-value (Redis data structure: String-string type) is done, let's take a look (Redis data structure: Hash-hash type):
# 存储
hset chargeCount dailyChargeCount "{'charge':1,'count':2}"
# 读取
hget chargeCount dailyChargeCount
Among them, the key is chargeCount, the field is dailyChargeCount, and the value is the object to be stored later. In fact, the value itself is a key-value pair structure, so we can regard key-field-value as key:field-value. It is more intuitive in the sense of caching and saves more space than the String type.
Here, we can mark in detail Redis's official value constraints on key and string types:
As for other data structure types based on Redis- actual project case-instant messaging , please refer to the translation point CSDN article:
https://blog.csdn.net/yxd179/article/details/115904752
"Past Articles"
Database Online Training Platform-MySQL
Elasticsearch Advanced | Remember kibana's actual combat process of executing dsl scripts
Oracle optimization case | Locating SQL query problems from the execution plan
Dameng | Remember a thought process of domestic database adaptation
Scan QR code
Get more exciting
Scan the QR code to follow the translation point
Source: Translate (invasion and deletion)
Edit: translation point (invasion and deletion)
Image source: Translate (invaded and deleted)