Thanks Saurabh! I have used API Gateway (Ocelot) to map a standard URL API (of the gateway), which the calling systems will use, to the actual APIs residing on diff locations using a json mapping. How exactly is this different from Service Discovery? Are these 2 different or is there a real-world scenario where they can complement each other?
Hi Arvind...service discovery is complementary to API Gateway.
Service discovery is used to locate and connect to instances of services dynamically without worrying about IP addresses or hostnames. This is useful in environments where service instances can go down (like pods in Kubernetes or containers) and new instances are automatically created.
Each instance registers with the service discovery system. The API Gateway can act as an entry point for clients with a standard URL and internally use service discovery to route the requests to specific instances.
Thanks Saurabh! I never used a Circuit breaker (not a microservice guy myself 😃).
Are the Circuit Breaker and the proxy the same components? So the purpose of the Open state and returning a default response is only to not ping the server that's already down with requests that will most likely fail, correct?
Thanks for mentioning my writing, glad you enjoyed it! 🤝
A circuit breaker prevents cascading failures in downstream apps by not hitting them with more requests when they are failing. Also, you can hook into the circuit breaker and specify a fallback (like returning some hard-coded data if possible) to give a good user experience.
Also, happy to share your article as I felt it was very relevant for many folks...🙂
thanks Saurabh for writing this. huge thanks
Happy to share Ashwani!
Thanks Saurabh! I have used API Gateway (Ocelot) to map a standard URL API (of the gateway), which the calling systems will use, to the actual APIs residing on diff locations using a json mapping. How exactly is this different from Service Discovery? Are these 2 different or is there a real-world scenario where they can complement each other?
Hi Arvind...service discovery is complementary to API Gateway.
Service discovery is used to locate and connect to instances of services dynamically without worrying about IP addresses or hostnames. This is useful in environments where service instances can go down (like pods in Kubernetes or containers) and new instances are automatically created.
Each instance registers with the service discovery system. The API Gateway can act as an entry point for clients with a standard URL and internally use service discovery to route the requests to specific instances.
Thanks a lot Saurabh!
Thanks Saurabh! I never used a Circuit breaker (not a microservice guy myself 😃).
Are the Circuit Breaker and the proxy the same components? So the purpose of the Open state and returning a default response is only to not ping the server that's already down with requests that will most likely fail, correct?
Thanks for mentioning my writing, glad you enjoyed it! 🤝
Yes, you are correct Akos.
A circuit breaker prevents cascading failures in downstream apps by not hitting them with more requests when they are failing. Also, you can hook into the circuit breaker and specify a fallback (like returning some hard-coded data if possible) to give a good user experience.
Also, happy to share your article as I felt it was very relevant for many folks...🙂
Thanks for clarifying this and helping me grow! 😊
Circuit Breaker pattern provides Fault Tolerance. I used Resilience4j in one of my projects to implement circuit breaker.