0
votes

We are looking into validating address information in house for both security concerns and performance reasons. My first intuition is build a *nix box with postgres sql on a separate physical machine. Because the information needs validation in almost real-time, what should I consider?

As a side concern, what should I consider in obtaining and updating mailing address information? I know there's a few providers out there that can assist, but we are trying to avoid submitting requests over WWW for privacy concerns.

3
  • 3
    Please be more specific: Do you mean physical mailing address, or email address? Do you mean validation as in "conforms to a specification", or "the intended recipient will actually get a message sent here"? etc...
    – voretaq7
    Jun 15, 2012 at 17:07
  • What I meant by Mailing address was physical mailing address. Jun 15, 2012 at 18:23
  • While this is an interesting question, it's fundamentally off topic for SF (it's really a programming question and doesn't have much to do with System Administration) so I'm going to close it as such. Check out the Stack Overflow question I linked to in my answer though - there are a few other questions/answers over there which might help point you in the right direction...
    – voretaq7
    Jun 15, 2012 at 19:41

1 Answer 1

1
vote

Validating physical mailing addresses is HARD --It's even harder than validating email addresses.

To illustrate some of the complexity, the USPS will accept all of the following:

John Smith
1313 Fake Street, APT 0
Anytown, NY, 12345-6789

John Smith
1313 Fake Street
Apartment 0
Anytown NY 12345

Mister Smith
1313 Fake Street
APT 0
Anytown NY

as valid addresses (though the first is the closest to their ideal, and the last will piss them off as lacking a ZIP code it has to be hand-coded by someone to get where it's going)

Your best bet is to hand off the address validation - for example to the USPS address validation API. The interactive consumer interface on the USPS web site will even offer to fix up and standardize addresses for you so they match the USPS Ideal Address Format, and I assume that their API has similar functionality.

StackOverflow had a question on this very subject -- it may help you out.

2
  • Yeah, it was a close call between SF and SO. I was trying to take from the stand point of a DBA as opposed to a developer because what we have is essentially a DB of addresses with separated fields (street 1, street 2, city, etc.) that must be validated after a certian period of time, so formating wouldn't exactly be as much of an issue. But yes, I suspected that this wouldn't be so easy. Thanks for pointing out the SO post. Jun 15, 2012 at 19:52
  • @hydroparadise Yeah, it would really be OT for DBA as well because the core question is how to validate the address programmatically - though once you know the answer to that if your DB is flexible like Postgres you could use a DB trigger to do the validation (insert long list of caveats about using network resources in a trigger here)
    – voretaq7
    Jun 15, 2012 at 20:02

Not the answer you're looking for? Browse other questions tagged .