Quite often a bug in a client might trigger/replay unwanted messages and mess up with your database. It also might increase the fault tolerance of your service. Most of those queues might deliver the same message twice. If you are using queues for communication between services (like SQS, Kafka, RabbitMQ, etc.), I personally recommended you make your operations Idempotent. Instead of designing your participants to reply to a fixed address, consider sending the reply address within the message, this way you enable your participants to reply to multiple orchestrators. By using a transaction Id, for instance, Delivery Service could ask Stock Service where to pick up the products and double check with the Payment Service if the order was paid. Having a unique identifier for each transaction is a common technique for traceability, but it also helps participants to have a standard way to request data from each other. Saga Pattern Tips Create a Unique Id per Transaction However, this approach still has some drawbacks, one of them is the risk of concentrating too much logic in the orchestrator and ending up with an architecture where the smart orchestrator tells dumb services what to do.Īnother downside of Saga’s Orchestration-based is that it slightly increases your infrastructure complexity as you will need to manage an extra service. If you have a second transaction willing to change the same target object, you can easily put it on hold on the orchestrator until the first transaction ends.The transaction complexity remains linear when new steps are added.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |