Enviar pesquisa
Carregar
Redis use cases
•
Transferir como PPT, PDF
•
0 gostou
•
1,119 visualizações
Bottom Wang
Seguir
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 36
Baixar agora
Recomendados
Shell奇技淫巧
Shell奇技淫巧
David Xie
Mongodb
Mongodb
bj
Log analytics
Log analytics
itseo
MongoDB for C# developer
MongoDB for C# developer
dianming.song
Jsonp
Jsonp
LearningTech
高性能No sql数据库redis
高性能No sql数据库redis
paitoubing
Autorelease pool
Autorelease pool
Michael Pan
twMVC#36C#的美麗與哀愁
twMVC#36C#的美麗與哀愁
twMVC
Recomendados
Shell奇技淫巧
Shell奇技淫巧
David Xie
Mongodb
Mongodb
bj
Log analytics
Log analytics
itseo
MongoDB for C# developer
MongoDB for C# developer
dianming.song
Jsonp
Jsonp
LearningTech
高性能No sql数据库redis
高性能No sql数据库redis
paitoubing
Autorelease pool
Autorelease pool
Michael Pan
twMVC#36C#的美麗與哀愁
twMVC#36C#的美麗與哀愁
twMVC
Glider
Glider
windyrobin
OpenResty/Lua Practical Experience
OpenResty/Lua Practical Experience
Ho Kim
scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎
Ping Yin
Java soap
Java soap
accontra
Google developer tool 簡介
Google developer tool 簡介
Shu Ting Hsieh
揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing
Yi-Jun Zheng
12. 網路通訊方案
12. 網路通訊方案
Justin Lin
Node分享 展烨
Node分享 展烨
tb-vertical-guide
Template mb-kao
Template mb-kao
xwcoder
AJAX Basic
AJAX Basic
Ryan Chung
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Vincent Chi
Web scraping入門1
Web scraping入門1
兆欽 丘
Mvc
Mvc
tbmallf2e
Zoo keeper
Zoo keeper
amazingjxq
Node getting-started
Node getting-started
lylijincheng
Redis and its many use cases
Redis and its many use cases
Christian Joudrey
Introduction to some top Redis use cases
Introduction to some top Redis use cases
Josiah Carlson
See who is using MemSQL
See who is using MemSQL
jenjermain
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
Riak seattle-meetup-august
Riak seattle-meetup-august
pharkmillups
Riak add presentation
Riak add presentation
Ilya Bogunov
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho Technologies
Mais conteúdo relacionado
Mais procurados
Glider
Glider
windyrobin
OpenResty/Lua Practical Experience
OpenResty/Lua Practical Experience
Ho Kim
scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎
Ping Yin
Java soap
Java soap
accontra
Google developer tool 簡介
Google developer tool 簡介
Shu Ting Hsieh
揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing
Yi-Jun Zheng
12. 網路通訊方案
12. 網路通訊方案
Justin Lin
Node分享 展烨
Node分享 展烨
tb-vertical-guide
Template mb-kao
Template mb-kao
xwcoder
AJAX Basic
AJAX Basic
Ryan Chung
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Vincent Chi
Web scraping入門1
Web scraping入門1
兆欽 丘
Mvc
Mvc
tbmallf2e
Zoo keeper
Zoo keeper
amazingjxq
Node getting-started
Node getting-started
lylijincheng
Mais procurados
(15)
Glider
Glider
OpenResty/Lua Practical Experience
OpenResty/Lua Practical Experience
scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎
Java soap
Java soap
Google developer tool 簡介
Google developer tool 簡介
揭秘家用路由器Ch10 sharing
揭秘家用路由器Ch10 sharing
12. 網路通訊方案
12. 網路通訊方案
Node分享 展烨
Node分享 展烨
Template mb-kao
Template mb-kao
AJAX Basic
AJAX Basic
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Web scraping入門1
Web scraping入門1
Mvc
Mvc
Zoo keeper
Zoo keeper
Node getting-started
Node getting-started
Destaque
Redis and its many use cases
Redis and its many use cases
Christian Joudrey
Introduction to some top Redis use cases
Introduction to some top Redis use cases
Josiah Carlson
See who is using MemSQL
See who is using MemSQL
jenjermain
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
Riak seattle-meetup-august
Riak seattle-meetup-august
pharkmillups
Riak add presentation
Riak add presentation
Ilya Bogunov
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho Technologies
Scaling with Riak at Showyou
Scaling with Riak at Showyou
John Muellerleile
Redis : Play buzz uses Redis
Redis : Play buzz uses Redis
Redis Labs
Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)
Michal Bachman
Riak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard Problems
Andy Gross
An intro to Neo4j and some use cases (JFokus 2011)
An intro to Neo4j and some use cases (JFokus 2011)
Emil Eifrem
Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)
Michal Bachman
Advanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware Framework
Michal Bachman
Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
Michal Bachman
Best Buy Web 2.0
Best Buy Web 2.0
Lee Aase
Introduction to Redis Data Structures: Sorted Sets
Introduction to Redis Data Structures: Sorted Sets
ScaleGrid.io
The BestBuy.com Cloud Architecture
The BestBuy.com Cloud Architecture
joelcrabb
Redis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HA
Dave Nielsen
Using Redis at Facebook
Using Redis at Facebook
Redis Labs
Destaque
(20)
Redis and its many use cases
Redis and its many use cases
Introduction to some top Redis use cases
Introduction to some top Redis use cases
See who is using MemSQL
See who is using MemSQL
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
Riak seattle-meetup-august
Riak seattle-meetup-august
Riak add presentation
Riak add presentation
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Basho and Riak at GOTO Stockholm: "Don't Use My Database."
Scaling with Riak at Showyou
Scaling with Riak at Showyou
Redis : Play buzz uses Redis
Redis : Play buzz uses Redis
Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)
Riak Use Cases : Dissecting The Solutions To Hard Problems
Riak Use Cases : Dissecting The Solutions To Hard Problems
An intro to Neo4j and some use cases (JFokus 2011)
An intro to Neo4j and some use cases (JFokus 2011)
Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)
Advanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware Framework
Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
Best Buy Web 2.0
Best Buy Web 2.0
Introduction to Redis Data Structures: Sorted Sets
Introduction to Redis Data Structures: Sorted Sets
The BestBuy.com Cloud Architecture
The BestBuy.com Cloud Architecture
Redis as a Main Database, Scaling and HA
Redis as a Main Database, Scaling and HA
Using Redis at Facebook
Using Redis at Facebook
Semelhante a Redis use cases
Web Caching Architecture and Design
Web Caching Architecture and Design
Ho Kim
纵览Loadrunner核心功能
纵览Loadrunner核心功能
beiyu95
Nosql三步曲
Nosql三步曲
84zhu
Another Introduce to Redis
Another Introduce to Redis
jiaqing zheng
Large-Scale Cluster Mangement & Kubernetes Under The Hood
Large-Scale Cluster Mangement & Kubernetes Under The Hood
Lei (Harry) Zhang
RxJS 6 新手入門
RxJS 6 新手入門
Will Huang
MySQL InnoDB 源码实现分析(一)
MySQL InnoDB 源码实现分析(一)
frogd
CRUD 綜合運用
CRUD 綜合運用
Shengyou Fan
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
Will Huang
KISSY for starter
KISSY for starter
yiming he
合久必分,分久必合
合久必分,分久必合
Qiangning Hong
Android進階UI控制元件
Android進階UI控制元件
艾鍗科技
Fiddler使用经验分享
Fiddler使用经验分享
hua qiu
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
Angel Boy
Win dbg入门
Win dbg入门
晓锋 陈
Windbg入门
Windbg入门
晓锋 陈
InnoDB Transaction Lock and MVCC
InnoDB Transaction Lock and MVCC
frogd
CRUD 綜合運用
CRUD 綜合運用
Shengyou Fan
Web请求异步处理和海量数据即时分析在淘宝开放平台的实践
Web请求异步处理和海量数据即时分析在淘宝开放平台的实践
mysqlops
線上埋碼資料收集實作
線上埋碼資料收集實作
FEG
Semelhante a Redis use cases
(20)
Web Caching Architecture and Design
Web Caching Architecture and Design
纵览Loadrunner核心功能
纵览Loadrunner核心功能
Nosql三步曲
Nosql三步曲
Another Introduce to Redis
Another Introduce to Redis
Large-Scale Cluster Mangement & Kubernetes Under The Hood
Large-Scale Cluster Mangement & Kubernetes Under The Hood
RxJS 6 新手入門
RxJS 6 新手入門
MySQL InnoDB 源码实现分析(一)
MySQL InnoDB 源码实现分析(一)
CRUD 綜合運用
CRUD 綜合運用
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
進擊的前端工程師:今天就用 JSON Server 自己打造 API 吧!
KISSY for starter
KISSY for starter
合久必分,分久必合
合久必分,分久必合
Android進階UI控制元件
Android進階UI控制元件
Fiddler使用经验分享
Fiddler使用经验分享
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
Win dbg入门
Win dbg入门
Windbg入门
Windbg入门
InnoDB Transaction Lock and MVCC
InnoDB Transaction Lock and MVCC
CRUD 綜合運用
CRUD 綜合運用
Web请求异步处理和海量数据即时分析在淘宝开放平台的实践
Web请求异步处理和海量数据即时分析在淘宝开放平台的实践
線上埋碼資料收集實作
線上埋碼資料收集實作
Redis use cases
1.
Redis 使用案例探索
Remote Dictionary Server Bruce Wang
2.
Agenda •
基本数据结构和功能 • Use Case • Redis 使用注意事项
3.
基本数据结构和功能 •
String • Keys • List • Set • Sorted Set • Hash
4.
String
1. Blob 可以放在 String 类型的 Cache 中 2. String 可以做 Append 操作 3. String Key 中可以存 Integer 类型的值
5.
Keys 1. Key
可以设置超时时间 2. Key 可以做正则匹配
6.
List
7.
List 1.
左右插入链表 2. 截取链表 3. 读取链表
8.
Set
9.
Set 1.
Set 元素惟一性 2. Set 集合运算
10.
Sorted Set
11.
Sorted Set 1.
按排名按 Score 增序倒序获取元 素 2. 更改元素 Score
12.
Hash
13.
Hash 1. 设置
Hash K-V 2. 获取 Hash K-V
14.
USE CASE
• 排重 • 计数器 • List 应用 • Set 应用 • Sorted Set 应用 • Hash 应用 • Other
15.
Use Case 排重
1. SETNX 命令
16.
排重 - 秒杀系统
每个 Item 的值只会有一次写入的机会 Setnx $itemId $winnerId
17.
Use Case 计数器 1.
INCR, INCRBY, DECR, DECRBY, HINCRBY 命令
18.
计数器应用 1.
ID 生成器 2. Web 分析 3. 防 DDOS 攻击 4. API 访问率控制
19.
计数器 - ID
生成器 1. 逻辑中心化 & 部署上分布式 2. 可根据不同的 DC 做不同的步长 3. 处理某个类型的 Seq 必定落在固定的 Instance 上, 由 Redis Server 的单进程机制保证惟一性 Incrby Seq:$ObjectType $step
20.
计数器 - Web
分析 1. 可多样化统计用户行为 Incr view:$pageId Incr view:$pageId: $timeFrame Incr logon:$userId Incr logon:$userId:$timeFrame
21.
计数器 - Anti-DDOS
, API 访问率控制 1. 可根据不同需求设置统计时间片和最大 hit 的阀值 $Count = Incr hitCount:$user:$API_id if(count==0) expire hitCount:$user:$API_id $timeFrame Else If (hitCount$user > 阀值 ) 拒绝服务 Else 响应服务
22.
List-LOGGER 收集 使用
List • App 客户端: Lpush logger:$appid:serverId $log • Logger Server: Worker 轮询 Ltrim logger:$appid 0 99 write to NFS, HDFS…. Logger 其他方案—使用 Blob • App 客户端 : append logger:$appId:$serverId $log • Logger Server: Worker 轮询 ogger:$appId:$serverId $log
23.
Set 应用 1.
社区好友 2. 随机推荐
24.
Set- 社区好友 Sadd
friend:$userId1 $userA Sadd friend:$userId1 $userB Sadd friend:$userId2 $userC Sadd friend:$userId2 $userA Sadd onlineUser $userA 共同好友 SInter friend:$userId1 $friend:$userId1 在线好友 Sinter friend:$userId1 onlineUser
25.
Set- 随机推荐 •
随机推荐好友 Srandmember recommandFriendsSet:$userId • 随机推荐热图 Srandmember recommandPhotosSet:$hotPhotos
26.
Use Case -
Sorted Set 使用 1. 排行榜 2. GEO 相关搜索 3. 最近浏览页面
27.
Sorted Set –
排行榜
28.
Sorted Set -
GEO 搜索 附近搜索 1. 经纬度 64 位 Hash Hash 值的特点: 越近的地点 Hash 值前面相同的位越大 海底捞 (120.2E ,30.3N) 14326455945304181035 外婆家 (121.3E, 31.1N) 14326502174498709381 2. Zadd resturant:set $hash $resturant 3. 获取推荐餐馆 zrangebyScore resturant:set ($userLocationHash - $offset) ($userLocationHash + $offset)
29.
Sorted Set –
最近浏览页面 • 页面浏览: Zadd recentPageView:$User $timestamp page1 Zadd recentPageView:$User $timestamp page2 • 获取最近浏览 10 个页面 : zrevrange recentPageView:$User 0 10 withscores
30.
Hash– 购物车 购物车添加商品:
Hincrby $cartId $productId $number 获取商品 : Hgetall $cartId
31.
Use Case -
Other 1. Session Storage 2. 公平调度器
32.
其他– Session 存储
登录: Set $SessionKey $anyValue ••登录: Set $SessionKey $anyValue 每次访问: Expire $sessionKey ••每次访问: Expire $sessionKey $timeFrame $timeFrame
33.
其他– 公平调度器 1. Worker
•Worker: ZADD worker:nodes $load $hostname •Worker: BLPOP $hostname 2. Client •Work client: Zrange worker:nodes 0 2 •Work Client: LPUSH $hostname $task
34.
其他– 优先级 Queue 1.
Producer: Lpush $queueName anyValue Zadd task:$queueName $priority $task Zincrby task:$queueName $task $incrNum 2. Subscriber: Blpop $queueName Task = Zrevrange task:$queueName 0 1 Sadd $subscriberName $Task Execute task Srem t $subscriberName $Task
35.
Redis 使用注意事项 •Use
Hash VS encoded object •Key 可能分布在不同的 Redis Instance 中 •不要使用 Redis 做它不擅长的事情 •Expire 与内存最大值 •Expire when rename key
36.
We Provide
The Best !
Notas do Editor
Morton , geoHash
Morton , geoHash
Morton , geoHash
Hash 可以启用压缩, 较少占内存, Hash 按需取 Hash Key : field , 减少 IO 安全性 条件查询 Queue 功能 VS 消息服务器 在 2.4.x 里,如果设置了 maxmemory ,那么当内存占用没有达到极值时,设置 expire 的 key 到期后并不会被立即删除;所以,如果期望利用 expire 让 redis 清除过期数据,建议还是不要设置 maxmemory 。
谢谢观看!
Baixar agora