Why a Common Name Breaks Naive Systems
Most early-stage apps treat the name field as if it were unique. The schema doesn't say so, but the code assumes it. A search box, an exact-match `WHERE` clause, a join on `customer_name`. It works in the demo. It stops working at roughly 10,000 users, usually during a billing incident.Consider two real records we handled: "mark allen" and "Mark Allen." Same normalized string, different people. Worse yet: "mark allen" and "Mark A. Allen." One is a SaaS subscriber in Boulder. The other is a vendor who submitted an invoice. Accounts payable paid the wrong one. The refund took six weeks.The failure is structural, not operational. Names were never designed to be identifiers. They're display strings for humans. Using them as keys puts your billing, support, and compliance systems on top of a fiction.The Identity Resolution Stack: From Exact Match to Fuzzy Merge
The first upgrade is string similarity. Levenshtein distance catches typos. Jaro-Winkler catches "Mark" vs "Marek". Postgres ships with `pg_trgm`, which gives you trigram similarity in a standard index. We use it for candidate generation only, not for final matches. The goal there is recall, not precision.Candidate generation feeds a scorer. The classic framework is Fellegi-Sunter, which weighs field-by-field agreement and disagreement to compute a match probability. You can read the [original Fellegi-Sunter paper](https://www.jstor.org/stable/2284061) and implement it yourself, or you can start with Python's `recordlinkage` library or Java's Duke. There's no magic here. It's Bayesian weight math.Fuzzy matching alone drowns in false positives, though "mark allen" and "mark eyllen" with excellent string scores could still be two different humans living in different states. You need more signals, and that's precisely what the scorer is for.Scoring Candidate Matches with Real Data
A good matcher never relies on the name alone. It aggregates attributes: normalized email, hashed phone number, date of birth, address components, device IDs, and support interaction history. Each field contributes evidence. None of them decides alone.We assign weights empirically. Email match is extremely high. Exact DOB plus exact name is also high. Address match alone is weak - roommates share addresses. These weights get tuned against a labeled golden set. Build one, or you're guessing at every threshold.Threshold selection is the hardest part of the entire pipeline. Set the bar too low, and your system merges two distinct mark allen accounts, creating a privacy violation. Set it too high, and duplicates snowball into split billing histories and double emails. In production, we found that a threshold slightly above the midpoint of the score distribution cut our manual review workload by 70% while keeping false merges under 0.5%.The False Positive Trap: When Your Backend Marries Two Strangers
Here's a concrete failure from our own audit logs. A customer named Mark Allen (the younger) shared an address with his father, also named Mark Allen (the older). Both used the same family email domain. The matcher saw identical surname, identical address, identical domain, and a minor first-name variance. It declared them one entity. The son's purchase history landed on the father's account.Undoing a bad merge is far harder than preventing one. The audit trail is messy. Support agents have already acted on the merged record. Refunds went to the wrong bank account. The fix isn't a database operation anymore - it's a customer relations crisis.The lesson: build an identity graph that keeps evidence per comparison. Every merge needs a reason code. Every reason code needs an expiration date. That's the difference between a matcher and a surveillance system.Deterministic vs. Probabilistic Identity Graphs
Deterministic rules are simple to explain: if email matches, merge. They're also brittle. Emails change. People hold multiple addresses. Data entry destroys consistency at the edges. Probabilistic systems handle variation gracefully but are harder to audit.We run a hybrid approach. Deterministic rules fire first for high-confidence fields - verified email, federated login subject identifiers, government IDs. Everything else flows through the probabilistic scorer. The output is a graph. Each node is a candidate record; each edge carries a match score. Connected components become customer entities.For graph computation at scale, we used Apache Flink's Gelly API. The same logic works in a simple breadth-first search from a Python script. What matters is that the graph is recomputable and versioned, because we rerun the whole thing whenever new data arrives.GDPR and Data Privacy Constraints on Entity Resolution
Matching records across datasets means moving personal data. Under GDPR, that's a processing activity with its own legal basis. You can't just join two tables because both contain a mark allen. The supervisory authority won't accept "we were cleaning up duplicates" as sufficient justification.Privacy-preserving techniques exist. Blind indexing hashes identifiers so exact matches happen without exposing raw values. Tokenization helps when you need reversible lookups for support tooling. And we follow data minimization strictly: resolve identity first, discard everything you don't need. The payloads themselves conform to [standard JSON structure in RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259), which makes them validatable and auditable.Don't overlook the consent problem, either. A second mark allen who never opted into cross-system tracking doesn't care about your matching accuracy. Your pipeline must respect suppression lists before it respects scoring weights.Testing Your Resolver With Adversarial Inputs
Identity matching code rots quietly. Change one normalization function, and suddenly "Mac Allen" and "Mark Allen" score higher than they should. Unit tests on isolated functions won't catch this. You need end-to-end tests with realistic name distributions and a negative control group.We generated a synthetic population using real name-frequency data, then injected variations: middle initials, suffixes, Unicode transliterations, empty strings, and the perennial CSV quirk where "Mark Allen" becomes "Allen, Mark". Property-based testing with Hypothesis caught edge cases that hand-written fixtures missed completely.Every test suite needs records that should never merge. Same name, different DOB, different verified ID. If your matcher merges those, your threshold is wrong, full stop.Production Lessons from Running Identity Pipelines
In production, we found that match-rate drift is the signal that matters most. If your pipeline merges 3% of records one week and 5% the next, something upstream changed. A normalization tweak, a new data source, or a bot attack injecting fake profiles.We alert on three metrics: merge rate, resolution rate, and manual review queue depth. All three are SLO-able. When the review queue stays full for more than a day, the business starts paying overtime for data cleanup that should have been automated.Backfills are another trap. Our pipeline consumed events from a Kafka topic, so we could rewind and reprocess with a new scoring model. If your identity system isn't replayable, you're not running a system. You're running a one-time migration script wearing production clothes. This ties directly into [data engineering best practices for event replay](/blog/data-engineering-best-practices) that we cover elsewhere.The Future: Vector Embeddings for Semantic Identity Matching
Embeddings promise dense representations of identity fragments. You encode a customer profile, compute cosine distance, and merge near neighbors automatically. In our experiments, embeddings handled name variations and misspellings gracefully. The false positive rate on our small mark allen test set, however, stayed stubbornly high.The reason is subtle. Embeddings capture semantics, and identity is not semantics. Two people with similar names, addresses, and purchasing behavior are semantically close. That's the exact opposite of what a unique identity needs. We now keep embeddings as a candidate generator, never as the final adjudicator.The verdict from the field: deterministic exact matches plus probabilistic scoring plus human-in-the-loop review still outperform pure ML approaches for most companies. That will change eventually. It hasn't yet.Frequently Asked Questions
Q: Is "mark allen" a security risk?A: Not by itself. The risk appears when ambiguous identity lets an attacker claim support access to a merged account, or when a bad merge leaks another person's data to an unrelated caller. Matching logic is an access control frontier.Q: Can I use email as the identity key?A: No. Emails change, get abandoned, and get reused. They're a strong matching signal but a weak immutable key. Use a surrogate UUID generated at registration, and keep email as evidence, not as the primary key.Q: What's the best open-source tool for identity resolution?A: For batch work, Python's `recordlinkage` library works well. Zingg and Duke (Java) handle larger scale. None of them replace a thoughtful scoring model and a labeled golden set built from your own data.Q: How do I handle privacy laws when matching records?A: Start with data minimization. Hash identifiers at rest, blind index for exact matches, suppress records on opt-out, and document the legal basis for every data flow. RFC 8259-compliant JSON payloads make your audit trail much easier to produce.Q: Should names ever be a primary key?A: Never. Ask anyone who has paid an invoice to the wrong mark allen. Names are display strings. Treating them as keys converts a common name into a production incident waiting for a timestamp.What do you think?
Have you ever found two distinct customers with the same name merged in production, and how did you untangle the records without losing audit history?
Do you agree that deterministic rules should always outrank probabilistic scoring for high-confidence fields like verified email, or does that enforce stale identity data too aggressively?
If vector embeddings can't solve semantic identity matching today, what research direction - behavioral biometrics, device graphs, or something else - actually cracks the common-name problem for good?
Need a Custom App Built?
Let's discuss your project and bring your ideas to life.
Contact Me Today →