Parallel Query Setup

A description of how to configure parallel queries.

  1. Create a Sybase CEP Server cluster, consisting of two or more Sybase CEP Server instances running Container processes (preferably on different machines) all of which point to the same Manager URI.

    For more information about Containers and Managers, see "High Availability". For more information about configuring a Sybase CEP Server cluster, see "How to Configure Sybase CEP Server for High Availability".

  2. Set a multiple number of instances for the project you want to run.

    The project instances are duplicates of the project that run parallel to one another. When you run the project, Sybase CEP Server automatically starts the number of project instances you specify. If you are using Sybase CEP Studio, see the Sybase CEP Studio Guide for instructions on setting the number of project instances in the project's Properties View.

    Note:
    When you replicate a project in multiple instances, all data streams attached to the project are replicated too. Streams associated with each project instance have unique identifiers. To refer to a stream in a specific instance of the project, specify the Stream URI, with an additional ~ instance-number at the end of the URI, for example:
    ccl://localhost:6789/Stream/Default/TwoWindowJoin/ MsftTrades~2
    
  3. Use one of the Sybase CEP SDK to write and install an out-of-process adapter which partitions the incoming data and sends each partitioned set to an instance of the project.

    For information see the Sybase CEP Integration Guide .

    Alternately, you can partition data by explicitly publishing rows from queries in one project to data streams associated with specific instances of another project.

  4. Create another Sybase CEP Engine project and configure it to merge the data output from the parallel queries, as well as to perform any necessary operations on the merged data.
    Note: Since the data from the multiple instances of the parallel output stream comes from different machines, the merged data may be out of order. To order the data correctly, set the stream data timestamp to the current time, or allow the messages to come out of order, and set the maximum out of order delay. For instructions on setting data stream properties, see the Sybase CEP Studio Guide .