Mysql – Is it a good idea to use a personal number as a primary key for a customer table

database-designforeign keyMySQLprimary-key

We are designing a new system to handle customers at our firm and me and another developer are split on wether we should use the customers personal numbers as a primary key. My preference would be to auto increment a unique id (int) for each new customer.

Currently all customers we add do have a personal number but are there any good examples of why this may be a good or bad implementation?

One argument is that using an incremental id would simply add an extra field which is unnecessary and take up more space.

The personal number is stored as a varchar and the customer table holds close to a million customers. The personal number or id would be added as a foreign key for orders and customer support requests.

How do I know whether these are good or bad implementations? How would I argue either side?

Best Answer

Some good criteria for choosing or designing keys are: Simplicity, Stability and Familiarity but first you need to understand the fundamental business requirement your key is supposed to address. Ask yourself how you intend to identify customers in your business processes. Assuming you have a requirement to identify customers and Customer Number is the means your business will use to do that then it makes perfect sense as a key in your customer table - not necessarily the only key, but certainly a key of that table.