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
cnu
September 03, 2017
Programming
700
0
Share
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
580
ZeroMQ - PyCon India 2013
cnu
2
1.6k
Other Decks in Programming
See All in Programming
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
5
2.8k
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
490
「速くなった気がする」をデータで疑う
senleaf24
0
140
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
190
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
140
20260315 AWSなんもわからん🥲
chiilog
2
190
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.6k
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
560
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
200
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
190
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
430
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
Odyssey Design
rkendrick25
PRO
2
560
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
エンジニアに許された特別な時間の終わり
watany
106
240k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Accessibility Awareness
sabderemane
0
93
Docker and Python
trallard
47
3.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Why Our Code Smells
bkeepers
PRO
340
58k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
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