Search code examples
graphapache-stormdirected-acyclic-graphs

Can Storm topologies contain cycles?


I have been reading papers about Apache Storm recently. From what I understood it is based on Directed Acyclic Graph of operations and streams of data.

However, in Storm@Twitter it says:

Note that a Storm topology can have cycles.

How does it apply to the definition of DAG?


Solution

  • Storm doesn't prevent you from making cycles in your topology. Example:

    builder.setSpout("word", new TestWordSpout(), 10);
    builder.setBolt("exclaim1", new ExclamationBolt(), 3)
        .shuffleGrouping("word")
        .shuffleGrouping("exclaim2");
    builder.setBolt("exclaim2", new ExclamationBolt(), 2).shuffleGrouping("exclaim1");
    

    See also https://groups.google.com/forum/#!topic/storm-user/EjN1hU58Q_8. Cycles don't seem like a good idea, and I'd be surprised if they're commonly used.