Goal: Stop the request process if a service is not working
refs: Services Heartbeat & Service Discovery
It has to do the following:
- Know when service doesn't work ( Services Heartbeat )
- Add / Close connection ( control the Service Discovery )
How it Works?
It has three modes for access control of successful / failing service
Closed
- when normally requests goes -> closed switch (allow requests)
- if requests above treshold (ex: 75% of requests fail in time window) -> open switch (disallow requests)
Open
- disallow requests (just deny - 500-599 Server Error)
Half Open
- After intervals, let x requests pass through & measure
- If most pass -> Closed (re-allow)
- if most still fail -> keep open (disallowed)