Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion of resources #39

Closed
Urgen-Dorjee opened this issue Sep 5, 2019 · 1 comment
Closed

Deletion of resources #39

Urgen-Dorjee opened this issue Sep 5, 2019 · 1 comment

Comments

@Urgen-Dorjee
Copy link

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!

@EdwinVW
Copy link
Owner

EdwinVW commented Sep 7, 2019

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.

@EdwinVW EdwinVW closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants