SlideShare a Scribd company logo
Real Time Big Data With Storm,
Cassandra, and In-Memory Computing
Nati Shalom @natishalom
DeWayne Filppi @dfilppi
Introduction to Real Time Analytics
Homeland Security
Real Time Search
Social
eCommerce
User Tracking &
Engagement
Financial Services
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved2
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved3
The Two Vs of Big Data
Velocity Volume
The Flavors of Big Data Analytics
Counting Correlating Research
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved4
It’s All about Timing
• Event driven / stream processing
• High resolution – every tweet gets counted
• Ad-hoc querying
• Medium resolution (aggregations)
• Long running batch jobs (ETL, map/reduce)
• Low resolution (trends & patterns)
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved5
This is what
we’re here
to discuss 
Facebook & Twitter Real Time Analytics
FACEBOOK REAL-TIME
ANALYTICS SYSTEM
(LOGGING CENTRIC APPROACH)
7
The actual analytics..
 Like button analytics
 Comments box analytics
8
® Copyright 2011 Gigaspaces Ltd. All Rights
PTail
Scribe
Puma
Hbase
FACEBOOK
Log
FACEBOOK
Log
FACEBOOK
Log
HDFS
Real Time Long Term
Batch
1.5 Sec
Facebook architecture..
10,000
write/sec
per server
TWITTER REAL-TIME
ANALYTICS SYSTEM
(EVENT DRIVEN APPROACH)
10
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved11
URL Mentions – Here’s One Use Case
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved12
Twitter Real Time Analytics based on Storm
Comparing the two approaches..
Facebook
 Rely on Hadoop for Real
Time and Batch
 RT = 10’s Sec
 Suits for Simple processing
 Low parallelization
Twitter
 Use Hadoop for Batch and
Storm for real time
 RT = Msec, Sec
 Suits for Complex
processing
 Extremely parallel
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved13
This is what
we’re here
to discuss 
Introduction
to Storm
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved14
 Popular open source, real time, in-memory, streaming
computation platform.
 Includes distributed runtime and intuitive API for defining
distributed processing flows.
 Scalable and fault tolerant.
 Developed at BackType,
and open sourced by Twitter
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved15
Storm Background
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved16
Storm Cluster
 Streams
 Unbounded sequence of tuples
 Spouts
 Source of streams (Queues)
 Bolts
 Functions, Filters, Joins, Aggregations
 Topologies
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved17
Storm Concepts
Spouts
Bolt
Topologies
Challenge – Word Count
Word:Count
Tweets
Count
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved18
• Hottest topics
• URL mentions
• etc.
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved19
Streaming word count with Storm
® Copyright 2011 Gigaspaces Ltd. All Rights Reserved20
Computing Reach with Event Streams
But where is my
Big
Data?
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved21
Bolt
Bolt
Spout
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved22
The Big Picture …
Twitter
feed
Twitter
Feed
Twiter
Feed
Web
Activity
Web
Activity
Web
Activity
Analytics Data
Research
Data
Counters
Reference
Data
StormData feeds (Kafka, Twitter,..) Cassandra, MongoDB, Hbase,..
End to End Latency
 Storm performance and reliability
 Assumes success is normal
 Uses batching and pipelining for performance
 Storm plug-ins has significant effect on performance and
reliability
 Spout must be able to replay tuples on demand in case of error.
 Storm uses topology semantics for ensuring consistency
through event ordering
 Can be tedious for handling counters
 Doesn’t ensure the state of the counters
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved23
Your as as strong as your weakest link
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved24
Typical user experience…
Now, Kafka is *fast*. When running the Kafka
Spout by itself, I easily reproduced Kafka's claim
that you can consume "hundreds of thousands
of messages per second".
When I first fired up the topology, things went
well for the first minute, but then quickly
crashedas the Kafka spout emitted too
fast for the Cassandra Bolt to keep up. Even
though Cassandra is fast as well, it is still
orders of magnitude slower
than Kafka
Source: A Big Data Trifecta: Storm, Kafka and Cassandra. Brian Oniells Blog
What if we could put
everything In Memory?
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved25
An Alternative Approach
Did you know?
Facebook keeps 80%
of its data in
Memory
(Stanford research)
RAM is 100-1000x
faster than Disk
(Random seek)
• Disk: 5 -10ms
• RAM: ~0.001msec
 RAM is the new disk
 Data partitioned across a cluster
 Large “virtual” memory space
 Transactional
 Highly available
 Code with Data
