Best Practice / Standard for storing an Address in a SQL Database

前端 未结 6 1731
忘掉有多难
忘掉有多难 2020-12-08 10:58

I am wondering if there is some sort of \"standard\" for storing US addresses in a database? It seems this is a common task, and there should be some sort of a standard.

6条回答
  •  鱼传尺愫
    2020-12-08 11:36

    First, the "best" means of storing an address depends greatly on how it will be used. Is it just for reference or searches on say city? Do you plan on addressing envelopes? Are you going to integrate with a shipping system like FedEx or UPS? Will you store non-US addresses? Once you get into the realm of integrating with something that ships, you should start looking at CASS. This is a specification for handling the USPS addresses. There are applications out there that are CASS certified which will store and verify addresses. Thus, the second best practice would be to try to avoid reinventing the wheel and see if there is a system out there that will solve your problem especially if you are going to go international. You want to leverage the fact that someone else has worked out all the details about how to properly and efficiently store addresses for many countries around the world instead of having to do that investigation yourself.

提交回复
热议问题