Redis can be used for real-time analytics through its embedded capabilities and modules. It allows for inline analytics using data structures like HyperLogLogs, sorted sets, sets, and geospatial indexes. Modules like Redis ML, Redis-cell, Rebloom, and Countminsketch expand its analytic functionality. Examples of real-time analytics use cases discussed include fraud mitigation through checking user locations against geographic indices, detecting out of hours access, and using probabilistic data structures to implement counts and detect anomalies in resource traffic.
2. • Why use the analytic capabilities of Redis?
• Overview of Redis capabilities for Real-time analytics
–Embedded analytics within Redis’ data structures
–Modules available for analytic scenarios
• Fraud Mitigation in Real time Examples
–Using geographic indices to compute geo violations for authentication
–Implementing out of hours access detection for authentication
–Probabilistic data structures to implement counts and anomaly detection
Agenda
7. Data Structures Enable Embedded Analytics
Inline Analytics with Data Structures
Hyperloglog Probabilistic estimates of counts for anomaly detection
Sorted Sets Real time range analyses, top scorers, bid ranges
Sets Cardinality for fraud mitigation
Geospatial Indexes Location based searches
Bitmaps Real-time population counting for activity monitoring
7
8. T-digest
Rank-based statistics estimator
Modules Expand Analytics Capabilities
8
Inline Analytics with Modules
Redis ML
Machine learning models and
model serving
Redis-cell
Rate-limiting
Rebloom
Probabilistic membership queries
Countminsketch
Approximate frequency counter
Topk
Track the top-k most frequent
elements in a stream
9. Redis Enterprise + Modules Deliver Extended Capabilities
9
Operational Analytics with Modules
RediSearch
Extremely fast text-based search,
used for secondary indexing
Redis Graph
Graph query processing
Time Series
Range analyses, built-in
aggregations (min, max, sum.avg)
10. Differentiators in Real-Time Analytics
10
• In-memory, high
throughput and lower
latencies than other
databases
• Requires the fewest
resources to achieve this
performance
• Analytic capabilities
optimized for maximum
memory efficiency
• Extends to Flash memory
for even greater savings
• Wraps around your data
while retaining
performance
• Multiple access methods,
including streaming and
messaging
PERFORMANCE MEMORY / COST EFFICIENCY NATIVE MULTI-MODEL
13. • Is the user logging in from a place that seems rational?
–Someone who lives in the US suddenly logs in from Mongolia.
• Determine rationality:
–Simple: Check if the person has ever visited the location of the login before. If not, then require
additional verification.
–Advanced: Check bordering regions (someone from the US can login from Mexico or Canada)
User Geographic Check
13
14. • Every valid login location is added to Bloom filter.
• Before login, check to see if the location for the login attempt is in the Bloom filter.
• Properties of Bloom filter means that you’ll know with certainty if a user has never been
to this location.
–False positives are possible, but controllable
• ReBloom Module
How it Works in Redis
14
16. • People generally follow patterns in life
• Morning
–Check bank account
–Top up transit pass
• Work
–Employee Dashboard
–Partner reports
• Evening
–Food delivery
–Games
–Dating app
User Out-of-hours Check
16
17. • Record the time period of each valid login in a Bloom filter
• Check surrounding times in the Bloom filter on each login.
• Can check multiple dimensions – time of day, day of week, holidays, etc.
• You’ll know for sure if this is out of the ordinary
How it Works in Redis
17
18. • If one resource is being hit frequently by a small number of actors. This indicates
problems like:
–Poorly behaving clients
–Fraudulent usage
–DDOS/Bots
• You need to record unique actors and raw counts for a specific time period.
• A high ratio raw counts to unique actors indicates a traffic anomaly.
Resource Traffic Anomaly
18
19. • Key based on time period
• Record each visit to in a HyperLogLog unique for each
–HyperLogLogs estimate cardinality in a very small space with a standard error rate.
• Increment a counter for each visit to each resource.
How it Works in Redis
19
HyperLogLog Count 450 40 500
Raw Count 500 1000 200
Result OK FRAUD FRAUD/IMPOSSIBLE