Monday, October 19, 2009

"Event-Based" and "Map-Reduce" Pattern

Two patterns we will be discussing in class tomorrow are "event-based, implicit invocation" and "map-reduce". The event-based pattern is a little light on details, but is straightforward enough. In this pattern, there are:

  • components acting as announcers (posters of events) and/or listeners (subscriber of events)
  • a medium which acts as communication fabric hooking together announcers and listeners

With this pattern, one of the keys is that announcers are not aware of which listeners (if any) are present. This combined with the asynchronous nature of the system makes for a great architecture. However, I think that implementing the "medium" is a non-trivial task that is somewhat glossed over.

The other pattern, map-reduce, is another fairly simple pattern. The concept is that you have a map function that can be applied concurrently to all objects in a given set and then the results of each operation are reduced through a reduction function. This is an excellent pattern for problem domains that fit as the only thing that really has to be done is the creation of the map function and the reduction function. I would be interested to see some actual implementations of this pattern and see how well they scale as object counts increase. In naive implementations, I think there could be some potential lock contention scalability issues with the task queue and repository perhaps?

No comments:

Post a Comment