In Memory Data Grid Review
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved27
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved28
Integrating with Storm
Bolt
Bolt
Spout
Web
Activity
Web
Activity
Web
Activity
Analytics Data
Research
Data
Counters
Reference
Data
In Memory Data Grid
(via Storm Trident State plug-in)
In Memory Data Stream
(Via Storm Spout Plugin)
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved29
In Memory Streaming Word Count with Storm
Storm has a simple builder
interface to creating
stream processing
topologies
Storm delegates
persistence to external
providers
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved30
Integrating with Hadoop, NoSQL DB..
Bolt
Bolt
Spout
Web
Activity
Web
Activity
Web
Activity
Analytics Data
Research
Data
Counters
Reference
Data
In Memory Data GridIn Memory Data Stream Storm Plugin
Hadoop, NoSQL, RDBMS,…
Write Behind
LRU based Policy
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved31
Live Demo – Word Count At In Memory Speed
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved32
Recent Benchmarks..
Gresham Computing plc, achieved over 50,000
equity trade transactions per second of load and match into
a database.
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved33
® Copyright 2013 Gigaspaces Ltd. All Rights Reserved34
References
 Try the Cloudify recipe
 Download Cloudify : http://www.cloudifysource.org/
 Download the Recipe (apps/xapstream, services/xapstream):
– https://github.com/CloudifySource/cloudify-recipes
 XAP – Cassandra Interface Details;
 http://wiki.gigaspaces.com/wiki/display/XAP95/Cassandra+Space+Persistency
 Check out the source for the XAP Spout and a sample state
implementation backed by XAP, and a Storm friendly streaming
implemention on github:
 https://github.com/Gigaspaces/storm-integration
 For more background on the effort, check out my recent blog posts at
http://blog.gigaspaces.com/
 http://blog.gigaspaces.com/gigaspaces-and-storm-part-1-storm-clouds/
 http://blog.gigaspaces.com/gigaspaces-and-storm-part-2-xap-integration/
 Part 3 coming soon.

More Related Content

What's hot (20)

PDF
Apache Storm Concepts
André Dias
 
PDF
Storm: distributed and fault-tolerant realtime computation
nathanmarz
 
PPTX
Yahoo compares Storm and Spark
Chicago Hadoop Users Group
 
PPS
Storm presentation
Shyam Raj
 
PDF
Real-time streams and logs with Storm and Kafka
Andrew Montalenti
 
PPTX
Scaling Apache Storm (Hadoop Summit 2015)
Robert Evans
 
PPTX
Multi-Tenant Storm Service on Hadoop Grid
DataWorks Summit
 
PPTX
Apache Storm 0.9 basic training - Verisign
Michael Noll
 
PDF
Realtime Analytics with Storm and Hadoop
DataWorks Summit
 
PDF
Storm: The Real-Time Layer - GlueCon 2012
Dan Lynn
 
PPTX
Cassandra and Storm at Health Market Sceince
P. Taylor Goetz
 
PDF
Introduction to Twitter Storm
Uwe Printz
 
PDF
Scaling Apache Storm - Strata + Hadoop World 2014
P. Taylor Goetz
 
PPTX
Apache Storm Internals
Humoyun Ahmedov
 
PPTX
Storm-on-YARN: Convergence of Low-Latency and Big-Data
DataWorks Summit
 
PPTX
Slide #1:Introduction to Apache Storm
Md. Shamsur Rahim
 
PDF
Storm Real Time Computation
Sonal Raj
 
PPT
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
PDF
Storm: Distributed and fault tolerant realtime computation
Ferran Galí Reniu
 
PDF
Real-Time Analytics with Kafka, Cassandra and Storm
John Georgiadis
 
Apache Storm Concepts
André Dias
 
Storm: distributed and fault-tolerant realtime computation
nathanmarz
 
Yahoo compares Storm and Spark
Chicago Hadoop Users Group
 
Storm presentation
Shyam Raj
 
Real-time streams and logs with Storm and Kafka
Andrew Montalenti
 
Scaling Apache Storm (Hadoop Summit 2015)
Robert Evans
 
Multi-Tenant Storm Service on Hadoop Grid
DataWorks Summit
 
Apache Storm 0.9 basic training - Verisign
Michael Noll
 
