英文:
Best practice confirm data changes of second perosn
问题
我正在寻找在数据库中允许对数据进行更改的最佳实践/设计模式。
要求是,人员A想要更新一些数据。例如电子邮件、地址或公司名称。除非人员B检查并确认,否则来自人员A的所有更改在网页上不可见。这些数据存储在数据库中。
我的问题是,现在对于数据库,什么是最佳实践/设计模式?是复制数据库并通过提交将数据复制到另一个数据库吗?还是只有一个数据库,将整个数据集与更改后的值一起复制,并在额外的列中进行标记(必须检查)。
我尝试通过谷歌找到一些信息,但我认为我没有使用正确的关键词。
我唯一知道的关键词是“四眼原则”,以及一种解决方案是使用工作流引擎,如Camunda,或者使用DMS或ECM。
对于这个问题肯定有简单的解决方案,或者这个问题不常见吗?
谢谢帮助。
附注:用户在网站上更改数据,而不是直接在数据库中进行更改。
英文:
I'm looking for the best practice/ design pattern to permit changes on data in a database.
The requirement is that a person A want to update some data. For example email, address or company name. All the changes from person A are not visible on the webpage until Person B check these changes and confirm that. The data are stored in a database.
My question is now what is the best practice/ design pattern for the database? Duplicate the database and copy the data by commit to the other? Only one database and copy the whole dataset with the changed value and tag in that extra column(has to check).
I tried to find something with Google, but I think I don't use the right buzzwords.
My only buzzword was four eyes principal and a solution was workflow engine like camunda or to use dms or ecm.
There has to be simple solution for that problem or is that problem so uncommon?
Thanks for help.
PS.: the user change the data on a website, not directly in the database.
答案1
得分: 0
你需要设计一个名为“通用订单”或“通用工作”的数据结构。在这里,你将拥有一个主表,用于描述工作或订单。字段将会是:
工作ID
创建时间
创建者
工作标识
工作名称
许可时间
许可者
任何工作/订单都有一组键值对的数据。这将被建模如下:
工作ID (外键:fk_job_id)
键
值
每个工作都必须有一个实现。因此,键值对的解释取决于此实现。实现将由用户触发,当用户许可与当前工作或订单相关的更改时。
通用模型允许你拥有一个数据结构,而不受应用程序中任何表的影响。
你还可以从数据库的事务日志中汲取一些灵感。请注意,更改是有顺序的。因此,你可以检测到冲突。
然而,你可以增强上述数据结构以在批准之前锁定实体。
你还可以查看Spring Batch,那里有一个类似的数据结构和处理方式。
请参阅Apache Camel项目。也许你同样可以使用Apache Camel。
英文:
You have to design a data structure such as "generic order" or "generic job". Here you will have a master table that describes a job or an order. The fields would be:
job_id
created_at
created_by
job_ident
job_name
permit_at
permit_by
Any job/order has a key/value set of data. Which would be modeled like this:
job_id (fk_job_id)
key
value
Every job must have an implementation. So the interpretation of the key value pairs is up to this implementation. The implementation would be triggered by a user as he permits the changes associated with the current job or order.
The generic model allows you to have one data structure regardless of any table your application has.
You can also draw some inspiration from transaction logs of a database. Please note, that changes have an order to it. So you can detect conflicts.
However you can enhance the data structure above to lock an entity until approval.
You can also have a look on spring-batch where there is a similar data structure and processing.
Please see the apache camel project. Maybe you can use apache-camel as well.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论