SlideShare a Scribd company logo
#redisconf17
DOING MORE WITH REDIS
OFER BENGAL
YIFTACH SHOOLMAN
CO-FOUNDERS, REDIS LABS
#1 – Running Redise Flash
in a DBaaS Model
Redise Cloud Private
Fully managed, serverless scaling Redise service
in VPCs
on: AWS, MS Azure, GCP & IBM Softlayer
Redise Flash – Built for a Tiered Memory Architecture
Persistent Storage:
Entire Dataset
AOF, Snapshot
SSD:
Cold Values
DRAM:
Keys & Hot Values
Cluster Node
Flexible RAM : Flash Ratios
New Memory Technology is Evolving Fast
DRAM vs Flash : Performance vs Cost
$9
$0.4
$1
$2
Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
I3 (NVMe) are x2.6 Faster and 80% Cheaper than I2 (SATA)
Single node @ <1msec latency
Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
New Flash-GT card with multiple NVMes integrated
Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
New Flash-GT card with multiple NVMes integrated
New 3D XPoint chipset on NVME Devices
Redise Flash + Intel® Optane™ SSD
2040
1380
590
728
142
64
0
500
1000
1500
2000
2500
95% 85% 50%
KOps/sec
RAM hit ratio
item size = 1000B; read/write = 50%/50%
Optane
P3700
Up to x9
Similar to what runs on:
DBaaS Price Comparison
$2,200,162/yr
$1,772,606/yr
$766,096/yr
$232,875/yr
$0/yr
$500,000/yr
$1,000,000/yr
$1,500,000/yr
$2,000,000/yr
$2,500,000/yr
Other Redis Provider RCP RAM Cloud-Based NoSQL RCP Flash
2TB Dataset with HA @ 100K ops/sec (on-demand pricing)
<1msec <1msec <10msec <1msec
Up to 89% saving!
#2 – Modules Are Gaining Momentum
Modules Status
• 50+ created
• C, C++, Go, Python supported
• Multi-threaded infrastructure
Why Multi-Threading is Crucial for Modules
100msec
(module)
0.1msec
(core)
0.1msec
(core)
0.1msec
(core)
A Single-Threaded
Module
Why Multi-Threading is Crucial for Modules
100msec
(module)
0.1msec
(core)
0.1msec
(core)
0.1msec
(core)
A Single-Threaded
Module
100.3msec 100.2msec 100.1msec 100msec
Average latency - 100.15msec
Module latency - 100msec
Average core latency - 100.2msec
Why Multi-Threading is Crucial for Modules
100msec
(module)
0.1msec
(core)
0.1msec
(core)
0.1msec
(core)
A Multi-Threaded
Module
0.3msec 0.2msec 0.1msec 100msec
Average latency - 25.15msec
Module latency - 100msec
Average core latency - 0.2msec
100msec
(module)
0.1msec
(core)
0.1msec
(core)
0.1msec
(core)
A Single-Threaded
Module
100.3msec 100.2msec 100.1msec 100msec
Average latency - 100.15msec
Module latency - 100msec
Average core latency - 100.2msec
4 Useful Modules
RediSearch
ReJSON
Redis-ML
Redis-Graph
4 Useful Modules
RediSearch
ReJSON
Redis-ML
Redis-Graph
Friends, Friends of Friends and Visited Countries
Query: Friends Who’ve Visited Places I’ve Been To
MATCH (:person {name:“Roi Lipman”})-
[:visited]->(c:country)<-[:visited]-
(f:person)<-[:friend]-
(:person {name:“Roi Lipman”})
RETURN f, c
Result: Friends Who’ve Visited Places I’ve Been To
Query: Who’s Gone on a Business Trip
MATCH (p:person)-
[v:visited {purpose:business}]->(c:country)
RETURN p, v, c
Result: Who’s Gone on a Business Trip
Benchmarks
Per shard
• 150K inserts / sec
• 15K queries / sec
A Deep Dive on Redis-Graph:
Salon 12 @ 2:30 pm
4 Useful Modules
RediSearch
ReJSON
Redis-ML
Redis-Graph
The Machine / Deep Learning (ML/DL) World
(1) Training (2) Creating a model (3) Serving the model
(1) Training (2) Creating a model (3) Serving the model
Homegrown
The Machine / Deep Learning (ML/DL) World
Challenge #1 - Model Accuracy
Challenge #1 - Model Accuracy
Just avoid…
Real World Example
• Ads serving company
• Need to serve 20,000 ads/sec @ 50msec data-center latency
• Runs 1k campaigns
Real World Example
• Runs 1k campaigns  1K random forest
• Each forest has 15K trees
• On average each tree has 7 levels (depth)
20K x 1K x 15K x 3.5 = 1.05 trillion ops/sec
Challenge #2 - Accurate Models are Expensive to Serve!
Item Calculation Total
Max ops/sec on the
strongest AWS
instance vcore
2.6Ghz x
0.9 (OS overhead) x
0.1 (10 lines of code per ops) x
0.1 (Java overhead)
23.4 million
# of vcores needed 1.05 trillion / 23.4 million 44,872
# of c4.8xlarge
instances needed
44,872 / 36 1,247
Total cost
reserved instances
1,247 x 9213 ~$11.5M/yr
Ads Serving Use-Case w/ and w/o Redise + ML
Homegrown
1,247 x c4.8xlarge 35 x c4.8xlarge
Cut computing infrastructure by
97%
How ML/DL Should be Severed
(1) Training (2) Creating a model (3) Serving the model
A Deep Dive on Redis-ML:
Salon 8 @ 1:45 pm
4 Useful Modules
RediSearch
ReJSON
Redis-ML
Redis-Graph
Jeff Atwood's Law (Stack Overflow, Stack Exchange) :
"any application that can be written in
JavaScript, will eventually be written in
JavaScript"
This Leads To:
"...any database will eventually store
[some data in] JSON"
What We Found
ReJSON (= Redis + JSON) in 5 Words
• Intuitive
• Integrated
• Any client
• Fast
Performance: 39491 bytes, 3 nesting levels
ReJSON
Raw JSON & Lua
MessagePack & Lua
4 Useful Modules
RediSearch
ReJSON
Redis-ML
Redis-Graph
The Fastest Search in Town
x5 - x10 Faster
The Feature List is Long
1. Full-Text indexing of multiple fields in documents
2. Incremental indexing without performance loss
3. Document ranking (provided manually by the user at
index time)
4. Complex Boolean queries with AND, OR, NOT operators
between sub-queries
5. Optional query clauses
6. Prefix based searches
7. Field weights
8. Auto-complete suggestions (with fuzzy prefix
suggestions)
9. Exact Phrase Search, Slop based search
10. Stemming based query expansion in many
languages (using Snowball)
11. Support for custom functions for query expansion
and scoring (see Extensions)
12. Limiting searches to specific document fields (up
to 8 fields supported)
13. Numeric filters and ranges
14. Geo filtering using Redis' own Geo-commands
15. Supports any utf-8 encoded text
16. Retrieve full document content or just ids
17. Automatically index existing HASH keys as
documents
18. Document deletion and updating with index garbage
collection.
RediSearch Shard
Redis Search Engine Coordinator
+ + =
RediSearch Shard
RediSearch Cluster
Node 1
Node 2
Node 3
RediSearch Cluster
Node 1
Node 2
Node 3
ClientFT.SEARCH idx “foo”
RediSearch Cluster Fully-Connected Fan-Out/In
Node 1 Node 3
“foo” {3}
“foo” {4}
“foo” {5}
“foo” {6}
“foo” {2}
“foo” {1}
ClientFT.SEARCH idx “foo”
Node 2
When RediSearch Cluster Becomes Larger
Node 1
Node 2
Node 3
RediSearch Cluster Tree-Based Fan-Out/In
Node 1
Node 2
Node 3
“foo” {5},{6},{7},{8} “foo” {9},{10},{11},{12}
ClientFT.SEARCH idx “foo”
RediSearch Cluster Tree-Based Fan-Out/In
Node 1
Node 2
Node 3
“foo” {5},{6},{7},{8} “foo” {9},{10},{11},{12}
ClientFT.SEARCH idx “foo”
“foo” {5}
“foo” {7}
“foo” {6}
“foo” {8}
“foo” {1}
“foo” {3}
“foo” {2}
“foo” {4}
“foo” {9}
“foo” {11}
“foo” {10}
“foo” {12}
Let’s See it in Action…
Preview
#3 – Redis for IoT
RedisConf17 - Doing More With Redis - Ofer Bengal and Yiftach Shoolman
RedisConf17 - Doing More With Redis - Ofer Bengal and Yiftach Shoolman
IoT Architecture
Devices
IoT Architecture
Devices
Edge
IoT Architecture
Devices
Cloud
Edge
The Evolution of an IoT Device
Simple Sensor
The Evolution of an IoT Device
Simple Sensor
Complex Device
More
Features
The Evolution of an IoT Device
Simple Sensor
Complex Device Complex Device
with Memory
More
Features
Online/
Offline
Memory
Redis-Based IoT Device
• Runs on Raspberry Pi
• Single OSS Redis instance
(3MB footprint)
• Redis Stream client
• Persistence
• Low cost
IoT Edge Challenges
Small Form Factor Cluster
(Per node: 4 cores, 1-2GB DRAM, 50GB Flash)
IoT Edge Challenges
Small Form Factor Cluster
(Per node: 4 cores, 1-2GB DRAM, 50GB Flash)
Thousands of Devices
(20K+ devices, 10 updates/sec/device
200K+ updates/sec)
IoT Edge Challenges
Small Form Factor Cluster
(Per node: 4 cores, 1-2GB DRAM, 50GB Flash)
Thousands of Devices
(20K+ devices, 10 updates/sec/device
200K+ updates/sec)
Varied Functionality
(Time series, Search, Graph, ML, Geo)
IoT Edge Challenges
Simple & Reliable
(Integrated, short failover time)
Small Form Factor Cluster
(Per node: 4 cores, 1-2GB DRAM, 50GB Flash)
Thousands of Devices
(20K+ devices, 10 updates/sec/device
200K+ updates/sec)
Varied Functionality
(Time series, Search, Graph, ML, Geo)
Redise Cluster for the Edge
• Redise Cluster on RPI/x86
• Redise Flash
• Persistent & HA
• Redis Streams Server + Client
• Module options:
Search, JSON, Graph,
Time-Series, ML, Neural, RQL,
Enhanced GEO
Stream API Streams Data-Structure Multi-Function
1 2 3
Time-series
JSON
ML
Graph
Search
GEO
RQL
Redise Blueprint for IoT
Devices
• Raspberry Pi support
• A single OSS Redis instance
(3MB footprint)
• Persistent
• Redis Streams Client
• RPi/x86 nodes
(4 cores/2GB RAM /50GB SSD)
• Redise cluster
• Persistent & HA
• Redise on Flash
• Redis Streams Server & Client
• Modules:
‒ Search, JSON, Graph, Time-Series,
ML, Nueral, RQL, Enhanced GEO
Edge
• Large Redise cluster(s)
• Multi-cloud/DBaaS/Self-managed
• Multi-master geo-replication
• Persistent & HA (multi-az)
• Redise on Flash
• Redis Streams Server
• Modules:
‒ Search, JSON, Graph, Time-Series,
ML, RQL, Enhanced GEO
Cloud
#4 – Multi-Master Geo-Distributed Redis
Multi-Master Geo-Distributed Workloads
BIDDING/POLLING/LEADERBOARD
₤
$
$
₱
€
PROFILES/SESSION MANAGEMENT
Challenge #1 – Geo-Distributed Latency
Redis is fast!: > 1,000,000 ops/sec, < 1msec latency
Light is slower > 20msec RTT
Network is even slower > 70msec RTT
Consistency  Consensus  Slowness
App
App
App
~100msec for a ‘write’ operation
Challenge #2 – Conflict Resolution for Complex Data-Types
• Application level solution  too complex to write
• LWW (Last Write Wins)  doesn’t work for many of the Redis use cases, e.g.:
• Counters
• Sets
• Sorted Sets
• Lists
• Modules’ new datatypes
Hello CRDT
Conflict-free Replicated Data Type
CRDT
• Years of academic research
• Based on consensus free protocol
• Strong eventual consistency
• Built to resolve conflicts with complex data types
Consensus Free with Strong Eventual Consistency
App
App
App
Write Locally
Consensus Free with Strong Eventual Consistency
App
App
App
Write Locally, Converge Asynchronously
Solving Conflicts – Counters
Replica A:
C = 500
Replica B:
C = 500
Replica C:
C = 500
Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
Replica C:
C = 500
Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
INCRBY 1000
Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
INCRBY 1000
Convergence Function (commutative):
500 + ΣC(i) =
= 500 +200 -300 +1000
= 1400
Solving Conflicts – Sets
Replica A:
S = {A, B, C}
Replica B:
S = {A, B, C}
Replica C:
S = {A, B, C}
Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
Replica C:
S = {A, B, C}
Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
SREM A
Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
SREM A
Convergence Function (associative):
• S = S + D + A - A =
{A, B, C, D}
• Observed Removed + Add wins
Solving Conflicts – Sorted Sets
Replica A:
SS =
{A:35, B:23, C:4}
Replica B:
SS =
{A:35, B:23, C:4}
Replica C:
SS =
{A:35, B:23, C:4}
Solving Conflicts – Sorted Sets
Replica A:
SS =
{A:35, B:23, C:4}
Replica B:
SS =
{A:35, B:23, C:4}
Replica C:
SS =
{A:35, B:23, C:4}
Convergence Function
(associative & commutative):
Counters + Sets
Solving Conflicts – Lists
Replica A:
L= ABC
Replica B:
L= ABC
Replica C:
L= ABC
Solving Conflicts – Lists
Replica A:
L= ABC
Replica B:
L= ABC
Replica C:
L= ABC
Convergence Function:
Based on Directed Acyclic
Graphs (DAG)
Too complex to explain!!!
Multi-Master Redis is Here
Preview
What’s Unique About Redis-CRDT
• Based on a Redis module (CRDB)
• Support bi-direction replication
• Multiple topologies
• Solves a new set of problems
• Counters deletion
• Expiry
• Cluster configuration
• Etc.
RingFully-Connected
A Deep Dive on Multi-Master:
Salon 8 @ 3:15 pm
Thank You

