Master - Worker Pattern.
Master-worker pattern sounds like as layman terms split a work into multiple pieces and delegate each pieces to workers and gather all work results and send back to caller. If we want to implement in java, we can easily do it by multiple threads. But what about behind single node? what about availability? how we are going to address single point of failure? Master-Workers design pattern addresses all of these answers. From Martin Flower's Patterns of Enterprise Application,
"How, then, do you effectively use multiple processors? In most cases the way to go is clustering. Put all the classes into a single process, and then run multiple copies of that process on various nodes. That way, each process uses local calls to get the job done and thus does things faster. You can also use fine-grained interfaces for all the classes within the process and thus get better maintainability with a simpler programming model.”
A master is always one node and workers can be multiple nodes and Master controls job queue and creates set of tasks, put it in shared space and waits for workers to complete it.
here is good article about Master-Worker pattern http://www.theserverside.com/tt/articles/article.tss?l=DistCompute
"How, then, do you effectively use multiple processors? In most cases the way to go is clustering. Put all the classes into a single process, and then run multiple copies of that process on various nodes. That way, each process uses local calls to get the job done and thus does things faster. You can also use fine-grained interfaces for all the classes within the process and thus get better maintainability with a simpler programming model.”
A master is always one node and workers can be multiple nodes and Master controls job queue and creates set of tasks, put it in shared space and waits for workers to complete it.
here is good article about Master-Worker pattern http://www.theserverside.com/tt/articles/article.tss?l=DistCompute
Comments