The Master-Worker Pattern (sometimes called Master-Slave pattern) is used for parallel processing. It follows a simple approach that allows applications to perform simultaneous processing across multiple machines or processes via a Master and multiple Workers.
In GigaSpaces XAP, you can implement the Master-Worker pattern using several methods:
– Task Executors – best for a scenario where the processing activity is collocated with the data (the data is stored within the space as the tasks being executed).
– Polling Containers – in this case the processing activity runs in a separate machine/VM from the space. This approach should be used when the processing activity consumes a relatively large amount of CPU and takes a large amount of time. It might also relevant if the actual data required for the processing is not stored within the space, or the time it takes to retrieve the required data from the space is much shorter than the time it takes to complete the processing.
The Master-Worker Pattern page on the Solutions and Best Practices documentation section includes details how to implement the Master-Worker pattern using polling containers.