Storm introduction

Angelo Genovese
Angelo GenoveseDeveloper at Street Contxt
Apache Storm 
A Brief Introduction
What Is Storm 
● Distributed 
● Stream Oriented 
● Real Time* 
● Scalable 
● Reliable**
Topologies 
● Storm’s equivalent of an application 
○ Consists of Components (Spouts and Bolts) 
■ parallelism 
■ Data represented as streams of tuples
Spouts 
● Spouts 
○ Expose an external input source 
■ An unbounded stream of data 
○ Are polled, by storm, for their next Tuple 
○ Produce one or more streams of Tuples 
○ Notified when a Tuple is completely processed 
○ Notified when a Tuple fails to be processed
Bolts 
● Bolts 
○ Subscribes to one or more Streams 
■ Grouped by all, randomly, or by Field values 
○ Produces zero or more Streams 
○ Single threaded execution per instance
An Example 
Classic word count: 
Lets assume we have an unbounded incoming stream of 
sentences and we want to have a constantly updated count 
of the words found in the text. 
Code: 
https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/WordCountTopology.java
Building a topology 
We provide a description of the topology to be 
deployed via the fluent TopologyBuilder class. 
TopologyBuilder builder = new TopologyBuilder();
Spout 
First we’ll create a spout to generate random 
sentences and add it to the topology 
public class RandomSentenceSpout extends BaseRichSpout { 
… 
public void nextTuple() { 
String[] sentences = new String[]{ "the cow jumped over the moon", "an apple a day keeps the doctor away", 
"four score and seven years ago", "snow white and the seven dwarfs", "i am at two with nature" }; 
String sentence = sentences[_rand.nextInt(sentences.length)]; 
_collector.emit(new Values(sentence)); 
} 
… 
} 
builder.setSpout("spout", new RandomSentenceSpout(), 5);
Split Messages 
Next we’ll split each item into words. 
The example is in python, here it is in Java: 
public static class SplitSentence extends BaseBasicBolt { 
... 
public void execute(Tuple tuple, BasicOutputCollector collector) { 
String sentence = tuple.getString(0); 
for (String word : sentence.split(“s”)) { 
collector.emit(new Values(word)); 
} 
} 
... 
} 
builder.setBolt("split", new SplitSentence(), 8).shuffleGrouping("spout");
Count Words 
Now we can count the words 
public static class WordCount extends BaseBasicBolt { 
Map<String, Integer> counts = new HashMap<String, Integer>(); 
public void execute(Tuple tuple, BasicOutputCollector collector) { 
String word = tuple.getString(0); 
Integer count = counts.get(word); 
if (count == null) 
count = 0; 
count++; 
counts.put(word, count); 
collector.emit(new Values(word, count)); 
} 
... 
} 
builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));
Discussion 
● Component Lifecycle Events 
● In Memory State 
● Deployment view
Ecosystem 
● Trident 
● SummingBird
Alternatives 
● Spark Streaming
Questions? 
comments, concerns or criticisms?
1 of 14

Recommended

실시간 인벤트 처리 by
실시간 인벤트 처리실시간 인벤트 처리
실시간 인벤트 처리Byeongweon Moon
942 views18 slides
Async task by
Async taskAsync task
Async taskLwp Xd
79 views2 slides
Namespace1 by
Namespace1Namespace1
Namespace1zindadili
79 views15 slides
Lfu by
LfuLfu
LfuAnirban Mitra
4.2K views8 slides
作業系統 by
作業系統作業系統
作業系統慧鈴 鍾
240 views5 slides
working with files by
working with filesworking with files
working with filesSangeethaSasi1
27 views18 slides

More Related Content

What's hot

Glusterfs session #5 inode t, fd-t lifecycles by
Glusterfs session #5   inode t, fd-t lifecyclesGlusterfs session #5   inode t, fd-t lifecycles
Glusterfs session #5 inode t, fd-t lifecyclesPranith Karampuri
45 views16 slides
Sorter by
SorterSorter
SorterThomas Knudstrup
172 views7 slides
Java 7 new features by
Java 7 new featuresJava 7 new features
Java 7 new featuresAliaksandr Kazlou
768 views9 slides
1 sample16c132 java-programming by
1 sample16c132 java-programming1 sample16c132 java-programming
1 sample16c132 java-programmingMary Jones
308 views16 slides
Devry gsp 215 week 6 i lab virtual memory new by
Devry gsp 215 week 6 i lab virtual memory newDevry gsp 215 week 6 i lab virtual memory new
Devry gsp 215 week 6 i lab virtual memory newwilliamethan912
12 views4 slides
Ns2 ns3 training in mohali by
Ns2 ns3 training in mohaliNs2 ns3 training in mohali
Ns2 ns3 training in mohaliArwinder paul singh
174 views35 slides

What's hot(20)

