What is the “best” way to store international addresses in a database?

后端 未结 6 536
梦如初夏
梦如初夏 2020-12-04 23:46

What is the \"best\" way to store international addresses in a database? Answer in the form of a schema and an explanation of the reasons why you chose to normalize

6条回答
  •  萌比男神i
    2020-12-05 00:21

    In general, you need to understand why you want an address. Is it for shipping/mailing? Then there is really only one requirement, have the country separate. The other lines are freeform, to be filled in by the user. The reason for this is the common forwarding strategy for mail : any incoming mail for a foreign country is forwarded without looking at the other address lines. Hence, the detailed information is parsed only by the mail sorter located in the country itself. Like the receiver, they'll be familiar with national conventions.

    (UPS may bunch together some small European countries, e.. all the Low Countries are probably served from Belgium - the idea still holds.)

提交回复
热议问题