concept Trident in category storm

This is an excerpt from Manning's book Storm Applied: Strategies for real-time event processing.
Spark Streaming works an unbounded stream of data like Storm does. But it’s different from Storm in the sense that Spark Streaming doesn’t belong in the stream-processing category of tools we discussed earlier; instead, it falls into the micro-batch-processing tools category. Spark Streaming is built on top of Spark, and it needs to represent the incoming flow of data within a stream as a batch in order to operate. In this sense, it’s comparable to Storm’s Trident framework rather than Storm itself. So Spark Streaming won’t be able to support the low latencies supported by the one-at-a-time semantics of Storm, but it should be comparable to Trident in terms of performance.
In this chapter we’ll introduce Trident, the high-level abstraction that sits on top of Storm’s primitives, and discuss how it allows you to express a topology in terms of the “what” instead of the “how.” We’ll explain Trident within the context of a final use case: an internet radio application. But rather than start with the use case as we have in previous chapters, we’ll start by explaining Trident. Because Trident is a higher-level abstraction, we feel understanding that abstraction before designing a solution for the use case makes sense, as that understanding may influence the design for our internet radio topology.
This chapter will start with an explanation of Trident and its core operations. We’ll then talk about how Trident handles streams as a series of batches, which is different than native Storm topologies, and why Kafka is a perfect match for Trident topologies. At that point we’ll break out a design for our internet radio application followed by its associated implementation, which will include Storm’s DRPC functionality. Once we have the implementation, we’ll discuss scaling a Trident topology. After all, Trident is simply an abstraction that still results in a topology that must be tweaked and tuned for maximum performance.
Without further ado, we’ll introduce you to Trident, the abstraction that sits on top of Storm’s primitives.
Trident is an abstraction on top of Storm primitives. It allows you to express a topology in terms of the “what” (declarative) as opposed to the “how” (imperative). To achieve this, Trident provides operations such as joins, aggregations, groupings, functions, and filters, along with providing primitives for doing stateful, incremental processing on top of any database or persistence store. If you’re familiar with high-level batch-processing tools like Pig or Cascading, the concepts of Trident will be familiar to you.
This is where Trident helps. With its various concepts of “join,” “group,” “aggregate,” and so forth, we express computations at a higher level than bolts or spouts, making it easier to understand what’s being done. Let’s show what we mean by taking a look at a Trident version of the GitHub commit count topology. Notice how the code is expressed more in terms of the “what” we’re doing rather than “how” it’s being done in the following listing.
Once you understand Trident’s concepts, it’s much easier to understand our computation than if we expressed it in terms of spouts and bolts. Even without a great deal of understanding of Trident, we can see that we
create a stream coming from a spout, and for each entry in the stream
, we split the field commit into a number of email field entries, group like emails together
, and persist a count of the emails
.
create a stream coming from a spout, and for each entry in the stream
, we split the field commit into a number of email field entries, group like emails together
, and persist a count of the emails
.