2 Replies Latest reply: Sep 9, 2013 2:52 PM by Ricardo Ferreira-Oracle RSS

    Difference between CQC vs MapListener with Filter

    user10714864

      Can someone please explain how is a  Continuous Query Cache(CQC) different than a MapListener with a filter?

      On the same note, please elaborate on use cases where CQC is a right-fit vs MapListener (with filter)?

       

      Thanks in advance.

        • 1. Re: Difference between CQC vs MapListener with Filter
          user10714864

          Any inputs/suggestions on this one, please?

          • 2. Re: Difference between CQC vs MapListener with Filter
            Ricardo Ferreira-Oracle

            Using listeners (with or without filters) is a way to react over data changes in the client application, allowing it to invoke actions in response of some changes. The basic idea is in the end, execute custom code based on the events, instead of manipulate the dataset.

             

            CQC in the other hand is a technique to materialize a keySet() in the client application in a such way that this keySet() is continuously updated automatically by Coherence, based on the delta of which resides in the client application and in the data grid storage. When you materialize a keySet() in the client application, the list of keys are stored continuously in the application heap memory, and grows at the same pace that the data grid grows, considering of course that the filter criteria has been satisfied.

             

            So the basic difference is the statefulness of the scenario: using CQC, you have the whole window of keySet() to work with, using listeners, the only keySet() available to work with is that of the current event triggering, after that they are disposed. Some CEP implementations like Oracle Event Processing should benefit of materialized keySets() in order to apply event constructions like temporal constraints, for instance: SELECT someData FROM eventChannel RANGE 60 MINUTES SLIDE 5 SECONDS.

             

            Cheers,

             

            Ricardo Ferreira