I am working on one migration engine to migrate data from older system to newer system. it is divided into 3 steps.
- first getting the data from older tables.
- prepare the request body to insert into new tables via APIs
- post processing steps.
Which design pattern to use here?
I was thinking of using builder pattern
In the second step where i am doing multiple API calls for inserting data into new tables. this has some order. If API call fail in between then need to redo all previous API calls. kind of rollbacking mechanism. How can i achieve that?
I think you might want to go for a Pipe-Filter Pattern here as an overall design. What you describe is pretty much described here.