How an address gets checked
Most of the work in checking an address happens before the lookup, and most of the value is in refusing to collapse the answer into a yes or a no.
Key takeaways
- Normalise case, spacing, abbreviations and field order before any lookup.
- Four outcomes: exact, formatting-only difference, near-match, and not found.
- Not found is not invalid. The distinction is the whole system.
- Cache by normalised address; the same addresses recur constantly.
- A lookup failure is not a validation failure and must never block anything.
Normalise first
typed 14 chestnut rd, ashford, kent, tn248ql
normalised line1: 14 Chestnut Road
town: Ashford
county: Kent (dropped for lookup)
postcode: TN24 8QL
changes case, ’rd’ expanded, postcode spaced,
county ignored (it is not part of the identity)
The county line is worth noting. In many postal systems it is decorative — the postcode identifies the delivery point completely — and including it in a lookup produces misses when somebody writes a historic county name. Dropping it for the lookup and preserving it in what is stored is the right handling.
Four outcomes
- Database
- App integration
- Machine learning
- Management
- Analytics
Not found is not invalid
This is the distinction the whole system rests on and the one a boolean destroys. An address the reference file does not contain might be wrong, and might be a house built last year, a converted barn, a flat above a shop that has never been separately registered, or an address written the way the occupant writes it rather than the way the file records it.
Storing four outcomes rather than two means the warehouse can treat an unverified address differently from a verified one without anybody having been refused, and it means the background sweep can distinguish addresses worth asking about from addresses that simply are not in the file.
Lookup failure is a fifth case
The reference service will occasionally be slow or unavailable, and the correct behaviour is completely uncontroversial: proceed, record the address as unchecked, and let the sweep pick it up later. A checkout that fails because a validation API timed out is a self-inflicted outage, and it is a surprisingly common one.
Caching
- Machine learning
- Security & identity
- Management
- Analytics
Keying the cache on the normalised address rather than the raw string is what produces the high hit rate: three customers typing the same address three different ways all hit one cache entry. Keying on the raw string would produce a hit rate near zero and pay for the same lookup repeatedly.
A twelve-month expiry is generous and appropriate. Addresses do change — renumbering, postcode boundary changes — but rarely enough that a year-old cached answer is almost always still right, and the sweep in Part 5 catches the ones that are not.
Next: making a suggestion.
All posts