More Related Content

PPTX
RedisConf17- Using Redis at scale @ Twitter
PDF
RedisConf17 - Redis Graph
PDF
RedisConf17 - Searching Billions of Documents with Redis
PPTX
RedisConf17 - Redis Cluster at flickr and tripod
PDF
RedisConf17 - Lyft - Geospatial at Scale - Daniel Hochman
PPTX
RedisConf17 - Rax, Listpack and Safe Contexts
PPTX
What's new with enterprise Redis - Leena Joshi, Redis Labs
PPTX
Managing 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops Team
RedisConf17- Using Redis at scale @ Twitter
RedisConf17 - Redis Graph
RedisConf17 - Searching Billions of Documents with Redis
RedisConf17 - Redis Cluster at flickr and tripod
RedisConf17 - Lyft - Geospatial at Scale - Daniel Hochman
RedisConf17 - Rax, Listpack and Safe Contexts
What's new with enterprise Redis - Leena Joshi, Redis Labs
Managing 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops Team

What's hot (20)

PDF
Troubleshooting redis
PPTX
Day 2 General Session Presentations RedisConf
PDF
Redis in a Multi Tenant Environment–High Availability, Monitoring & Much More!
PDF
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
PDF
Flying Circus Ceph Case Study (CEPH Usergroup Berlin)
PPTX
RedisConf17 - Turbo-charge your apps with Amazon Elasticache for Redis
PPTX
Which Hypervisor is Best?
KEY
Handling Redis failover with ZooKeeper
PPTX
Ceph Deployment at Target: Customer Spotlight
PDF
Redis for horizontally scaled data processing at jFrog bintray
PDF
Virtual training Intro to the Tick stack and InfluxEnterprise
PDF
How we got to 1 millisecond latency in 99% under repair, compaction, and flus...
PPTX
MySQL Head to Head Performance
PDF
Dynomite: A Highly Available, Distributed and Scalable Dynamo Layer--Ioannis ...
PPTX
Perforce BTrees: The Arcane and the Profane
PPTX
Redis Developers Day 2014 - Redis Labs Talks
PPTX
RedisConf17 - 3 Redis Scenarios, 3 Programming Languages
PDF
HIgh Performance Redis- Tague Griffith, GoPro
PPTX
Aerospike: Maximizing Performance
PDF
Aerospike AdTech Gets Hacked in Lower Manhattan
Troubleshooting redis
Day 2 General Session Presentations RedisConf
Redis in a Multi Tenant Environment–High Availability, Monitoring & Much More!
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Flying Circus Ceph Case Study (CEPH Usergroup Berlin)
RedisConf17 - Turbo-charge your apps with Amazon Elasticache for Redis
Which Hypervisor is Best?
Handling Redis failover with ZooKeeper
Ceph Deployment at Target: Customer Spotlight
Redis for horizontally scaled data processing at jFrog bintray
Virtual training Intro to the Tick stack and InfluxEnterprise
How we got to 1 millisecond latency in 99% under repair, compaction, and flus...
MySQL Head to Head Performance
Dynomite: A Highly Available, Distributed and Scalable Dynamo Layer--Ioannis ...
Perforce BTrees: The Arcane and the Profane
Redis Developers Day 2014 - Redis Labs Talks
RedisConf17 - 3 Redis Scenarios, 3 Programming Languages
HIgh Performance Redis- Tague Griffith, GoPro
Aerospike: Maximizing Performance
Aerospike AdTech Gets Hacked in Lower Manhattan
Ad

