Video in progress
The same customer data has drifted apart across the CRM, billing and the main application database. How do you sort out data ownership and the "source of truth"?
Each data element gets one owning system: only it writes, and the others receive a copy through events and don't change it. The existing differences are closed with a one-time cleanup, and after that kept in check with field-level ownership rules and continuous reconciliation.
📖 Answer
The typical picture: the customer updated their phone in the app, an operator "fixed" the old number in the CRM, and billing is sending SMS to a third number. Each system considers itself right, because each one has write access.
- Ownership at the field level. "Customer" isn't one object:
- name, phone, email: the app (the user changes them themselves);
- plan, debt: billing;
- segment, account manager: the CRM.
If a system that isn't the owner needs to change something, it asks through the owner's API and doesn't edit its own copy.
-
Distribution. The owner announces a change with an event like
CustomerContactChanged(through an outbox or CDC), and the others keep a read-only copy. In external systems like the CRM, making these fields read-only in the UI isn't technical, but it's the most effective step. -
Identifier. One customer is
C-1923in the CRM and88112in billing. You need a globalcustomer_idand a mapping table between the system IDs; without it, no sync is reliable. -
Cleaning up the old mess. Find duplicates and conflicts: exact keys (email, phone) and fuzzy matching (name + date of birth). Automatic merge rules, and the unclear cases go to an operator queue. This is a one-time project, but without it the new rules are built on top of the old mess.
-
Continuous checking. Daily reconciliation: the number of differences between the owner and the copies is a metric with an alert. If the differences start growing, someone is writing around the ownership rule.
MDM (master data management) products promise all of this. Sometimes that's the right choice, but the main work isn't technology; it's agreeing with the business departments on "whose field is this". So I write it as an ADR, and every new integration is checked against that map.
Sign up to mark studied questions and save your progress.