单个文档的风险包含数千个小物体的十几个阵列

发布于 2025-02-10 20:21:11 字数 613 浏览 0 评论 0原文

当许多用户在线时,可以在单个文档中断上写操作吗?

将有〜12个这样的阵列,每个数组都有数万个这样的对象。写操作将是:

  • 基于货币和活动的现有对象的计数字段的增量(
  • +1 :增量(-1)或价格变化。

注意:所有数据均在单个页面上立即显示

stayCount [
{price: "15", count: 2, country: "USA", currency: "USD"},
{price: "15, count: 3, country: "UAE", currency: AED},
{price: "25", count: 5, country: "USA", currency: USD}
]
sportsCount [
{price: "15", count: 1, country: "Germany", currency: EUR},
{price: "49, count: 6, country: "UAE", currency: AED},
{price: "49", count: 8, country: "France", currency: EUR}
]

询问每第二个规则每个文档的最大写入。

Can the write operations on a single doc break when many users are online?

There will be ~12 such arrays, each with tens of thousands of such objects. Write operations would be:

  • increment(+1) for the count field of existing objects based on currency and activity (stay, sports...),
  • add an entire new object when it's a new currency and country,
  • update an existing object, eg: increment(-1) or price change.

Note: all data is displayed at once on a single page.

stayCount [
{price: "15", count: 2, country: "USA", currency: "USD"},
{price: "15, count: 3, country: "UAE", currency: AED},
{price: "25", count: 5, country: "USA", currency: USD}
]
sportsCount [
{price: "15", count: 1, country: "Germany", currency: EUR},
{price: "49, count: 6, country: "UAE", currency: AED},
{price: "49", count: 8, country: "France", currency: EUR}
]

Asking because of the one write max per Doc per second rule.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文