I'm having to implement operations on a repository-like class that needs to maintain consistency between a local database and external(third party) APIs. Some of those API may only offer partial success/partial failure semantics(i.e. non atomic) for some operations. However, I'd like to make sure the operations I implement do have atomic/transactional semantics, such that e.g. I only update my database if the request to the API succeeded, and whatever ends up in that external service is also replicated in the database.
Are there any useful patterns to deal with that, or other pointers on how to solve that kind of problem?
Thanks!
Aucun commentaire:
Enregistrer un commentaire