-
一、Redis复制是什么?
Redis复制就是主从复制,当主服务器数据发生变化时,自动将新的数据同步到从数据库。
读数据库可以进行读写操作,从数据库一般指用于读操作。
Redis复制可以保证主
-
react 一直遵循UI = fn(state) 的原则,有时候我们的state却和UI不同步 有时候组件本身在业务上不需要渲染,却又会再一次re-render。之前在项目中遇到的一些问题,这里做一个简单的分析,大家可以
-
在当前环境下,通常我们会首选redis缓存来减轻我们数据库访问压力。但是也会遇到以下这种情况:大量用户来访问我们系统,首先会去查询缓存, 如果缓存中没有数据,则去查询数据库,然后
-
前提:因为本文主要围绕着在thinkPHP5中使用redis的,所以关于redis的安装就不特意说明了,不过在这稍微提醒一下,安装完redis后务必要开启php.ini扩展,否则还是无法使用redis的。配置1.会用ThinkPHP5的同学们都知道,TinkPHP5中封装了缓存类,我们只需要在/application/congfig.php中的cache中填入缓存配置项就可以使用了(如下所示)。2.从/thinkphp/library/think/cache/driver/Redis.php文件可知这里封
-
一、前言
为什么需要分布式锁?
在我们的日常开发中,一个进程中当多线程的去竞争某一资源的时候,我们通常会用一把锁来保证只有一个线程获取到资源。如加上synchronize关键字或ReentrantLock
-
Cannot convert value of type 'org.springframework.data.redis.core.convert.MappingRedisConverter' to required type 'org.springframework.data.redis.core.mapping.RedisMappingContext': no matching editors or conversion strategy found
在setVal
-
什么是 Redis
Redis 是基于内存的 K-V 数据库,常用于缓存、消息队列,分布式锁等场景,并且提供了常见的数据结构:字符串、哈希、列表、集合、带排序的集合
Redis 数据类型详解
前置知识
Redis
-
IDEA中的Redis插件作为Redis的可视化工具,可以通过该插件连接Redis服务器,并进行增删改查操作。
一、IDEA安装Redis插件
1、点击 File->Setting
2、点击Plugins
3、在Browse Repositories中输入redis
4、点击
-
1、四种同步策略:
想要保证缓存与数据库的双写一致,一共有4种方式,即4种同步策略:
先更新缓存,再更新数据库;先更新数据库,再更新缓存;先删除缓存,再更新数据库;先更新数据库
-
一、需求背景
最近项目需要做排行榜功能,实现员工邀请用户注册排行榜,要求是实时更新,查询要快。员工所属支行、二级行、省行,界面要根据条件显示排名数据。效果如下图所示:
原型
-
如何解决缓存双写问题
只要涉及到缓存,那么缓存双写的问题就避免不了,每一种情况下使用的方案也不相同,对于数据一致性要求不高的场景,我们可以使用延时双删等方案来实现,而对于
-
一、使用Jackson2JsonRedisSerializer序列化反序列化带泛型的List数据
1、使用Jackson2JsonRedisSerializer序列化value的代码:
RedisTemplate template = new RedisTemplate();
template.setKeySerializer(new StringRedisSerializer());
templa
-
redis中没有直接根据正则表达式删除key的命令,只有del key1 key2...命令
但是redis中有通过正则表达式获取key的命令:keys "正则表达式"
可以借助于xargs命令实现批量删除key,把查出来的key值当做参数
-
一、验证密码有没有生效
运行cmd,cd到redis的目录下
输入“redis-cli.exe” 回车
输入“auth 123456” 回车
若错误,说明没有设置密码或者设置的密码没有生效
输入“exit” 回车就
-
全量同步
主从第一次同步是全量同步:也就是说,当你主从节点连接建立后,需要执行一次全量同步。那么Redis如何实现全量同步呢?
其实本质就是Master 给 slave 发送其保存的RDB文件。slave读取R