本文介绍了用于文本修订的数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题包含了如何设计数据库历史/修订方案

This question contains some excellent coverage of how to design a database history/revision scheme for data like numbers or multiple choice fields.

但是,对于大文本字段没有太多的讨论,这通常在博客/ Q& A / wiki /文档类型系统中找到。

However, there is not much discussion of large text fields, as often found in blog/Q&A/wiki/document type systems.

那么,什么会被认为是在基于数据库的编辑系统中存储文本字段的历史的好方法?

So, what would be considered good practice for storing the history of a text field in a database based editing system? Is storing it in the database even a good idea?

推荐答案

我开发了一个wiki引擎和页面/文章修订版本存储在数据库中数据库表。每个修订版都有一个顺序修订号,而当前修订版则标有-1(只是为了避免NULL)。

I develop a wiki engine and page/article revisions are stored in a database table. Each revision has a sequential revision number, while the "current" revision is marked with -1 (just to avoid NULL).

修订文本按原样存储差异或类似的东西。

Revision text is stored as-is, not diffed or something like that.

我认为性能不是一个问题,因为你不太可能访问旧版本很频繁。

I think that performance is not a problem because you are not likely to access older revisions very frequently.

这篇关于用于文本修订的数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

查看更多