Similar to RedisConf17 - Doing More With Redis - Ofer Bengal and Yiftach Shoolman (20)

PPTX
Real-time Analytics with Redis
PPTX
Add Redis to Postgres to Make Your Microservices Go Boom!
PPTX
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
PDF
Redis Everywhere - Sunshine PHP
PPTX
Redis Reliability, Performance & Innovation
PPTX
RedisConf17 - Building Large High Performance Redis Databases with Redis Ente...
PDF
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
PDF
Tweaking performance on high-load projects
PPTX
Why Your MongoDB Needs Redis
PDF
Big Data LDN 2018: DATABASE FOR THE INSTANT EXPERIENCE
PPTX
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
PPTX
Real-time GeoSearching at Scale with RediSearch by Apoorva Gaurav and Ronil M...
PPSX
Big Data Redis Mongodb Dynamodb Sharding
PPTX
Microservices - Is it time to breakup?
PDF
CMG 2024 - Performance Testing, Profiling, and Analysis at Redis
PDF
Real-Time Machine Learning with Redis, Apache Spark, Tensor Flow, and more wi...
PPT
New York REDIS Meetup Welcome Session
PDF
Using Riak for Events storage and analysis at Booking.com
PDF
Redis as a Cache Boosting Performance and Scalability
PDF
Hpc lunch and learn
Real-time Analytics with Redis
Add Redis to Postgres to Make Your Microservices Go Boom!
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Redis Everywhere - Sunshine PHP
Redis Reliability, Performance & Innovation
RedisConf17 - Building Large High Performance Redis Databases with Redis Ente...
Geospatial Indexing at Scale: The 15 Million QPS Redis Architecture Powering ...
Tweaking performance on high-load projects
Why Your MongoDB Needs Redis
Big Data LDN 2018: DATABASE FOR THE INSTANT EXPERIENCE
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Real-time GeoSearching at Scale with RediSearch by Apoorva Gaurav and Ronil M...
Big Data Redis Mongodb Dynamodb Sharding
Microservices - Is it time to breakup?
CMG 2024 - Performance Testing, Profiling, and Analysis at Redis
Real-Time Machine Learning with Redis, Apache Spark, Tensor Flow, and more wi...
New York REDIS Meetup Welcome Session
Using Riak for Events storage and analysis at Booking.com
Redis as a Cache Boosting Performance and Scalability
Hpc lunch and learn
Ad

