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.

closed as off topic by voretaq7 Jun 15 '12 at 19:41

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

locked by HopelessN00b Jan 22 '15 at 18:45

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.

Read more about locked posts here.

  • 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 '12 at 17:07
  • What I meant by Mailing address was physical mailing address. – Chad Harrison Jun 15 '12 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 '12 at 19:41

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
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.

  • 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. – Chad Harrison Jun 15 '12 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 '12 at 20:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.