EdwinVW/pitstop

Deletion of resources

Urgen-Dorjee opened this issue · 1 comments

I have kind of a question, suppose I try to delete a customer from customermanagementapi service, should this service publish an event and delete the related customer's data from workshopmanagment database or they are not related in terms of record deletions.

Without customer data in master table in customermanagementapi, is it an appropriate approach to keep customer's data in workshopmanagment database?. If it is yes then shouldn't this introduces data inconsistency?

Thanks!

Yes, I would publish an CustomerDeleted event so any other services that cache customer data can do with this event what they want. Maybe the other services delete the customer data. But it could also be the case that they only mark the customer as "inactive" and don't actually delete the data because they still need it (for some functionality or for historic analysis or ...). But this is up to the service that ingests the event.

And yes, this introduces some form of inconsistency (often referred to as eventual consistency). The system-of-record for customer data is the CustomerManagementAPI and there the customer should be deleted. Every other service that keeps caching the customer data, should always store some indication that the customer data is no longer valid because it was deleted in the system of record.