Remember, business goals are rarely about having a top-notch system!
Finally, we have arrived at the point where we can discuss the pinnacle of modern software architecture: microservices.
This article is part of the serie: distributed-systems
Even the simplest distributed system – yes, even integrating against a single API – can pose significant challenges (more than 80% of solutions that SMEs have). Mind-blowing, right!?
We started our distributed systems series by showcasing the dangers that 6 little lines of code can pose in a fairly simple system. Today, we kick off with the simplest distributed system that can exist - integrating against an API, and we delve into all the complexities that such a simple scenario can introduce.
So make sure to check out Udi Dahan’s insightful talk here:
Advanced API and Integration Problems & Patterns - Udi Dahan - NDC Oslo 2022 - YouTube
Below is a quick summary of what you can expect to take away from the given talk…
Today’s journey starts with handling failures. As we see, when the system is under load, longer response times and timeouts become a possibility. Automated retries can easily result in duplicates being created.
So, we need to handle duplicates. We can de-duplicate on the API side (idempotency), but what about legitimate duplicates? Not all duplicates are errors, life is not ideal! Also, what about the client side? What if the user unintentionally creates a duplicate (double-click and cache issues)? What if the user wants to create a duplicate?
The problem of duplicates escalates when integrating with other systems, where, based on one of the data (id), other events and external processes are started. Deciding which entity is the duplicate and which one to delete isn’t straightforward anymore!
Detect duplicates (API side):
Detect/avoid duplicates (client side):
Long chains of API calls can lead to latency issues. Are there other alternatives!?
⚠️ Now, before considering Microservices, think about scaling up.
💡 Here’s my article on Linked In about 10 scaling-up possibilities before considering microservices - also available here.
Microservices bring a couple of issues, such as:
Messaging might help, but:
As it’s showcased, building even simple systems can be challenging, and when it comes to integration, extra care is needed.
We hope that now, with this knowledge and these patterns in your arsenal, you’ll be well on your way to building robust and efficient enterprise software solutions!
📌 Make sure you and your team subscribe (follow me) on LinkedIn so you don’t miss out on the latest insights!
Remember, business goals are rarely about having a top-notch system!
Finally, we have arrived at the point where we can discuss the pinnacle of modern software architecture: microservices.