假设我有表:客户和订单,我想用不可更改的客户信息(如地址、姓名等)存储订单,但不想将所有这些信息复制到订单表。有三个选项:
a) Mapping table for base customers
orders
....
customer_id; link to the customers table
baseCustomer_id; link to the customers_base table
....
customers
id;
base_id; link to the base customers table;
....
customers_base
id
....
b) Versioning: (if new customer, create version 0 for base customer, and version 1 to have permament record)
orders
....
customer_id
customer_version
....
customers
id
version
....
c) Create a copy of customer info for each order and store it into the same table;
orders
....
customer_id
....
customers
id
....
copy_of; refers to the customers.id if null represents base customer entity
所以问题是:从数据库设计、可读性、实现复杂性等不同的角度来看,哪种方法更可取?