More from Redis Labs (20)

PPTX
Redis Day Bangalore 2020 - Session state caching with redis
PPTX
Protecting Your API with Redis by Jane Paek - Redis Day Seattle 2020
PPTX
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
PPTX
SQL, Redis and Kubernetes by Paul Stanton of Windocks - Redis Day Seattle 2020
PPTX
Rust and Redis - Solving Problems for Kubernetes by Ravi Jagannathan of VMwar...
PPTX
Redis for Data Science and Engineering by Dmitry Polyakovsky of Oracle
PPTX
Practical Use Cases for ACLs in Redis 6 by Jamie Scott - Redis Day Seattle 2020
PPTX
Leveraging Redis for System Monitoring by Adam McCormick of SBG - Redis Day S...
PPTX
JSON in Redis - When to use RedisJSON by Jay Won of Coupang - Redis Day Seatt...
PPTX
Highly Available Persistent Session Management Service by Mohamed Elmergawi o...
PPTX
Anatomy of a Redis Command by Madelyn Olson of Amazon Web Services - Redis Da...
PPTX
Building a Multi-dimensional Analytics Engine with RedisGraph by Matthew Goos...
PPTX
RediSearch 1.6 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisGraph 2.0 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisTimeSeries 1.2 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisAI 0.9 by Sherin Thomas of Tensorwerk - Redis Day Bangalore 2020
PPTX
Rate-Limiting 30 Million requests by Vijay Lakshminarayanan and Girish Koundi...
PDF
Three Pillars of Observability by Rajalakshmi Raji Srinivasan of Site24x7 Zoh...
PPTX
Solving Complex Scaling Problems by Prashant Kumar and Abhishek Jain of Myntr...
PPTX
Redis as a High Scale Swiss Army Knife by Rahul Dagar and Abhishek Gupta of G...
Redis Day Bangalore 2020 - Session state caching with redis
Protecting Your API with Redis by Jane Paek - Redis Day Seattle 2020
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
SQL, Redis and Kubernetes by Paul Stanton of Windocks - Redis Day Seattle 2020
Rust and Redis - Solving Problems for Kubernetes by Ravi Jagannathan of VMwar...
Redis for Data Science and Engineering by Dmitry Polyakovsky of Oracle
Practical Use Cases for ACLs in Redis 6 by Jamie Scott - Redis Day Seattle 2020
Leveraging Redis for System Monitoring by Adam McCormick of SBG - Redis Day S...
JSON in Redis - When to use RedisJSON by Jay Won of Coupang - Redis Day Seatt...
Highly Available Persistent Session Management Service by Mohamed Elmergawi o...
Anatomy of a Redis Command by Madelyn Olson of Amazon Web Services - Redis Da...
Building a Multi-dimensional Analytics Engine with RedisGraph by Matthew Goos...
RediSearch 1.6 by Pieter Cailliau - Redis Day Bangalore 2020
RedisGraph 2.0 by Pieter Cailliau - Redis Day Bangalore 2020
RedisTimeSeries 1.2 by Pieter Cailliau - Redis Day Bangalore 2020
RedisAI 0.9 by Sherin Thomas of Tensorwerk - Redis Day Bangalore 2020
Rate-Limiting 30 Million requests by Vijay Lakshminarayanan and Girish Koundi...
Three Pillars of Observability by Rajalakshmi Raji Srinivasan of Site24x7 Zoh...
Solving Complex Scaling Problems by Prashant Kumar and Abhishek Jain of Myntr...
Redis as a High Scale Swiss Army Knife by Rahul Dagar and Abhishek Gupta of G...

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
A Presentation on Artificial Intelligence
PDF
Modernizing your data center with Dell and AMD
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
NewMind AI Monthly Chronicles - July 2025
Understanding_Digital_Forensics_Presentation.pptx
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf

RedisConf17 - Doing More With Redis - Ofer Bengal and Yiftach Shoolman

  • 1. #redisconf17 DOING MORE WITH REDIS OFER BENGAL YIFTACH SHOOLMAN CO-FOUNDERS, REDIS LABS
  • 2. #1 – Running Redise Flash in a DBaaS Model
  • 3. Redise Cloud Private Fully managed, serverless scaling Redise service in VPCs on: AWS, MS Azure, GCP & IBM Softlayer
  • 4. Redise Flash – Built for a Tiered Memory Architecture Persistent Storage: Entire Dataset AOF, Snapshot SSD: Cold Values DRAM: Keys & Hot Values Cluster Node
  • 5. Flexible RAM : Flash Ratios
  • 6. New Memory Technology is Evolving Fast
  • 7. DRAM vs Flash : Performance vs Cost $9 $0.4 $1 $2
  • 8. Flash Memory - What Has Changed During Last Year New NVMe based local SSD that can be attached to a Cloud Instance
  • 9. Flash Memory - What Has Changed During Last Year New NVMe based local SSD that can be attached to a Cloud Instance New NVMe based SSD I3 Instances
  • 10. I3 (NVMe) are x2.6 Faster and 80% Cheaper than I2 (SATA) Single node @ <1msec latency
  • 11. Flash Memory - What Has Changed During Last Year New NVMe based local SSD that can be attached to a Cloud Instance New NVMe based SSD I3 Instances New Flash-GT card with multiple NVMes integrated
  • 12. Flash Memory - What Has Changed During Last Year New NVMe based local SSD that can be attached to a Cloud Instance New NVMe based SSD I3 Instances New Flash-GT card with multiple NVMes integrated New 3D XPoint chipset on NVME Devices
  • 13. Redise Flash + Intel® Optane™ SSD 2040 1380 590 728 142 64 0 500 1000 1500 2000 2500 95% 85% 50% KOps/sec RAM hit ratio item size = 1000B; read/write = 50%/50% Optane P3700 Up to x9 Similar to what runs on:
  • 14. DBaaS Price Comparison $2,200,162/yr $1,772,606/yr $766,096/yr $232,875/yr $0/yr $500,000/yr $1,000,000/yr $1,500,000/yr $2,000,000/yr $2,500,000/yr Other Redis Provider RCP RAM Cloud-Based NoSQL RCP Flash 2TB Dataset with HA @ 100K ops/sec (on-demand pricing) <1msec <1msec <10msec <1msec Up to 89% saving!
  • 15. #2 – Modules Are Gaining Momentum
  • 16. Modules Status • 50+ created • C, C++, Go, Python supported • Multi-threaded infrastructure
  • 17. Why Multi-Threading is Crucial for Modules 100msec (module) 0.1msec (core) 0.1msec (core) 0.1msec (core) A Single-Threaded Module
  • 18. Why Multi-Threading is Crucial for Modules 100msec (module) 0.1msec (core) 0.1msec (core) 0.1msec (core) A Single-Threaded Module 100.3msec 100.2msec 100.1msec 100msec Average latency - 100.15msec Module latency - 100msec Average core latency - 100.2msec
  • 19. Why Multi-Threading is Crucial for Modules 100msec (module) 0.1msec (core) 0.1msec (core) 0.1msec (core) A Multi-Threaded Module 0.3msec 0.2msec 0.1msec 100msec Average latency - 25.15msec Module latency - 100msec Average core latency - 0.2msec 100msec (module) 0.1msec (core) 0.1msec (core) 0.1msec (core) A Single-Threaded Module 100.3msec 100.2msec 100.1msec 100msec Average latency - 100.15msec Module latency - 100msec Average core latency - 100.2msec
  • 22. Friends, Friends of Friends and Visited Countries
  • 23. Query: Friends Who’ve Visited Places I’ve Been To MATCH (:person {name:“Roi Lipman”})- [:visited]->(c:country)<-[:visited]- (f:person)<-[:friend]- (:person {name:“Roi Lipman”}) RETURN f, c
  • 24. Result: Friends Who’ve Visited Places I’ve Been To
  • 25. Query: Who’s Gone on a Business Trip MATCH (p:person)- [v:visited {purpose:business}]->(c:country) RETURN p, v, c
  • 26. Result: Who’s Gone on a Business Trip
  • 27. Benchmarks Per shard • 150K inserts / sec • 15K queries / sec
  • 28. A Deep Dive on Redis-Graph: Salon 12 @ 2:30 pm
  • 30. The Machine / Deep Learning (ML/DL) World (1) Training (2) Creating a model (3) Serving the model
  • 31. (1) Training (2) Creating a model (3) Serving the model Homegrown The Machine / Deep Learning (ML/DL) World
  • 32. Challenge #1 - Model Accuracy
  • 33. Challenge #1 - Model Accuracy Just avoid…
  • 34. Real World Example • Ads serving company • Need to serve 20,000 ads/sec @ 50msec data-center latency • Runs 1k campaigns
  • 35. Real World Example • Runs 1k campaigns  1K random forest • Each forest has 15K trees • On average each tree has 7 levels (depth) 20K x 1K x 15K x 3.5 = 1.05 trillion ops/sec
  • 36. Challenge #2 - Accurate Models are Expensive to Serve! Item Calculation Total Max ops/sec on the strongest AWS instance vcore 2.6Ghz x 0.9 (OS overhead) x 0.1 (10 lines of code per ops) x 0.1 (Java overhead) 23.4 million # of vcores needed 1.05 trillion / 23.4 million 44,872 # of c4.8xlarge instances needed 44,872 / 36 1,247 Total cost reserved instances 1,247 x 9213 ~$11.5M/yr
  • 37. Ads Serving Use-Case w/ and w/o Redise + ML Homegrown 1,247 x c4.8xlarge 35 x c4.8xlarge Cut computing infrastructure by 97%
  • 38. How ML/DL Should be Severed (1) Training (2) Creating a model (3) Serving the model
  • 39. A Deep Dive on Redis-ML: Salon 8 @ 1:45 pm
  • 41. Jeff Atwood's Law (Stack Overflow, Stack Exchange) : "any application that can be written in JavaScript, will eventually be written in JavaScript"
  • 42. This Leads To: "...any database will eventually store [some data in] JSON"
  • 44. ReJSON (= Redis + JSON) in 5 Words • Intuitive • Integrated • Any client • Fast
  • 45. Performance: 39491 bytes, 3 nesting levels ReJSON Raw JSON & Lua MessagePack & Lua
  • 47. The Fastest Search in Town x5 - x10 Faster
  • 48. The Feature List is Long 1. Full-Text indexing of multiple fields in documents 2. Incremental indexing without performance loss 3. Document ranking (provided manually by the user at index time) 4. Complex Boolean queries with AND, OR, NOT operators between sub-queries 5. Optional query clauses 6. Prefix based searches 7. Field weights 8. Auto-complete suggestions (with fuzzy prefix suggestions) 9. Exact Phrase Search, Slop based search 10. Stemming based query expansion in many languages (using Snowball) 11. Support for custom functions for query expansion and scoring (see Extensions) 12. Limiting searches to specific document fields (up to 8 fields supported) 13. Numeric filters and ranges 14. Geo filtering using Redis' own Geo-commands 15. Supports any utf-8 encoded text 16. Retrieve full document content or just ids 17. Automatically index existing HASH keys as documents 18. Document deletion and updating with index garbage collection.
  • 49. RediSearch Shard Redis Search Engine Coordinator + + = RediSearch Shard
  • 51. RediSearch Cluster Node 1 Node 2 Node 3 ClientFT.SEARCH idx “foo”
  • 52. RediSearch Cluster Fully-Connected Fan-Out/In Node 1 Node 3 “foo” {3} “foo” {4} “foo” {5} “foo” {6} “foo” {2} “foo” {1} ClientFT.SEARCH idx “foo” Node 2
  • 53. When RediSearch Cluster Becomes Larger Node 1 Node 2 Node 3
  • 54. RediSearch Cluster Tree-Based Fan-Out/In Node 1 Node 2 Node 3 “foo” {5},{6},{7},{8} “foo” {9},{10},{11},{12} ClientFT.SEARCH idx “foo”
  • 55. RediSearch Cluster Tree-Based Fan-Out/In Node 1 Node 2 Node 3 “foo” {5},{6},{7},{8} “foo” {9},{10},{11},{12} ClientFT.SEARCH idx “foo” “foo” {5} “foo” {7} “foo” {6} “foo” {8} “foo” {1} “foo” {3} “foo” {2} “foo” {4} “foo” {9} “foo” {11} “foo” {10} “foo” {12}
  • 56. Let’s See it in Action… Preview
  • 57. #3 – Redis for IoT
  • 63. The Evolution of an IoT Device Simple Sensor
  • 64. The Evolution of an IoT Device Simple Sensor Complex Device More Features
  • 65. The Evolution of an IoT Device Simple Sensor Complex Device Complex Device with Memory More Features Online/ Offline Memory
  • 66. Redis-Based IoT Device • Runs on Raspberry Pi • Single OSS Redis instance (3MB footprint) • Redis Stream client • Persistence • Low cost
  • 67. IoT Edge Challenges Small Form Factor Cluster (Per node: 4 cores, 1-2GB DRAM, 50GB Flash)
  • 68. IoT Edge Challenges Small Form Factor Cluster (Per node: 4 cores, 1-2GB DRAM, 50GB Flash) Thousands of Devices (20K+ devices, 10 updates/sec/device 200K+ updates/sec)
  • 69. IoT Edge Challenges Small Form Factor Cluster (Per node: 4 cores, 1-2GB DRAM, 50GB Flash) Thousands of Devices (20K+ devices, 10 updates/sec/device 200K+ updates/sec) Varied Functionality (Time series, Search, Graph, ML, Geo)
  • 70. IoT Edge Challenges Simple & Reliable (Integrated, short failover time) Small Form Factor Cluster (Per node: 4 cores, 1-2GB DRAM, 50GB Flash) Thousands of Devices (20K+ devices, 10 updates/sec/device 200K+ updates/sec) Varied Functionality (Time series, Search, Graph, ML, Geo)
  • 71. Redise Cluster for the Edge • Redise Cluster on RPI/x86 • Redise Flash • Persistent & HA • Redis Streams Server + Client • Module options: Search, JSON, Graph, Time-Series, ML, Neural, RQL, Enhanced GEO Stream API Streams Data-Structure Multi-Function 1 2 3 Time-series JSON ML Graph Search GEO RQL
  • 72. Redise Blueprint for IoT Devices • Raspberry Pi support • A single OSS Redis instance (3MB footprint) • Persistent • Redis Streams Client • RPi/x86 nodes (4 cores/2GB RAM /50GB SSD) • Redise cluster • Persistent & HA • Redise on Flash • Redis Streams Server & Client • Modules: ‒ Search, JSON, Graph, Time-Series, ML, Nueral, RQL, Enhanced GEO Edge • Large Redise cluster(s) • Multi-cloud/DBaaS/Self-managed • Multi-master geo-replication • Persistent & HA (multi-az) • Redise on Flash • Redis Streams Server • Modules: ‒ Search, JSON, Graph, Time-Series, ML, RQL, Enhanced GEO Cloud
  • 73. #4 – Multi-Master Geo-Distributed Redis
  • 75. Challenge #1 – Geo-Distributed Latency Redis is fast!: > 1,000,000 ops/sec, < 1msec latency Light is slower > 20msec RTT Network is even slower > 70msec RTT
  • 76. Consistency  Consensus  Slowness App App App ~100msec for a ‘write’ operation
  • 77. Challenge #2 – Conflict Resolution for Complex Data-Types • Application level solution  too complex to write • LWW (Last Write Wins)  doesn’t work for many of the Redis use cases, e.g.: • Counters • Sets • Sorted Sets • Lists • Modules’ new datatypes
  • 79. CRDT • Years of academic research • Based on consensus free protocol • Strong eventual consistency • Built to resolve conflicts with complex data types
  • 80. Consensus Free with Strong Eventual Consistency App App App Write Locally
  • 81. Consensus Free with Strong Eventual Consistency App App App Write Locally, Converge Asynchronously
  • 82. Solving Conflicts – Counters Replica A: C = 500 Replica B: C = 500 Replica C: C = 500
  • 83. Solving Conflicts – Counters Replica A: C = 500 INCRBY 200 Replica B: C = 500 Replica C: C = 500
  • 84. Solving Conflicts – Counters Replica A: C = 500 INCRBY 200 Replica B: C = 500 DECRBY 300 Replica C: C = 500
  • 85. Solving Conflicts – Counters Replica A: C = 500 INCRBY 200 Replica B: C = 500 DECRBY 300 Replica C: C = 500 INCRBY 1000
  • 86. Solving Conflicts – Counters Replica A: C = 500 INCRBY 200 Replica B: C = 500 DECRBY 300 Replica C: C = 500 INCRBY 1000 Convergence Function (commutative): 500 + ΣC(i) = = 500 +200 -300 +1000 = 1400
  • 87. Solving Conflicts – Sets Replica A: S = {A, B, C} Replica B: S = {A, B, C} Replica C: S = {A, B, C}
  • 88. Solving Conflicts – Sets Replica A: S = {A, B, C} SADD D Replica B: S = {A, B, C} Replica C: S = {A, B, C}
  • 89. Solving Conflicts – Sets Replica A: S = {A, B, C} SADD D Replica B: S = {A, B, C} SADD A Replica C: S = {A, B, C}
  • 90. Solving Conflicts – Sets Replica A: S = {A, B, C} SADD D Replica B: S = {A, B, C} SADD A Replica C: S = {A, B, C} SREM A
  • 91. Solving Conflicts – Sets Replica A: S = {A, B, C} SADD D Replica B: S = {A, B, C} SADD A Replica C: S = {A, B, C} SREM A Convergence Function (associative): • S = S + D + A - A = {A, B, C, D} • Observed Removed + Add wins
  • 92. Solving Conflicts – Sorted Sets Replica A: SS = {A:35, B:23, C:4} Replica B: SS = {A:35, B:23, C:4} Replica C: SS = {A:35, B:23, C:4}
  • 93. Solving Conflicts – Sorted Sets Replica A: SS = {A:35, B:23, C:4} Replica B: SS = {A:35, B:23, C:4} Replica C: SS = {A:35, B:23, C:4} Convergence Function (associative & commutative): Counters + Sets
  • 94. Solving Conflicts – Lists Replica A: L= ABC Replica B: L= ABC Replica C: L= ABC
  • 95. Solving Conflicts – Lists Replica A: L= ABC Replica B: L= ABC Replica C: L= ABC Convergence Function: Based on Directed Acyclic Graphs (DAG) Too complex to explain!!!
  • 96. Multi-Master Redis is Here Preview
  • 97. What’s Unique About Redis-CRDT • Based on a Redis module (CRDB) • Support bi-direction replication • Multiple topologies • Solves a new set of problems • Counters deletion • Expiry • Cluster configuration • Etc. RingFully-Connected
  • 98. A Deep Dive on Multi-Master: Salon 8 @ 3:15 pm