Glusterfs session #5 inode t, fd-t lifecycles by Pranith Karampuri
Glusterfs session #5   inode t, fd-t lifecyclesGlusterfs session #5   inode t, fd-t lifecycles
Glusterfs session #5 inode t, fd-t lifecycles
1 sample16c132 java-programming by Mary Jones
1 sample16c132 java-programming1 sample16c132 java-programming
1 sample16c132 java-programming
Mary Jones308 views
Devry gsp 215 week 6 i lab virtual memory new by williamethan912
Devry gsp 215 week 6 i lab virtual memory newDevry gsp 215 week 6 i lab virtual memory new
Devry gsp 215 week 6 i lab virtual memory new
williamethan91212 views
เกมส์จับคู่ by Aeew Autaporn
เกมส์จับคู่เกมส์จับคู่
เกมส์จับคู่
Aeew Autaporn461 views
Network simulator 2 by AAKASH S
Network simulator 2Network simulator 2
Network simulator 2
AAKASH S611 views
Coding convention by Khoa Nguyen
Coding conventionCoding convention
Coding convention
Khoa Nguyen374 views
In class, we discussed min-heaps. In a min-heap the element of the heap with ... by licservernoida
In class, we discussed min-heaps. In a min-heap the element of the heap with ...In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
licservernoida19 views
Creating a Name seperator Custom Control using C# by priya Nithya
Creating a Name seperator Custom Control using C#Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#
priya Nithya76 views

Viewers also liked

проекторы by
проекторы проекторы
проекторы Aida Mamasali
345 views22 slides
FARO 3D Metrology Solutions by
FARO 3D Metrology SolutionsFARO 3D Metrology Solutions
FARO 3D Metrology SolutionsAndrew McEwen
316 views11 slides
Presentasi sej pemikiran islam by
Presentasi   sej pemikiran islamPresentasi   sej pemikiran islam
Presentasi sej pemikiran islamNi'matul Kediri
722 views34 slides
Patagonia's H2No Digital marketing plan by
Patagonia's H2No Digital marketing planPatagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing planDamon Huber
507 views8 slides
Presentasi ku manajemen pai by
Presentasi  ku manajemen paiPresentasi  ku manajemen pai
Presentasi ku manajemen paiNi'matul Kediri
261 views31 slides
Història escola sant esteve by
Història escola sant esteveHistòria escola sant esteve
Història escola sant estevecomunitat
167 views33 slides

Viewers also liked(17)

FARO 3D Metrology Solutions by Andrew McEwen
FARO 3D Metrology SolutionsFARO 3D Metrology Solutions
FARO 3D Metrology Solutions
Andrew McEwen316 views
Patagonia's H2No Digital marketing plan by Damon Huber
Patagonia's H2No Digital marketing planPatagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing plan
Damon Huber507 views
Història escola sant esteve by comunitat
Història escola sant esteveHistòria escola sant esteve
Història escola sant esteve
comunitat167 views
Accounting ppt by ACT2013
Accounting pptAccounting ppt
Accounting ppt
ACT2013741 views
Music magazine genres by emmalouise0
Music magazine genresMusic magazine genres
Music magazine genres
emmalouise0340 views
Case app cirrus aircraft by Andrew McEwen
Case app cirrus aircraft Case app cirrus aircraft
Case app cirrus aircraft
Andrew McEwen454 views
Catch Up_Epilogue by Mina Lee
Catch Up_EpilogueCatch Up_Epilogue
Catch Up_Epilogue
Mina Lee406 views
Autocad by ACT2013
AutocadAutocad
Autocad
ACT2013501 views
Accounting ppt by ACT2013
Accounting pptAccounting ppt
Accounting ppt
ACT2013636 views
Project on sales promotion in big bazaar by rockierock
Project on sales promotion in big bazaarProject on sales promotion in big bazaar
Project on sales promotion in big bazaar
rockierock85.2K views

Similar to Storm introduction

Introduction to Apache Storm by
Introduction to Apache StormIntroduction to Apache Storm
Introduction to Apache StormTiziano De Matteis
1.1K views37 slides
Real time stream processing presentation at General Assemb.ly by
Real time stream processing presentation at General Assemb.lyReal time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.lyVarun Vijayaraghavan
601 views25 slides
Storm by
StormStorm
StormPouyan Rezazadeh
843 views33 slides
Apache Storm Tutorial by
Apache Storm TutorialApache Storm Tutorial
Apache Storm TutorialFarzad Nozarian
2K views23 slides
Real time and reliable processing with Apache Storm by
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormAndrea Iacono
4.3K views34 slides
PigSPARQL: A SPARQL Query Processing Baseline for Big Data by
PigSPARQL: A SPARQL Query Processing Baseline for Big DataPigSPARQL: A SPARQL Query Processing Baseline for Big Data
PigSPARQL: A SPARQL Query Processing Baseline for Big DataAlexander Schätzle
809 views20 slides

Similar to Storm introduction(20)

