编程知识 cdmana.com

Redis cache of database

1.

matters needing attention :
1. The choice of data structure K-V structure
2. The cache can't be stored all the time Need to optimize LRU Algorithm
3. Cache requirements run fast ,C Language implementation Running in memory
4. If the cache is running in memory A sudden power failure / Downtime Cause direct loss of memory Realize the persistence operation of memory data ( disk )

2.redis

1. download redis Compressed package .tar.gz
tar -zxvf ( Target compressed file )
Change of name
2. Get into redis Catalog cd redis/
make (c Language writing Both make)
make install
modify redis.conf The configuration file Three changes

3.
1. Start command : redis-server redis.conf
2. Search command : ps -ef | grep redis
3. Get into redis: redis-cli -p 6379
image.png
close redis :
image.png

redis-cli shutdown
kill -9 (pid)

版权声明
本文为[Half gold]所创,转载请带上原文链接,感谢

Scroll to Top