Use Redis to cache (add cache when querying), Cache sync (delete cache when adding and deleting), Redis persistence (aof: Poor performance, data integrity; RDB: Save periodically, possibly lose data)
<!--Redis Standalone version - <BeanID= "Jedispool"class= "Redis.clients.jedis.JedisPool"> <Constructor-argname= "Host"value= "192.168.25.128"/> <Constructor-argname= "Port"value= "6379"/> </Bean> <BeanID= "Jedisclientpool"class= "Com.taotao.jedis.JedisClientPool"/> <!--Redis Cluster - <!-- <bean id= "Jediscluster" class= "Redis.clients.jedis.JedisCluster" > <constructor-arg> <set > <bean class= "redis.clients.jedis.HostAndPort" > <constructor-arg name= "host "Value=" 192.168.25.128 "/> <constructor-arg name=" port "value=" 7001 "/> </bea n> <bean class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "hos T "value=" 192.168.25.128 "/> <constructor-arg name=" port "value=" 7002 "/> </be an> <bean class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "ho St "value=" 192.168.25.128 "/> <constructor-arg name=" port "value=" 7003 "/> </b ean> <bean class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "H OST "Value=" 192.168.25.1"/> <constructor-arg name=" port "value=" 7004 "/> </bean> <bean class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "192.168.25. "/> <constructor-arg name=" port "value=" 7005 "/> </bean> <bean class= "Redis.clients.jedis.HostAndPort" > <constructor-arg name= "host" value= "192.168.25 . "/> <constructor-arg name=" port "value=" 7006 "/> </bean> &l t;/set> </constructor-arg> </bean> <bean id= "Jedisclientcluster" class= "com.taotao.jedis.Je Disclientcluster "/> -
Spring Integrated Redis