开发者

architecture question: how to programmatically throttle caller volumes in a service oriented architecture?

开发者 https://www.devze.com 2023-02-15 03:55 出处:网络
This is admittedly an open question. I\'ve seen the following story pla开发者_如何学Cy out enough times now, that I have to ask:is there a better way?

This is admittedly an open question.

I've seen the following story pla开发者_如何学Cy out enough times now, that I have to ask: is there a better way?

This story is when one team sets up their SOA-flavored service; other teams start calling it, or accidentally hammer it. Service falls over. And a negotiation ensues as to whether the caller should call less, or the callee should beef up their capacity to support the call volume.

It's a very manual, piecemeal negotiation.

Is there any literature out there on different approaches? One idea off the top of my head: a service owner would require "caller credits" (think currency, or permission slips) on the part of each caller. These credits would be issued by the service itself (or some adjunct ServieCallAdministrationService. Yeah, horrible name). In that manner, the service owner can better guarantee service quality by limiting their service volume?

Put another way: who should "own" this problem of managing overall service call volume? The service itself? Callers? Something else?


The best way to tackle this problem (in my opinion) is by using message oriented transport level (JMS, WebsphereMQ, MQMQ...)

In this case you have full control over handling the requests - and messages that can't be handled are just queued up. you can also easily add elements such as priorities, adding servers for scaling, etc.

Any way - the service provider is responsible for supplying the agreed SLA


You redis to monitor the call usage, and once you reach a limit you can return a specific error code about usage over the limit.

Redis has key expiration so you can expire the key after x minutes, and the service calls will work as usual.

"api-call-getUser:" + customerId


There are another ways to controll this. First one: you use one component in front of your service where you can define a policy how often one caller can call this services (IBM Datapowerbox or Oracle Web Service Manager has such functions built in). Second one: customer itself (if known) can set sendig limit in his client. This can be predefined with customer in one SLA.

0

精彩评论

暂无评论...
验证码 换一张
取 消