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
720
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
590
ZeroMQ - PyCon India 2013
cnu
2
1.6k
Other Decks in Programming
See All in Programming
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
200
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
1k
GitHubCopilotCLIをはじめよう.pdf
htkym
0
270
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
160
実用!Hono RPC2026
yodaka
2
270
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
1.2k
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
Back to the roots of date
jinroq
0
400
Making the RBS Parser Faster
soutaro
0
520
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
AIエージェントで業務改善してみた
taku271
0
540
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
140
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
340
New Earth Scene 8
popppiees
3
2.1k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
170
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
520
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Code Reviewing Like a Champion
maltzj
528
40k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
120
Statistics for Hackers
jakevdp
799
230k
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