SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Redis & MongoDB
Stop Big Data Indigestion Before It Starts
@itamarhaber
@itamarhaber
A Redis Geek and Chief Developer Advocate
at
Have you signed for newsletter?
[1] http://bit.ly/RedisWatch
You probably haven't seen anything
like this before
VolumeMongoDB truly excels when
is comes to volume and
variety of data…
…but data coming in at
extreme velocity poses
a digestive challenge for
for any disk-based database
A talk about MongoDB performance
[2] WiredTiger iiBench Results
I'm hardly an
expert, but with
MongoDB v3
storage engines
and future work
this could very
well be a moot
point 
Data ingestion at high velocity
Mobile, online and IoT apps
produce more and more data
with every day that passes.
Simply storing the data as it
comes in doesn't cut it anymore – real time
processing is a must in order distill information
from the data as it rushes in.
A talk about more performance
By doing LESS
you can do MORE
(with MongoDB)
Put differently, "chew" your
data with Redis to prevent
data ingestion indigestion
● "...an [4] open source, BSD licensed,
advanced key-value cache and store"
● 5+2 data types, 160+ commands, entirely in
RAM, Lua scripts, PubSub...
● Nee circa 2009, by [5] antirez
(a.k.a Salvatore Sanfilippo)
● Sponsored by Pivotal
[3] Redis (REmote Dictionary Server)
OSS, humane, pure,
flexible, efficient,
scalable, highly
clusterable,
sexy, fresh,
is actively
ton of uses,
has a client in every
lean & small, supple,
track record, tiny,
and much moar...
...fun & easy, free
inspiring, simple,
innovative, robust,
available, cool,
portable, geeky,
mature, stable,
developed, has a
rich, dependable,
every language,
proven production
vibrant community,
Why use Redis
❤❤1.5M ops / sec
using a single
EC2 instance!
[6] Recorded webinar
Because it is
Getting started with Redis
• Try it online at [7] http://try.redis.io/
• Build it from the source
• [8] Download Redis Labs Enterprise Cluster
• Run it in a container
• [9] Connect to it from any language
git clone https://github.com/antirez/redis
cd redis
git checkout 3.0.1
make; make test; make install
docker run -d --name redis -p 6379:6379 redis
Use case A: Google Analytics
• A real time analytics platform provider
• Strongly focuses on users' behavior
• Primary data storage is MongoDB
• Activity is collected immediately or in bulks
• Raw data fed to Hadoop for offline crunching
• Real time metrics and initial information from
the stream is obtained with Redis
The tidal flow
Sessions events
Real time analysis
Offline analysis
Deep dive topic: sessionizing data
• Stream of events
• A session is a document
• Each has 10s-1000s events
• Events from different users
arrive in order but interleaved
• The result: many small updates
to each session's document
• Peak load: 11M ops/sec and growing
You say potato, I say potato
Hash data type:
HSET session:1
event:1 data
HSET session:1
event:2 data
...
HINCRBY session:1
seq 1
JSON:
{
session: 1,
events: [
{ id: 1,
data: data },
{ id: 2,
data: data },
...
Swallowing in Python
import redis
import pymongo
r = redis.Redis()
session = r.hgetall('session:1')
# {'event:1': 'data', 'event:2': 'data', 'seq': '2'}
...
m = pymongo.MongoClient()
db = m.rta
sessionid = db.sessions.insert_one(session)
Keeping track of sessions
• Sessions end after a logout or a timeout
• Logout events are trivial to detect
• Timeouts, e.g. 30 minutes of inactivity, are
trickier to manage considering there could
be 10,000s of active sessions
• This is where Redis' key expiry and
keyspace notifications come in very handy 
Once you see it, it can't be unseen
Using Redis as a buffer in front
of MongoDB for write-
intensive, hot Big Data is a
useful pattern that makes it
easy to get information in real
time as well as distribute the
load more efficiently.
Use case B: Waze
• An international navigation app/service
• Strongly focuses on public transit
• 10s of millions of users during peak hours
• Primary data storage is MongoDB
• Base data is created in advance
• Real time updates (traffic, vehicles and
passengers) pour into Redis for scheduling
adjustments and notifications
Use case C: Tinder
• A dating app/service
• Strongly focuses on spatially-related groups
• Primary data storage is MongoDB
• Data includes user profiles & preferences
• An influx of positional and preferential
("swipes") events is first munched by Redis
Use case D: Clash of Clans
• A massive real time game
• Strongly focuses on matched team play
• 1000s of teams with 100s of members
• Primary data storage is MongoDB
• Match progress is sieved through Redis for
real time resources status, leaderboards and
scoring
Use case E: Weather.com
• IoT startup
• Focuses on environmental monitoring
• Pilot: real time fire fighting
• Primary data storage is MongoDB
• Sensor data (temperature, humidity, …) is
aggregated in Redis, providing warnings and
alarms in real time
Questions from the audience
Questions or feedback? Contact me!
Itamar Haber
Chief Developer Advocate
📧 itamar@redislabs.com
@itamarhaber

Weitere ähnliche Inhalte

Was ist angesagt?

Real Time Data Analytics with MongoDB and Fluentd at Wish
Real Time Data Analytics with MongoDB and Fluentd at WishReal Time Data Analytics with MongoDB and Fluentd at Wish
Real Time Data Analytics with MongoDB and Fluentd at Wish
MongoDB
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
Shridhar Joshi
 

Was ist angesagt? (20)

NoSQL for SQL Users
NoSQL for SQL UsersNoSQL for SQL Users
NoSQL for SQL Users
 
Open source data ingestion
Open source data ingestionOpen source data ingestion
Open source data ingestion
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at Craigslist
 
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
 
Augmenting Mongo DB with treasure data
Augmenting Mongo DB with treasure dataAugmenting Mongo DB with treasure data
Augmenting Mongo DB with treasure data
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 
Managing 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops Team
Managing 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops TeamManaging 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops Team
Managing 50K+ Redis Databases Over 4 Public Clouds ... with a Tiny Devops Team
 
Practical Use of a NoSQL
Practical Use of a NoSQLPractical Use of a NoSQL
Practical Use of a NoSQL
 
Fluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker containerFluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker container
 
What's the Scoop on Hadoop? How It Works and How to WORK IT!
What's the Scoop on Hadoop? How It Works and How to WORK IT!What's the Scoop on Hadoop? How It Works and How to WORK IT!
What's the Scoop on Hadoop? How It Works and How to WORK IT!
 
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevWebinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
 
Real Time Data Analytics with MongoDB and Fluentd at Wish
Real Time Data Analytics with MongoDB and Fluentd at WishReal Time Data Analytics with MongoDB and Fluentd at Wish
Real Time Data Analytics with MongoDB and Fluentd at Wish
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
 
CosmosDb for beginners
CosmosDb for beginnersCosmosDb for beginners
CosmosDb for beginners
 
Webinar : Nouveautés de MongoDB 3.2
Webinar : Nouveautés de MongoDB 3.2Webinar : Nouveautés de MongoDB 3.2
Webinar : Nouveautés de MongoDB 3.2
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
 
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
 
Upstream Consultancy and Ceph RadosGW/S3 (AMTEGA Ceph Day 2018)
Upstream Consultancy and Ceph RadosGW/S3 (AMTEGA Ceph Day 2018)Upstream Consultancy and Ceph RadosGW/S3 (AMTEGA Ceph Day 2018)
Upstream Consultancy and Ceph RadosGW/S3 (AMTEGA Ceph Day 2018)
 
Using MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content RepositoryUsing MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content Repository
 
Redis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs TalksRedis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs Talks
 

Ähnlich wie Redis & MongoDB: Stop Big Data Indigestion Before It Starts

AquaQ Analytics Kx Event - Data Direct Networks Presentation
AquaQ Analytics Kx Event - Data Direct Networks PresentationAquaQ Analytics Kx Event - Data Direct Networks Presentation
AquaQ Analytics Kx Event - Data Direct Networks Presentation
AquaQ Analytics
 
An afternoon with mongo db new delhi
An afternoon with mongo db new delhiAn afternoon with mongo db new delhi
An afternoon with mongo db new delhi
Rajnish Verma
 
Lean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big DataLean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big Data
Stylight
 

Ähnlich wie Redis & MongoDB: Stop Big Data Indigestion Before It Starts (20)

Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It StartsRedis & MongoDB: Stop Big Data Indigestion Before It Starts
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
 
Augmenting Mongo DB with Treasure Data
Augmenting Mongo DB with Treasure DataAugmenting Mongo DB with Treasure Data
Augmenting Mongo DB with Treasure Data
 
Mongo Internal Training session by Soner Altin
Mongo Internal Training session by Soner AltinMongo Internal Training session by Soner Altin
Mongo Internal Training session by Soner Altin
 
Webinar: Enterprise Trends for Database-as-a-Service
Webinar: Enterprise Trends for Database-as-a-ServiceWebinar: Enterprise Trends for Database-as-a-Service
Webinar: Enterprise Trends for Database-as-a-Service
 
Mongo DB: Operational Big Data Database
Mongo DB: Operational Big Data DatabaseMongo DB: Operational Big Data Database
Mongo DB: Operational Big Data Database
 
Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!
 
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
 
AquaQ Analytics Kx Event - Data Direct Networks Presentation
AquaQ Analytics Kx Event - Data Direct Networks PresentationAquaQ Analytics Kx Event - Data Direct Networks Presentation
AquaQ Analytics Kx Event - Data Direct Networks Presentation
 
Enterprise Reporting with MongoDB and JasperSoft
Enterprise Reporting with MongoDB and JasperSoftEnterprise Reporting with MongoDB and JasperSoft
Enterprise Reporting with MongoDB and JasperSoft
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
Big Data Building Blocks with AWS Cloud
Big Data Building Blocks with AWS CloudBig Data Building Blocks with AWS Cloud
Big Data Building Blocks with AWS Cloud
 
History of NoSQL and Azure Documentdb feature set
History of NoSQL and Azure Documentdb feature setHistory of NoSQL and Azure Documentdb feature set
History of NoSQL and Azure Documentdb feature set
 
Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...
Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...
Glynn Bird – Cloudant – Building applications for success.- NoSQL matters Bar...
 
An afternoon with mongo db new delhi
An afternoon with mongo db new delhiAn afternoon with mongo db new delhi
An afternoon with mongo db new delhi
 
Webinar: Utilisations courantes de MongoDB
Webinar: Utilisations courantes de MongoDBWebinar: Utilisations courantes de MongoDB
Webinar: Utilisations courantes de MongoDB
 
SQLSaturday #230 - Introduction to Microsoft Big Data (Part 1)
SQLSaturday #230 - Introduction to Microsoft Big Data (Part 1)SQLSaturday #230 - Introduction to Microsoft Big Data (Part 1)
SQLSaturday #230 - Introduction to Microsoft Big Data (Part 1)
 
Webinar: How Banks Manage Reference Data with MongoDB
 Webinar: How Banks Manage Reference Data with MongoDB Webinar: How Banks Manage Reference Data with MongoDB
Webinar: How Banks Manage Reference Data with MongoDB
 
Lean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big DataLean Enterprise, Microservices and Big Data
Lean Enterprise, Microservices and Big Data
 
Redis for Fast Data Ingest
Redis for Fast Data IngestRedis for Fast Data Ingest
Redis for Fast Data Ingest
 
Which database should I use for my app?
Which database should I use for my app?Which database should I use for my app?
Which database should I use for my app?
 

Mehr von Itamar Haber

Mehr von Itamar Haber (15)

Redis v5 & Streams
Redis v5 & StreamsRedis v5 & Streams
Redis v5 & Streams
 
Redis Modules API - an introduction
Redis Modules API - an introductionRedis Modules API - an introduction
Redis Modules API - an introduction
 
Redis Lua Scripts
Redis Lua ScriptsRedis Lua Scripts
Redis Lua Scripts
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
How I Implemented the #1 Requested Feature In Redis In Less than 1 Hour with ...
How I Implemented the #1 Requested Feature In Redis In Less than 1 Hour with ...How I Implemented the #1 Requested Feature In Redis In Less than 1 Hour with ...
How I Implemented the #1 Requested Feature In Redis In Less than 1 Hour with ...
 
Redis Streams - Fiverr Tech5 meetup
Redis Streams - Fiverr Tech5 meetupRedis Streams - Fiverr Tech5 meetup
Redis Streams - Fiverr Tech5 meetup
 
Developing a Redis Module - Hackathon Kickoff
 Developing a Redis Module - Hackathon Kickoff Developing a Redis Module - Hackathon Kickoff
Developing a Redis Module - Hackathon Kickoff
 
Extend Redis with Modules
Extend Redis with ModulesExtend Redis with Modules
Extend Redis with Modules
 
Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...
Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...
Leveraging Probabilistic Data Structures for Real Time Analytics with Redis M...
 
Power to the People: Redis Lua Scripts
Power to the People: Redis Lua ScriptsPower to the People: Redis Lua Scripts
Power to the People: Redis Lua Scripts
 
What's new in Redis v3.2
What's new in Redis v3.2What's new in Redis v3.2
What's new in Redis v3.2
 
Redis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of LuaRedis Developers Day 2015 - Secondary Indexes and State of Lua
Redis Developers Day 2015 - Secondary Indexes and State of Lua
 
Use Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual WaysUse Redis in Odd and Unusual Ways
Use Redis in Odd and Unusual Ways
 
Redis Indices (#RedisTLV)
Redis Indices (#RedisTLV)Redis Indices (#RedisTLV)
Redis Indices (#RedisTLV)
 
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Redis & MongoDB: Stop Big Data Indigestion Before It Starts

  • 1. Redis & MongoDB Stop Big Data Indigestion Before It Starts @itamarhaber
  • 2. @itamarhaber A Redis Geek and Chief Developer Advocate at Have you signed for newsletter? [1] http://bit.ly/RedisWatch
  • 3. You probably haven't seen anything like this before VolumeMongoDB truly excels when is comes to volume and variety of data… …but data coming in at extreme velocity poses a digestive challenge for for any disk-based database
  • 4. A talk about MongoDB performance [2] WiredTiger iiBench Results I'm hardly an expert, but with MongoDB v3 storage engines and future work this could very well be a moot point 
  • 5. Data ingestion at high velocity Mobile, online and IoT apps produce more and more data with every day that passes. Simply storing the data as it comes in doesn't cut it anymore – real time processing is a must in order distill information from the data as it rushes in.
  • 6. A talk about more performance By doing LESS you can do MORE (with MongoDB) Put differently, "chew" your data with Redis to prevent data ingestion indigestion
  • 7. ● "...an [4] open source, BSD licensed, advanced key-value cache and store" ● 5+2 data types, 160+ commands, entirely in RAM, Lua scripts, PubSub... ● Nee circa 2009, by [5] antirez (a.k.a Salvatore Sanfilippo) ● Sponsored by Pivotal [3] Redis (REmote Dictionary Server)
  • 8. OSS, humane, pure, flexible, efficient, scalable, highly clusterable, sexy, fresh, is actively ton of uses, has a client in every lean & small, supple, track record, tiny, and much moar... ...fun & easy, free inspiring, simple, innovative, robust, available, cool, portable, geeky, mature, stable, developed, has a rich, dependable, every language, proven production vibrant community, Why use Redis ❤❤1.5M ops / sec using a single EC2 instance! [6] Recorded webinar Because it is
  • 9. Getting started with Redis • Try it online at [7] http://try.redis.io/ • Build it from the source • [8] Download Redis Labs Enterprise Cluster • Run it in a container • [9] Connect to it from any language git clone https://github.com/antirez/redis cd redis git checkout 3.0.1 make; make test; make install docker run -d --name redis -p 6379:6379 redis
  • 10. Use case A: Google Analytics • A real time analytics platform provider • Strongly focuses on users' behavior • Primary data storage is MongoDB • Activity is collected immediately or in bulks • Raw data fed to Hadoop for offline crunching • Real time metrics and initial information from the stream is obtained with Redis
  • 11. The tidal flow Sessions events Real time analysis Offline analysis
  • 12. Deep dive topic: sessionizing data • Stream of events • A session is a document • Each has 10s-1000s events • Events from different users arrive in order but interleaved • The result: many small updates to each session's document • Peak load: 11M ops/sec and growing
  • 13. You say potato, I say potato Hash data type: HSET session:1 event:1 data HSET session:1 event:2 data ... HINCRBY session:1 seq 1 JSON: { session: 1, events: [ { id: 1, data: data }, { id: 2, data: data }, ...
  • 14. Swallowing in Python import redis import pymongo r = redis.Redis() session = r.hgetall('session:1') # {'event:1': 'data', 'event:2': 'data', 'seq': '2'} ... m = pymongo.MongoClient() db = m.rta sessionid = db.sessions.insert_one(session)
  • 15. Keeping track of sessions • Sessions end after a logout or a timeout • Logout events are trivial to detect • Timeouts, e.g. 30 minutes of inactivity, are trickier to manage considering there could be 10,000s of active sessions • This is where Redis' key expiry and keyspace notifications come in very handy 
  • 16. Once you see it, it can't be unseen Using Redis as a buffer in front of MongoDB for write- intensive, hot Big Data is a useful pattern that makes it easy to get information in real time as well as distribute the load more efficiently.
  • 17. Use case B: Waze • An international navigation app/service • Strongly focuses on public transit • 10s of millions of users during peak hours • Primary data storage is MongoDB • Base data is created in advance • Real time updates (traffic, vehicles and passengers) pour into Redis for scheduling adjustments and notifications
  • 18. Use case C: Tinder • A dating app/service • Strongly focuses on spatially-related groups • Primary data storage is MongoDB • Data includes user profiles & preferences • An influx of positional and preferential ("swipes") events is first munched by Redis
  • 19. Use case D: Clash of Clans • A massive real time game • Strongly focuses on matched team play • 1000s of teams with 100s of members • Primary data storage is MongoDB • Match progress is sieved through Redis for real time resources status, leaderboards and scoring
  • 20. Use case E: Weather.com • IoT startup • Focuses on environmental monitoring • Pilot: real time fire fighting • Primary data storage is MongoDB • Sensor data (temperature, humidity, …) is aggregated in Redis, providing warnings and alarms in real time
  • 21. Questions from the audience
  • 22. Questions or feedback? Contact me! Itamar Haber Chief Developer Advocate 📧 itamar@redislabs.com @itamarhaber