I am new to using temporal and gone through couple of articles but were not able to find desired answer.
Let’s take below example
Create product using REST API and persist to DB, respond with product created immediately
Sync above created product data asynchronously to other 2 external services (We can add more services later on to sync same data)
How can we guarantee using temporal that product is synced to all the services eventually.
If one or more service fails (due to network or bug) to sync this data to external service then how can we guarantee that, it will retry again in future (say after we fix the bug in syncing logic)
What I want that eventually product state should be same in all the services as in DB.
In traditional way we can use outbox pattern with kafka and debezium. Until we consume kafka event and ack service is going to retry to sync it to external service.
Other approach might be to have scheduler which keeps track of product version and make sure same version is present in all the services (this can be done by keeping track of updated_at in product table and say integration table where we keep track of updated_at for all services) and if not then try to sync it again.
Wondering how this can be achieved using temporal, as I have seen in couple of blogs that kafka is not needed if we are using temporal
ok thanks, I was thinking of having it separate method so that if activity fails and say service 1 is completed then it should restart from service 2 sync and not try to re-sync service 1. Does that also mean each sync service should be in its own activity?