Service selector

Along the same lines as a façade we have the service selector pattern. In this pattern we have a service which fronts a number of other services. Depending on the message which arrives, a different service could be selected to respond to the initial request. This pattern is useful in upgrade scenarios and for experimentation. If you're rolling out a new service and want to ensure that it will function correctly under load then you could make use of the service selector pattern to direct a small portion of your production traffic to the new service while monitoring it closely. Another application might be for directing specific customers or groups of customers to a different service. The distinguishing factor could be anything ...

Get Mastering JavaScript Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.