Wednesday, August 20, 2008

Service Request Workload

In order to improve our service's availability, we should put an upper limit on the workload that can be allocated to deserve a single request.

Take for example the real world 411 telephone directory service. The operator is instructed to accept looking up only one phone number for every received call. This is done to keep calls short, and to ensure that everyone gets a chance to be served. You would certainly not like your call to be queued behind Mr Smith's one, who would like to get the phone number of every student from his 1952 high school promotion.

In much the same way, we should design our service interfaces with the implied workload in mind. Maybe we should not return all of the catalog's items at once after all. We could rather require an item category to be chosen, and only return this subset among the original results. Or if such a natural division is not available, maybe our service's interface should include a pagination scheme.

This does not prevent any of our clients to get all the results they need: they stay free to issue as many service requests as they want. But it sure improves the service's availability for the other clients. After all, nothing prevents Mr Smith from getting all the phone numbers he wants by calling 411 all day long, but he won't prevent us from getting the line by hogging the service's resources.

No comments: