Redis Learning
来源:互联网 发布:淘宝店铺怎么查排名 编辑:程序博客网 时间:2024/06/08 17:17
应用场景:
redis 适用于小而热的数据
- Redis应用场景
- Redis作者谈Redis应用场景
我们在应用redis的场景是 缓存
将收到的post报文缓存下,然后批量插入redshift
github上的scala版redis client
官方推荐了好几款开源的scala 版客户端,都不知道选哪个比较好了,应该迅速读一遍scala 并发编程
Redis is an open source(BSD Licensed),in-memory data structure store,
used as a database,
cache,
and message broker.
It supports data structures such as strings,hashes,lists,sets,sorted sets with range queries,bitmaps,hyperloglogs and geospatial indexes with radius queries.
build-in:
- replication
- Lua scripting
- LRU eviction
- transaction
- different levels of on-disk persistence
- provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing an element to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set.
in-memory dataset:
In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Persistence can be optionally disabled, if you just need a feature-rich, networked, in-memory cache.
no-blocking replication:
Redis also supports trivial-to-setup master-slave asynchronous replication, with very fast non-blocking first synchronization, auto-reconnection with partial resynchronization on net split.
transcation数据库事务
彻底搞懂事务
6379-为何Redis选择它作为默认端口号?
redis 使用服务器端/客户端架构的数据库架构
通过client去连接redis服务端
- 我们可以通过redis-cli去连接redis数据库,这是学习测试redis最好的方法,这时redis-cli就是一个client
之前连接关系型数据库一般都是通过JDBC的方式连接的,这个redis是怎么连接上去的我暂时还没有搞清楚,官方推荐了很多类似与sdk的工具库,使用这些库可以很方便的连接redis,
redis 持久化
有两种方式做持久化,其一是RDB,定期备份数据库的状态;其二是AOF,记录数据库的相关命令
优先使用AOF方式
使用list来存储数据,LPUSH mylist "1"
// BRPOP mylist 0 取出最先放入的元素,
每分钟生成一个key,同步数据只处理之前的key里面的数据
做一个事务,保证该元素处理的原子性
因为BRPOP 只能取出最后一个元素,所以应该使用BPOPLPUSH
- Redis Learning
- Learning Redis - 概念
- Learning Redis - 收集网络知识
- 《Learning Redis》学习笔记一:基础介绍
- 《Learning Redis》学习笔记二:服务器功能
- Learning
- learning
- learning
- learning
- learning
- learning
- learning
- Redis
- redis
- Redis
- redis
- Redis
- redis
- gitlab添加新用户
- Spray handle Post request
- 安卓篇--模拟器加载自己编译的内核
- Hash 算法
- Android 使用动画设置ProgressBar进度
- Redis Learning
- Todo
- ThinkPHP 配置 去掉 index.php
- Apple MackBook 选购比较
- Mastering Http Response
- :after伪类+content内容生成经典应用举例
- 日处理20亿数据,实时用户行为服务系统架构实践
- NYOJ-备用2344 盖伦的告白(线段树,区间最大值)
- CSU 1129:送货到家