是否有一个术语来描述只应使用最后一个值的表?

Is there a term to describe tables where only the last value should be used?

在我的数据库中有 table 每行代表一个实体,还有其他 table 同一个实体可以出现多次,但只有最新的条目是有效的一.

例如,我有一个 table customer ,其中每一行代表一个客户,另一个 table customer_membership_status 可以多次引用同一个客户,但是仅支持使用每个客户的最后一条记录。 customer_membership_status 中的数据从不更新,仅插入。

有没有一个词可以描述这种模式?我问是因为我想快速轻松地向其他人解释 table 的预期用途。

可能最好的术语是 CQRS and event sourcing

Using the stream of events as the write store, rather than the actual data at a point in time, avoids update conflicts on a single aggregate and maximizes performance and scalability

Event Sourcing pattern

Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects. This can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.

编辑:

仔细查看后,您还可以阅读有关 SCD(Slowly Changing Dimension) 类型 2 的内容。

This method tracks historical data by creating multiple records for a given natural key in the dimensional tables with separate surrogate keys and/or different version numbers. Unlimited history is preserved for each insert.

时间table。它是一个 table,其中时间戳/版本属性是密钥的一部分。 temporal / version 属性允许您识别每个客户的最新行。