cszhiyue
V2EX  ›  问与答

文章的历史版本功能有什么实现思路?

  •  
  •   cszhiyue · Oct 22, 2016 · 1759 views
    This topic created in 3688 days ago, the information mentioned may be changed or developed.

    类似 Wikipedia 和 知乎 的编辑历史。 目前有两个思路:

    1. 每次更新数据库增加一个版本号,保存全部内容
    2. 每次更新对应于上一个版本打 patch

    想问一下目前业界有哪些通用的实现方式?

    2 replies  •  2016-10-23 11:17:57 +08:00
    qwer1234asdf
    qwer1234asdf
    Oct 22, 2016
    1
    啊哈,之前就弄过这个,使用的 bsdiff ,相当于 diff cur_ver prev_ver > xxx_cur_time.patch ,可以在打 patch 的同时保存一条编辑记录
    stamaimer
    stamaimer
    Oct 23, 2016 via iPhone
    2
    git
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:30 · PVG 00:30 · LAX 08:30 · JFK 11:30
    ♥ Do have faith in what you're doing.