Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一些实体,例如Order. 它可以具有状态属性,让我们用代码N来说明“新订单”的含义。还有另一个字典表包含所有这些订单状态值。如何为其设计数据库结构?我应该把什么放到卫星上?状态码?描述?或两者?
Order
N
将键/值结构建模为参考表
在原始数据库卫星中,保持状态“N”用于审计目的(您必须始终能够将数据返回给用户,就像您第一次获取它们时一样)。
如果您需要在业务库中应用一些业务规则,那么您可以将描述保留在业务库卫星中。