dimanche 23 juin 2019

Store and forward design pattern with multiple instances of a microservice

I am designing a service that will be receiving requests which must only be executed exactly once (can be received more than once due to unique id presence).

The flow is:

outside world -> HTTP -> [A set of instance of Myservice] -> HTTP -> Vendor services

So, I am receiving a bunch of requests over HTTP and I am looking to do some transformation, checking, store the request in a database and send to to the vendor services via HTTP too.

My question is:

What is an effective way to achieve a store and forward pattern in my service i.e. receive the request and store it immediately, therefore acking it to the "outside world" immediately and then in my own time forward it to the destination service, retrying as many times as needed?


Problems:

  • What if one of the instances of myservice goes down while it is sending the request to the vendor service?
  • How will I monitor if there are a bunch of request that have not been forwarded?
  • How to avoid another orchestration service?
  • How to avoid another single instance service that is effectively watching the database and forwarding any requests that have not been forwarded.
  • How to minimise external dependencies - e.g. I am aware some sort of queue here might help this issue, but I am trying to see if I can avoid that.

Aucun commentaire:

Enregistrer un commentaire