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.

The Master Worker Pattern

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.

Enjoy!

Shay Hassidim

The Master-Worker Pattern
Shay Hassidim
Deputy CTO @ GigaSpaces
Shay joined GigaSpaces in 2003, and has more than 20 years of experience in the software industry. Shay is part of the product leadership team and oversees the technical activities of the US operations, serving as Deputy CTO Distinguished engineer, escorting the pre-sale and post-sale activities.