Stream - (Stream|Event) Processing

1 - About

Something happened (Event), subscribe to it (Streams)

3 - Problems

A messaging system is a fairly low-level piece of infrastructure—it stores messages and waits for consumers to consume them. When you start writing code that produces or consumes messages, you quickly find that there are a lot of tricky problems that have to be solved in the processing layer.

Consider the counting example, above (count page views and update a dashboard).

  • What happens when the machine that your consumer is running on fails, and your current counter values are lost? How do you recover?
  • Where should the processor be run when it restarts? What if the underlying messaging system sends you the same message twice, or loses a message? (Unless you are careful, your counts will be incorrect.)
  • What if you want to count page views grouped by the page URL? How do you distribute the computation across multiple machines if it’s too much for a single machine to handle?

Stream processing is a higher level of abstraction on top of messaging systems, and it’s meant to address precisely this category of problems.

See Samza is a stream processing framework that aims to help with these problems.

4 - Implementation

Queue:

  • Multiple input processor

Routing:

  • Category variable

Processor selection through:

  • Category variable
  • Data Type

Structure Flow:

  • Flow Content + Json Object for extra attributes (Ex: ResultSet + TestId)

Loop through an explicit processor (ie if and then go to step N) ?

  • Lazy instantiation: The operations are performed with an execute() call. Whether the program is executed locally or on a cluster depends on the type of execution environment. The lazy evaluation lets construct execution plan that may differ from the lexical (code) definition.

It is our firm belief that in the future, the majority of data applications, including real-time analytics, continuous analytics, and historical data processing, will treat data as what it really is: unbounded streams of events. Kostas Tzoumas (data Artisans raises a Series A Posted on March 30, 2016)

5 - Software

  • Apache Samza: LinkedIn stream processing framework that provides powerful, reliable tools for working with data in Kafka. (LinkedIn created Apache Kafka to be the data exchange backbone of its organisation.) See StreamTask
  • Apache Storm team (Yahoo!)
  • Apache Spark (Micro batch)
  • Apache Flink
  • Java Stream (Map reduce implementation, only one source then)
int sum = widgets.stream()
                      .filter(b -> b.getColor() == RED)
                      .mapToInt(b -> b.getWeight())
                      .sum();

6 - Documentation / Reference

  • Bookmark "Stream - (Stream|Event) Processing" at del.icio.us
  • Bookmark "Stream - (Stream|Event) Processing" at Digg
  • Bookmark "Stream - (Stream|Event) Processing" at Ask
  • Bookmark "Stream - (Stream|Event) Processing" at Google
  • Bookmark "Stream - (Stream|Event) Processing" at StumbleUpon
  • Bookmark "Stream - (Stream|Event) Processing" at Technorati
  • Bookmark "Stream - (Stream|Event) Processing" at Live Bookmarks
  • Bookmark "Stream - (Stream|Event) Processing" at Yahoo! Myweb
  • Bookmark "Stream - (Stream|Event) Processing" at Facebook
  • Bookmark "Stream - (Stream|Event) Processing" at Yahoo! Bookmarks
  • Bookmark "Stream - (Stream|Event) Processing" at Twitter
  • Bookmark "Stream - (Stream|Event) Processing" at myAOL
stream/processing.txt · Last modified: 2016/06/07 11:16 by gerardnico