I have a question as to which design pattern should be used. We have a background job which pulls data from a third party service. This third party service often goes under maintenance(throws 503). I want to store this outage notification to show my users, so that it will be visible, when they log-in to web site which calls web-api, to see the data. This site can also be used to make other calls to the third party application. So, if that the call to third party is successful then I want to remove the message from the site.
Inserting the outage message is simple but if I receive success call removing is a challenge, as there can be multiple success calls and I don't want to make the same number of Db calls.
Also, for every request, I will have to make db call to find out if there is an outage, only after that I can make attempt to remove it.
Since it is a web-api, I was wondering if I can reduce the number of DB calls, so that not all request have to perform the same DB calls
Aucun commentaire:
Enregistrer un commentaire