Redis server notes
- 2020-06-23 02:26:56
- OfStack
redis caches server notes
redis is a high-performance key-ES6en storage system that can act as a caching framework and queue
But since it is an in-memory system, the data will still be stored in the database
As a caching framework:
create/updae/delete-- save to both redis and database
query- Check from redis first, no record from the database, and put a copy of the results from the database to redis
As a cache queue:
2. Store the object Object in redis. memcache access objects are serialized and deserialized
Use common serialization, deserialization (frequent consume cpu, use Google Protocol Buffer, stream objects in base 2)
Or use json storage (Alibaba's ES38en-ES39en)
3, java using redis client 1 is generally: jedis
The native interface of jedis supports only basic data types and String, byte[]
4. My understanding of redis queue:
Important data: First to the database, then to redis
Data requiring high response times: writes to the cache and then to the database via message queues
conclusion