V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
bsg1992
V2EX  ›  程序员

关于业务中的数据版本应该如何进行设计呢

  •  
  •   bsg1992 · Oct 3, 2023 · 979 views
    This topic created in 939 days ago, the information mentioned may be changed or developed.

    在做业务的时候,总是会遇到对数据进行版本管控。
    例如从 A 版本升到 B 版本,常规做法是复制出来一条新的数据标记为 B
    在对其他引用 A 的数据进行更新,替换成 B 。 还有其他更优的设计方案吗

    1 replies    2023-10-03 16:43:48 +08:00
    chendy
        1
    chendy  
       Oct 3, 2023
    把主数据和版本分开,用主数据做关联
    比如 DocumentMeta 存版本无关的元数据,DocumentVersion 存每个版本(顺便做一些字段区分是否最新之类的),关联的时候关联到 DocumentMeta 上
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5405 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 09:05 · PVG 17:05 · LAX 02:05 · JFK 05:05
    ♥ Do have faith in what you're doing.