Real time stream processing presentation at General Assemb.ly by Varun Vijayaraghavan
Real time stream processing presentation at General Assemb.lyReal time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.ly
Real time and reliable processing with Apache Storm by Andrea Iacono
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache Storm
Andrea Iacono4.3K views
PigSPARQL: A SPARQL Query Processing Baseline for Big Data by Alexander Schätzle
PigSPARQL: A SPARQL Query Processing Baseline for Big DataPigSPARQL: A SPARQL Query Processing Baseline for Big Data
PigSPARQL: A SPARQL Query Processing Baseline for Big Data
Real-Time Streaming with Apache Spark Streaming and Apache Storm by Davorin Vukelic
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Davorin Vukelic5.7K views
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ... by Codemotion
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...
Codemotion750 views
Streams processing with Storm by Mariusz Gil
Streams processing with StormStreams processing with Storm
Streams processing with Storm
Mariusz Gil7.8K views
Distributed Realtime Computation using Apache Storm by the100rabh
Distributed Realtime Computation using Apache StormDistributed Realtime Computation using Apache Storm
Distributed Realtime Computation using Apache Storm
the100rabh741 views
Intro to Apache Storm by David Kay
Intro to Apache StormIntro to Apache Storm
Intro to Apache Storm
David Kay353 views
BWB Meetup: Storm - distributed realtime computation system by Andrii Gakhov
BWB Meetup: Storm - distributed realtime computation systemBWB Meetup: Storm - distributed realtime computation system
BWB Meetup: Storm - distributed realtime computation system
Andrii Gakhov1.5K views
My lecture stack_queue_operation by Senthil Kumar
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operation
Senthil Kumar1.4K views
Introduction to clojure by Abbas Raza
Introduction to clojureIntroduction to clojure
Introduction to clojure
Abbas Raza1.4K views
Modern Java Workshop by Simon Ritter
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
Simon Ritter252 views

Recently uploaded

Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 views21 slides
Melek BEN MAHMOUD.pdf by
Melek BEN MAHMOUD.pdfMelek BEN MAHMOUD.pdf
Melek BEN MAHMOUD.pdfMelekBenMahmoud
14 views1 slide
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
127 views17 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
263 views86 slides
Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
53 views38 slides
Zero to Automated in Under a Year by
Zero to Automated in Under a YearZero to Automated in Under a Year
Zero to Automated in Under a YearNetwork Automation Forum
15 views23 slides

Recently uploaded(20)

PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada127 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 views
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex22 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta26 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10248 views

Storm introduction

  • 1. Apache Storm A Brief Introduction
  • 2. What Is Storm ● Distributed ● Stream Oriented ● Real Time* ● Scalable ● Reliable**
  • 3. Topologies ● Storm’s equivalent of an application ○ Consists of Components (Spouts and Bolts) ■ parallelism ■ Data represented as streams of tuples
  • 4. Spouts ● Spouts ○ Expose an external input source ■ An unbounded stream of data ○ Are polled, by storm, for their next Tuple ○ Produce one or more streams of Tuples ○ Notified when a Tuple is completely processed ○ Notified when a Tuple fails to be processed
  • 5. Bolts ● Bolts ○ Subscribes to one or more Streams ■ Grouped by all, randomly, or by Field values ○ Produces zero or more Streams ○ Single threaded execution per instance
  • 6. An Example Classic word count: Lets assume we have an unbounded incoming stream of sentences and we want to have a constantly updated count of the words found in the text. Code: https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/WordCountTopology.java
  • 7. Building a topology We provide a description of the topology to be deployed via the fluent TopologyBuilder class. TopologyBuilder builder = new TopologyBuilder();
  • 8. Spout First we’ll create a spout to generate random sentences and add it to the topology public class RandomSentenceSpout extends BaseRichSpout { … public void nextTuple() { String[] sentences = new String[]{ "the cow jumped over the moon", "an apple a day keeps the doctor away", "four score and seven years ago", "snow white and the seven dwarfs", "i am at two with nature" }; String sentence = sentences[_rand.nextInt(sentences.length)]; _collector.emit(new Values(sentence)); } … } builder.setSpout("spout", new RandomSentenceSpout(), 5);
  • 9. Split Messages Next we’ll split each item into words. The example is in python, here it is in Java: public static class SplitSentence extends BaseBasicBolt { ... public void execute(Tuple tuple, BasicOutputCollector collector) { String sentence = tuple.getString(0); for (String word : sentence.split(“s”)) { collector.emit(new Values(word)); } } ... } builder.setBolt("split", new SplitSentence(), 8).shuffleGrouping("spout");
  • 10. Count Words Now we can count the words public static class WordCount extends BaseBasicBolt { Map<String, Integer> counts = new HashMap<String, Integer>(); public void execute(Tuple tuple, BasicOutputCollector collector) { String word = tuple.getString(0); Integer count = counts.get(word); if (count == null) count = 0; count++; counts.put(word, count); collector.emit(new Values(word, count)); } ... } builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));
  • 11. Discussion ● Component Lifecycle Events ● In Memory State ● Deployment view
  • 12. Ecosystem ● Trident ● SummingBird