circuit breaker pattern - a rpi proxy that immediately fails invocations if the number of errors exceed a certain threshhold...

in synchnous request when the client thread is blocking(imperative programming language like java) wating for response, latencies in response can casue a cascading failure,

as the threads making blocking calls will get stuck...,also if any db locks are held, then 

ensure

1> there is well defined network timeout..this will ensure resources are not tied up indefinetly...

2> configure max concurrent requests a service can make to another service,

      if more attempts than that come,, they must fail immediately...

3> track success and error rate, and if error rate exceed a threshhold, trip circcui breaker so that futher requests fail immediately...

netflix hysterix implenet this pattern, (java) , this is done using a rpi proxy

 

in addition what to with error also has to be determined

1> error can be returned to user

2>default value

3> previously cached value can be returned..

4> if the response is being composed from multiple responses, getting a response may not be critical, eg recommdandation on e commerce page 

     even if recomendation service fails still processing could happen