管理更新包含一组复杂更改的数据库的最佳实践

发布于 2024-08-29 02:23:35 字数 402 浏览 4 评论 0原文

我正在编写一个应用程序,其中数据库中有一些公开可用的信息,我希望用户能够编辑这些信息。这些信息不像维基百科那样是文本信息,但在概念上是相似的,因为编辑使公共信息越来越接近事实。更改会影响多个表,并且需要在影响公共表之前自动检查更新。

我正在进行设计,我想知道是否有任何最佳实践可以帮助解决某些特定问题。

  1. 我想提供撤消功能。
  2. 我想向用户展示所有更改的综合结果。
  3. 当用户说他们已经完成时,我需要检查基础公共数据以确保它没有被其他人更改。

我当前的计划是让用户在一组设置为私人工作区域的桌子中工作。一旦准备好,他们就可以启动一个过程来检查所有内容并更新公共表。可以使用保存到表的命令模式来记录撤消。

有没有我可能错过的技术或有用的论文或模式?

提前致谢!

I am writing an application where I have some publicly available information in a database which I want the users to be able to edit. The information is not textual like a wiki but is similar in concept because the edits bring the public information increasingly closer to the truth. The changes will affect multiple tables and the update needs to be automatically checked before affecting the public tables.

I'm working on the design and I'm wondering if there are any best practices that might help with some particular issues.

  1. I want to provide undo capability.
  2. I want to show the user the combined result of all their changes.
  3. When the user says they're done, I need to check the underlying public data to make sure it hasn't been changed by somebody else.

My current plan is to have the user work in a set of tables setup to be a private working area. Once they're ready they can kick off a process to check everything and update the public tables. Undo can be recorded using Command pattern saving to a table.

Are there any techniques I might have missed or useful papers or patterns?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

究竟谁懂我的在乎 2024-09-05 02:23:35

我会这样做:

  • 使用仅插入数据库,您从不更新数据,只添加新行
  • 每行都有一个有效的起始日期,一个有效的日期以及谁进行了更改
  • 通过查询读取数据,其中有效日期= null ,并且该行已批准,这给出了最新的行
  • 当用户添加数据时,他可以通过选择他添加的最后一行来查看他的更改
  • 当用户对他所做的更改感到满意时,他可以将它们标记为已批准
  • 当它们已被批准 他们可以被其他用户看到
  • 撤消不是问题,因为您拥有所有以前的版本,您可以将一行标记为不再被批准并恢复到以前的版本。

I would do it like this:

  • Use insert only databases, you never update data only add new rows
  • Each row has a valid from date, a valid to date and who made the change
  • Read the data through a query where the valid to date = null, and the row is approved, this gives the most recent row
  • When a user adds data, he can see his changes by selecting the last row that he added
  • When the user is happy with the changes he has made he can mark them as approved
  • When they are approved they can be seen by other users
  • Undo is not a problem since you have all the previous versions, you can mark a row as no longer being approved and revert to a previous version.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文