Question

Would NServiceBus or an equivalent ESB be appropriate for an application that has a bunch of different kinds of background maintenance-type tasks? For example:

  • Scanning databases for the occurence of certain words in user-generated content
  • Updating database tables that store the results of relatively expensive queries
  • Creating/maintaining external indexes for content
  • Sending event notification emails for a scheduled event.

My idea is to employ some kind of task scheduler (either the Windows builtin one, Quartz.NET, or my own database-based solution) to publish different kinds messages onto the bus periodically. The period may be as short as one minute or as long as a days. The reason I want to use the bus is so that I can scale out the number of subscribers as the system becomes larger and busier and the tasks become either more frequent or more resource-intensive. It would also provide redundancy as long as I always have at least two subscribers running.

The obvious alternative to this would be to write my own Windows Service that is triggered by the scheduler and performs the work, but I feel like making that scale beyond a single machine and provide fault tolerance might be more difficult than using the ESB as that plumbing.

Does this sound like a reasonable approach? Alternative suggestions?

TIA

Was it helpful?

Solution

As the author of NServiceBus, I'm quite probably biased, but there is a tradeoff between learning a new technology and writing (possibly a simpler version of) your own. I would recommend considering the longer term maintainance (and documentation) costs of your own solution as compared to one written in house.

In terms of the feature-set you described, NServiceBus does provide facilities for all of that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top