9 Comments

thanks Saurabh for writing this. huge thanks

Expand full comment
author

Happy to share Ashwani!

Expand full comment
Mar 13Liked by Saurabh Dashora

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?

Expand full comment
author

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.

Expand full comment
Apr 10Liked by Saurabh Dashora

Thanks a lot Saurabh!

Expand full comment
Mar 12Liked by Saurabh Dashora

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! 🤝

Expand full comment
author

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...🙂

Expand full comment
Mar 13Liked by Saurabh Dashora

Thanks for clarifying this and helping me grow! 😊

Expand full comment

Circuit Breaker pattern provides Fault Tolerance. I used Resilience4j in one of my projects to implement circuit breaker.

Expand full comment