gpt4 book ai didi

nosql - 如何处理 NoSQL 中重复数据的变化

转载 作者:行者123 更新时间:2023-12-03 20:23:41 30 4
gpt4 key购买 nike

我们正在为即将到来的项目评估 NoSQL。我倾向于以 RDBMS 的方式思考问题,并且在概念化缺乏规范化方面遇到了困难。

我知道在 NoSQL 中复制数据不被认为是错误的。我无法理解的是修复数据更改以防止异常。

举例说明问题:

You are organizing a series of poker tournaments. You have players, locations, and tournament events. As I understand it, a tournament event might contain a location and a collection of players. It does not need to have all the player data, but if you want to get the names and home addresses of everyone going to the next tournament, that info should be in the tournament collection.

Someone has gotten married and moved, changing their last name and address. Does the application need to update the player collection and the tournament collection? Or is my model of the collections wrong? How do developers "keep track" of where information is duplicated?

最佳答案

我最近看到使用相当多的模型是拥有一个不可变的“主”数据集合(在你的情况下,玩家列表,每个锦标赛中玩家的锦标赛列表是“关系”建模的,其中锦标赛record 有一个玩家 id 列表)和一个非规范化列表(在您的情况下,是一个具有完全填充的玩家数据的锦标赛列表),该列表仅通过对“主”数据运行定期进程来更新。

这样应用程序只需要更新主数据,周期性的更新过程最终会重建非规范化的结果。

关于nosql - 如何处理 NoSQL 中重复数据的变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9537034/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com