Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Probabilistic Data Structures
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
cnu
September 03, 2017
Programming
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Probabilistic Data Structures
Learn how to use Probabilistic Data Structures and modules in Redis v4 to analyse logs.
cnu
September 03, 2017
More Decks by cnu
See All by cnu
Redisconf 2018: Probabilistic Data Structures
cnu
1
1.1k
The Rocky Road from Monolithic to Microservices Architecture
cnu
0
1.2k
AWS Lambda - Pycon India 2016
cnu
0
640
ZeroMQ - PyCon India 2013
cnu
2
1.7k
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
280
Android CLI
fornewid
0
160
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
170
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
240
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
2k
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
5.4k
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
140
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
350
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
210
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.2k
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
130
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
500
Building AI with AI
inesmontani
PRO
1
1.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Ethics towards AI in product and experience design
skipperchong
2
330
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
880
Rails Girls Zürich Keynote
gr2m
96
14k
Building the Perfect Custom Keyboard
takai
2
820
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
310
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
Making Projects Easy
brettharned
120
6.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Transcript
Probabilistic Data Structures in Redis
Srinivasan Rangarajan Head of Engineering
Srinivasan Rangarajan @cnu https://cnu.name
Agenda • Log Analysis • Redis V4 • Probabilistic Data
Structures
Log Analysis
Challenges • 100s of Millions of events processed every day
• Peak of ~10 Million events in an hour • Needs Realtime processing • Memory/Storage Requirements
Cost Accuracy Scale
None
Sample Event Data { "ip": "123.123.123.123", "client_id": 232, "user_id": "35827",
"email": "
[email protected]
", "product_id": "ABC-12345", "image_id": 3, "action": "pageview", "datetime": "2017-06-29T12:42:53Z", }
None
Redis Version 4 • Module system • Better Replication •
Cache eviction Improvements • Non-Blocking DEL and FLUSH* commands • Mixed RDB-AOF persistence format • MEMORY DOCTOR
Modules mikicon NounProject
Loading Modules • ./redis-server --loadmodule /path/to/module.so • redis.conf loadmodule /path/to/module.so
• MODULE LOAD /path/to/module.so
Execute a custom command
Probabilistic Data Structures
There are three kinds of people in the world. 1.
Those who can count. 2. Those who can’t count.
There are three kinds of people in the world. data
structures 1. Those who can count. 2. Those who can’t count. 3. Those who count approximately.
None
Advantage: Huge Memory Savings
3 Data Structures
HyperLogLog Count the Cardinality of a Set http://antirez.com/news/75
Count Unique Visitor / hour
Merge Hourly into Daily
TopK Get Top k Elements in a set https://github.com/RedisLabsModules/topk
Top k IP Addresses
None
CountMinSketch Count the frequency of items https://github.com/RedisLabsModules/countminsketch
User Pageview counter
Bloom Filters Test membership in a set https://github.com/RedisLabsModules/rebloom
Bloom Filters False Positives False Negatives
User Session checking
~3 Data Structures • HyperLogLog • TopK • CountMinSketch •
BloomFilter
Thank you
Follow me @cnu