Realtime Analytics with Storm and Hadoop
DataWorks Summit
 
Storm: The Real-Time Layer - GlueCon 2012
Dan Lynn
 
Cassandra and Storm at Health Market Sceince
P. Taylor Goetz
 
Introduction to Twitter Storm
Uwe Printz
 
Scaling Apache Storm - Strata + Hadoop World 2014
P. Taylor Goetz
 
Apache Storm Internals
Humoyun Ahmedov
 
Storm-on-YARN: Convergence of Low-Latency and Big-Data
DataWorks Summit
 
Slide #1:Introduction to Apache Storm
Md. Shamsur Rahim
 
Storm Real Time Computation
Sonal Raj
 
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
Storm: Distributed and fault tolerant realtime computation
Ferran Galí Reniu
 
Real-Time Analytics with Kafka, Cassandra and Storm
John Georgiadis
 

Viewers also liked (20)

PDF
Customer value analysis of big data products
Vikas Sardana
 
PDF
Storm Persistence and Real-Time Analytics
Aerospike, Inc.
 
PDF
Stream processing using Apache Storm - Big Data Meetup Athens 2016
Adrianos Dadis
 
PDF
How to create intelligent Business Processes thanks to Big Data (BPM, Apache ...
Kai Wähner
 
PDF
Big Data Real Time Applications
DataWorks Summit
 
PDF
Next-Generation BPM - How to create intelligent Business Processes thanks to ...
Kai Wähner
 
PPTX
A taste of Snowplow Analytics data
Robert Kingston
 
PPTX
Why use big data tools to do web analytics? And how to do it using Snowplow a...
yalisassoon
 
PDF
Brand strategy
Zaid Sarhan, MBA
 
PPTX
Enterprise Analytics: Serving Big Data Projects for Healthcare
DATA360US
 
PDF
Service Blueprinting / Service Design Drinks Berlin
Service Design Berlin
 
PPT
Big Data Real Time Analytics - A Facebook Case Study
Nati Shalom
 
PDF
Lambda architecture for real time big data
Trieu Nguyen
 
KEY
Big Data in Real-Time at Twitter
nkallen
 
PDF
Big Data Architecture
Guido Schmutz
 
PDF
Real Time Data Streaming using Kafka & Storm
Ran Silberman
 
PDF
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
Anand Bagmar
 
PPT
Standardization and customization
YASHADA, Pune
 
DOCX
Project titles for mba research project
Ezhil Arasan
 
PPTX
Big data architectures and the data lake
James Serra
 
Customer value analysis of big data products
Vikas Sardana
 
Storm Persistence and Real-Time Analytics
Aerospike, Inc.
 
Stream processing using Apache Storm - Big Data Meetup Athens 2016
Adrianos Dadis
 
How to create intelligent Business Processes thanks to Big Data (BPM, Apache ...
Kai Wähner
 
Big Data Real Time Applications
DataWorks Summit
 
Next-Generation BPM - How to create intelligent Business Processes thanks to ...
Kai Wähner
 
A taste of Snowplow Analytics data
Robert Kingston
 
Why use big data tools to do web analytics? And how to do it using Snowplow a...
yalisassoon
 
Brand strategy
Zaid Sarhan, MBA
 
Enterprise Analytics: Serving Big Data Projects for Healthcare
DATA360US
 
Service Blueprinting / Service Design Drinks Berlin
Service Design Berlin
 
Big Data Real Time Analytics - A Facebook Case Study
Nati Shalom
 
Lambda architecture for real time big data
Trieu Nguyen
 
Big Data in Real-Time at Twitter
nkallen
 
Big Data Architecture
Guido Schmutz
 
Real Time Data Streaming using Kafka & Storm
Ran Silberman
 
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
Anand Bagmar
 
Standardization and customization
YASHADA, Pune
 
Project titles for mba research project
Ezhil Arasan
 
Big data architectures and the data lake
James Serra
 
Ad

Similar to Real-Time Big Data at In-Memory Speed, Using Storm (20)

PPTX
Cassandra summit-2013
dfilppi
 
PDF
C* Summit 2013: Real-Time Big Data with Storm, Cassandra, and In-Memory Compu...
DataStax Academy
 
PDF
Storm@Twitter, SIGMOD 2014 paper
Karthik Ramasamy
 
PDF
Big Data Streaming processing using Apache Storm - FOSSCOMM 2016
Adrianos Dadis
 
PPTX
Testistanbul 2016 - Keynote: "Performance Testing of Big Data" by Roland Leusden
Turkish Testing Board
 
PDF
Data Streaming For Big Data
Seval Çapraz
 
PPTX
Trivento summercamp masterclass 9/9/2016
Stavros Kontopoulos
 
PDF
Velocity 2015-final
Arun Kejariwal
 
PDF
Hadoop Ecosystem and Low Latency Streaming Architecture
InSemble
 
PDF
Building end to end streaming application on Spark
datamantra
 
PDF
Big Data Open Source Tools and Trends: Enable Real-Time Business Intelligence...
Perficient, Inc.
 
PPTX
Bigdata analytics-twitter
dfilppi
 
PPTX
Big Data & Hadoop Introduction
Jayant Mukherjee
 
PPTX
Software architecture for data applications
Ding Li
 
PDF
Storm at spider.io - London Storm Meetup 2013-06-18
Ashley Brown
 
PPT
CS8091_BDA_Unit_IV_Stream_Computing
Palani Kumar
 
ODP
Web-scale data processing: practical approaches for low-latency and batch
Edward Capriolo
 
PPTX
The Big Data Stack
Zubair Nabi
 
PDF
Streaming Visualization
Guido Schmutz
 
PPTX
Big Data Warehousing Meetup: Real-time Trade Data Monitoring with Storm & Cas...
Caserta
 
Cassandra summit-2013
dfilppi
 
C* Summit 2013: Real-Time Big Data with Storm, Cassandra, and In-Memory Compu...
DataStax Academy
 
Storm@Twitter, SIGMOD 2014 paper
Karthik Ramasamy
 
Big Data Streaming processing using Apache Storm - FOSSCOMM 2016
Adrianos Dadis
 
Testistanbul 2016 - Keynote: "Performance Testing of Big Data" by Roland Leusden
Turkish Testing Board
 
Data Streaming For Big Data
Seval Çapraz
 
Trivento summercamp masterclass 9/9/2016
Stavros Kontopoulos
 
Velocity 2015-final
Arun Kejariwal
 
Hadoop Ecosystem and Low Latency Streaming Architecture
InSemble
 
Building end to end streaming application on Spark
datamantra
 
Big Data Open Source Tools and Trends: Enable Real-Time Business Intelligence...
Perficient, Inc.
 
Bigdata analytics-twitter
dfilppi
 
Big Data & Hadoop Introduction
Jayant Mukherjee
 
Software architecture for data applications
Ding Li
 
Storm at spider.io - London Storm Meetup 2013-06-18
Ashley Brown
 
CS8091_BDA_Unit_IV_Stream_Computing
Palani Kumar
 
Web-scale data processing: practical approaches for low-latency and batch
Edward Capriolo
 
The Big Data Stack
Zubair Nabi
 
Streaming Visualization
Guido Schmutz
 
Big Data Warehousing Meetup: Real-time Trade Data Monitoring with Storm & Cas...
Caserta
 
Ad

More from Nati Shalom (20)

PDF
Cloudify and terraform integration
Nati Shalom
 
PDF
Why NFV and Digital Transformation Projects Fail!
Nati Shalom
 
PDF
Cloudify and terraform integration
Nati Shalom
 
PDF
1 cloud, 2 clouds, 3 clouds, tons...
Nati Shalom
 
PDF
Open Stack Days israel Keynote 2017
Nati Shalom
 
PDF
What A No Compromises Hybrid Cloud Looks Like
Nati Shalom
 
PDF
Running OpenStack in Production
Nati Shalom
 
PPTX
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Nati Shalom
 
PPTX
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Nati Shalom
 
PPTX
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Nati Shalom
 
PPTX
OpenStack Juno The Complete Lowdown and Tales from the Summit
Nati Shalom
 
PPTX
Application and Network Orchestration using Heat & Tosca
Nati Shalom
 
PPTX
Introduction to Cloudify for OpenStack users
Nati Shalom
 
PPTX
Software Defined Operator
Nati Shalom
 
PPTX
Complex Analytics with NoSQL Data Store in Real Time
Nati Shalom
 
PPTX
Is Orchestration the Next Big Thing in DevOps
Nati Shalom
 
PPTX
When networks meets apps (open stack atlanta)
Nati Shalom
 
PPTX
Application Centric Approach to Devops
Nati Shalom
 
PPTX
Case Studies for moving apps to the cloud - DLD 2013
Nati Shalom
 
PPTX
Application Centric DevOps
Nati Shalom
 
Cloudify and terraform integration
Nati Shalom
 
Why NFV and Digital Transformation Projects Fail!
Nati Shalom
 
Cloudify and terraform integration
Nati Shalom
 
1 cloud, 2 clouds, 3 clouds, tons...
Nati Shalom
 
Open Stack Days israel Keynote 2017
Nati Shalom
 
What A No Compromises Hybrid Cloud Looks Like
Nati Shalom
 
Running OpenStack in Production
Nati Shalom
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Nati Shalom
 
Real World Example of Orchestrating Docker, Node JS, NFV on OpenStack
Nati Shalom
 
Real World Application Orchestration Made Easy on VMware vCloud Air, vSphere ...
Nati Shalom
 
OpenStack Juno The Complete Lowdown and Tales from the Summit
Nati Shalom
 
Application and Network Orchestration using Heat & Tosca
Nati Shalom
 
Introduction to Cloudify for OpenStack users
Nati Shalom
 
Software Defined Operator
Nati Shalom
 
Complex Analytics with NoSQL Data Store in Real Time
Nati Shalom
 
Is Orchestration the Next Big Thing in DevOps
Nati Shalom
 
When networks meets apps (open stack atlanta)
Nati Shalom
 
Application Centric Approach to Devops
Nati Shalom
 
Case Studies for moving apps to the cloud - DLD 2013
Nati Shalom
 
Application Centric DevOps
Nati Shalom
 

Recently uploaded (20)

PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Introducing and Operating FME Flow for Kubernetes in a Large Enterprise: Expe...
Safe Software
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Introducing and Operating FME Flow for Kubernetes in a Large Enterprise: Expe...
Safe Software
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 

Real-Time Big Data at In-Memory Speed, Using Storm

  • 1. Real Time Big Data With Storm, Cassandra, and In-Memory Computing Nati Shalom @natishalom DeWayne Filppi @dfilppi
  • 2. Introduction to Real Time Analytics Homeland Security Real Time Search Social eCommerce User Tracking & Engagement Financial Services ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved2
  • 3. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved3 The Two Vs of Big Data Velocity Volume
  • 4. The Flavors of Big Data Analytics Counting Correlating Research ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved4
  • 5. It’s All about Timing • Event driven / stream processing • High resolution – every tweet gets counted • Ad-hoc querying • Medium resolution (aggregations) • Long running batch jobs (ETL, map/reduce) • Low resolution (trends & patterns) ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved5 This is what we’re here to discuss 
  • 6. Facebook & Twitter Real Time Analytics
  • 8. The actual analytics..  Like button analytics  Comments box analytics 8 ® Copyright 2011 Gigaspaces Ltd. All Rights
  • 9. PTail Scribe Puma Hbase FACEBOOK Log FACEBOOK Log FACEBOOK Log HDFS Real Time Long Term Batch 1.5 Sec Facebook architecture.. 10,000 write/sec per server
  • 11. ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved11 URL Mentions – Here’s One Use Case
  • 12. ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved12 Twitter Real Time Analytics based on Storm
  • 13. Comparing the two approaches.. Facebook  Rely on Hadoop for Real Time and Batch  RT = 10’s Sec  Suits for Simple processing  Low parallelization Twitter  Use Hadoop for Batch and Storm for real time  RT = Msec, Sec  Suits for Complex processing  Extremely parallel ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved13 This is what we’re here to discuss 
  • 14. Introduction to Storm ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved14
  • 15.  Popular open source, real time, in-memory, streaming computation platform.  Includes distributed runtime and intuitive API for defining distributed processing flows.  Scalable and fault tolerant.  Developed at BackType, and open sourced by Twitter ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved15 Storm Background
  • 16. ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved16 Storm Cluster
  • 17.  Streams  Unbounded sequence of tuples  Spouts  Source of streams (Queues)  Bolts  Functions, Filters, Joins, Aggregations  Topologies ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved17 Storm Concepts Spouts Bolt Topologies
  • 18. Challenge – Word Count Word:Count Tweets Count ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved18 • Hottest topics • URL mentions • etc.
  • 19. ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved19 Streaming word count with Storm
  • 20. ® Copyright 2011 Gigaspaces Ltd. All Rights Reserved20 Computing Reach with Event Streams
  • 21. But where is my Big Data? ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved21
  • 22. Bolt Bolt Spout ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved22 The Big Picture … Twitter feed Twitter Feed Twiter Feed Web Activity Web Activity Web Activity Analytics Data Research Data Counters Reference Data StormData feeds (Kafka, Twitter,..) Cassandra, MongoDB, Hbase,.. End to End Latency
  • 23.  Storm performance and reliability  Assumes success is normal  Uses batching and pipelining for performance  Storm plug-ins has significant effect on performance and reliability  Spout must be able to replay tuples on demand in case of error.  Storm uses topology semantics for ensuring consistency through event ordering  Can be tedious for handling counters  Doesn’t ensure the state of the counters ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved23 Your as as strong as your weakest link
  • 24. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved24 Typical user experience… Now, Kafka is *fast*. When running the Kafka Spout by itself, I easily reproduced Kafka's claim that you can consume "hundreds of thousands of messages per second". When I first fired up the topology, things went well for the first minute, but then quickly crashedas the Kafka spout emitted too fast for the Cassandra Bolt to keep up. Even though Cassandra is fast as well, it is still orders of magnitude slower than Kafka Source: A Big Data Trifecta: Storm, Kafka and Cassandra. Brian Oniells Blog
  • 25. What if we could put everything In Memory? ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved25 An Alternative Approach
  • 26. Did you know? Facebook keeps 80% of its data in Memory (Stanford research) RAM is 100-1000x faster than Disk (Random seek) • Disk: 5 -10ms • RAM: ~0.001msec
  • 27.  RAM is the new disk  Data partitioned across a cluster  Large “virtual” memory space  Transactional  Highly available  Code with Data In Memory Data Grid Review ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved27
  • 28. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved28 Integrating with Storm Bolt Bolt Spout Web Activity Web Activity Web Activity Analytics Data Research Data Counters Reference Data In Memory Data Grid (via Storm Trident State plug-in) In Memory Data Stream (Via Storm Spout Plugin)
  • 29. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved29 In Memory Streaming Word Count with Storm Storm has a simple builder interface to creating stream processing topologies Storm delegates persistence to external providers
  • 30. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved30 Integrating with Hadoop, NoSQL DB.. Bolt Bolt Spout Web Activity Web Activity Web Activity Analytics Data Research Data Counters Reference Data In Memory Data GridIn Memory Data Stream Storm Plugin Hadoop, NoSQL, RDBMS,… Write Behind LRU based Policy
  • 31. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved31 Live Demo – Word Count At In Memory Speed
  • 32. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved32 Recent Benchmarks.. Gresham Computing plc, achieved over 50,000 equity trade transactions per second of load and match into a database.
  • 33. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved33
  • 34. ® Copyright 2013 Gigaspaces Ltd. All Rights Reserved34 References  Try the Cloudify recipe  Download Cloudify : http://www.cloudifysource.org/  Download the Recipe (apps/xapstream, services/xapstream): – https://github.com/CloudifySource/cloudify-recipes  XAP – Cassandra Interface Details;  http://wiki.gigaspaces.com/wiki/display/XAP95/Cassandra+Space+Persistency  Check out the source for the XAP Spout and a sample state implementation backed by XAP, and a Storm friendly streaming implemention on github:  https://github.com/Gigaspaces/storm-integration  For more background on the effort, check out my recent blog posts at http://blog.gigaspaces.com/  http://blog.gigaspaces.com/gigaspaces-and-storm-part-1-storm-clouds/  http://blog.gigaspaces.com/gigaspaces-and-storm-part-2-xap-integration/  Part 3 coming soon.

Editor's Notes

  • #3: ActiveInsight
  • #7: ActiveInsight
  • #9: http://developers.facebook.com/blog/post/476/
  • #10: http://highscalability.com/blog/2011/3/22/facebooks-new-realtime-analytics-system-hbase-to-process-20.htmlThe Winner: HBase + Scribe + Ptail + PumaAt a high level:HBase stores data across distributed machines.Use a tailing architecture, new events are stored in log files, and the logs are tailed.A system rolls the events up and writes them into storage.A UI pulls the data out and displays it to users.Data FlowUser clicks Like on a web page.Fires AJAX request to Facebook.Request is written to a log file using Scribe. Scribe handles issues like file roll over.Scribe is built on the same HTFS file store Hadoop is built on.Write extremely lean log lines. The more compact the log lines the more can be stored in memory.PtailData is read from the log files using Ptail. Ptail is an internal tool built to aggregate data from multiple Scribe stores. It tails the log files and pulls data out.Ptail data is separated out into three streams so they can eventually be sent to their own clusters in different datacenters.Plugin impressionNews feed impressionsActions (plugin + news feed)PumaBatch data to lessen the impact of hot keys. Even though HBase can handle a lot of writes per second they still want to batch data. A hot article will generate a lot of impressions and news feed impressions which will cause huge data skews which will cause IO issues. The more batching the better.Batch for 1.5 seconds on average. Would like to batch longer but they have so many URLs that they run out of memory when creating a hashtable.Wait for last flush to complete for starting new batch to avoid lock contention issues.UI  Renders DataFrontends are all written in PHP.The backend is written in Java and Thrift is used as the messaging format so PHP programs can query Java services.Caching solutions are used to make the web pages display more quickly.Performance varies by the statistic. A counter can come back quickly. Find the top URL in a domain can take longer. Range from .5 to a few seconds. The more and longer data is cached the less realtime it is.Set different caching TTLs in memcache.MapReduceThe data is then sent to MapReduce servers so it can be queried via Hive.This also serves as a backup plan as the data can be recovered from Hive.Raw logs are removed after a period of time.HBase is a distribute column store. Database interface to Hadoop. Facebook has people working internally on HBase. Unlike a relational database you don't create mappings between tables.You don't create indexes. The only index you have a primary row key.From the row key you can have millions of sparse columns of storage. It's very flexible. You don't have to specify the schema. You define column families to which you can add keys at anytime.Key feature to scalability and reliability is the WAL, write ahead log, which is a log of the operations that are supposed to occur. Based on the key, data is sharded to a region server. Written to WAL first.Data is put into memory. At some point in time or if enough data has been accumulated the data is flushed to disk.If the machine goes down you can recreate the data from the WAL. So there's no permanent data loss.Use a combination of the log and in-memory storage they can handle an extremely high rate of IO reliably. HBase handles failure detection and automatically routes across failures.Currently HBaseresharding is done manually.Automatic hot spot detection and resharding is on the roadmap for HBase, but it's not there yet.Every Tuesday someone looks at the keys and decides what changes to make in the sharding plan.Schema Store on a per URL basis a bunch of counters.A row key, which is the only lookup key, is the MD5 hash of the reverse domainSelecting the proper key structure helps with scanning and sharding.A problem they have is sharding data properly onto different machines. Using a MD5 hash makes it easier to say this range goes here and that range goes there. For URLs they do something similar, plus they add an ID on top of that. Every URL in Facebook is represented by a unique ID, which is used to help with sharding.A reverse domain, com.facebook/ for example, is used so that the data is clustered together. HBase is really good at scanning clustered data, so if they store the data so it's clustered together they can efficiently calculate stats across domains. Think of every row a URL and every cell as a counter, you are able to set different TTLs (time to live) for each cell. So if keeping an hourly count there's no reason to keep that around for every URL forever, so they set a TTL of two weeks. Typically set TTLs on a per column family basis. Per server they can handle 10,000 writes per second. Checkpointing is used to prevent data loss when reading data from log files. Tailers save log stream check points  in HBase.Replayed on startup so won't lose data.Useful for detecting click fraud, but it doesn't have fraud detection built in.Tailer Hot SpotsIn a distributed system there's a chance one part of the system can be hotter than another.One example are region servers that can be hot because more keys are being directed that way.One tailer can be lag behind another too.If one tailer is an hour behind and the others are up to date, what numbers do you display in the UI?For example, impressions have a way higher volume than actions, so CTR rates were way higher in the last hour.Solution is to figure out the least up to date tailer and use that when querying metrics.
  • #24: Storm (quite rationally) assumes success is normalStorm uses batching and pipelining for performanceTherefore the spout must be able to replay tuples on demand in case of error.Any kind of quasi-queue like data source can be fashioned into a spout.No persistence is ever required, and speed attained by minimizing network hops during topology processing.
  • #33: http://www.gigaspaces.com/greshams-ctc-reconciles-transactions-orders-magnitude-faster-competitive-offerings-intel-benchmarkinhttp://natishalom.typepad.com/nati_shaloms_blog/2013/01/in-memory-computing-data-grid-for-big-data.html