用于存储用户的influxdb存储桶或标签?

发布于 2025-02-03 13:24:11 字数 80 浏览 3 评论 0原文

第一次与InfluxDB和IM合作,试图优化一个可能具有很多用户的项目。我的问题是,每个用户的时间序列数据是否应使用不同的标签或不同的存储桶存储?

First time working with influxdb and im trying to optimize a project that might have a lot of users. My question is, should time series data for each user be stored with different tags or in different buckets?

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

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

发布评论

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

评论(1

寒冷纷飞旳雪 2025-02-10 13:24:11

好吧,这取决于。

如果用户的数量不是无限或太多(即相比与其他标签进行比较),并且当您进行“组”,“组”时,这些用户将被过滤 您应该将这些用户作为标签。

否则,在领域中对待它们。

标记值是索引的,并且场值不在infuxdb中。标签会消耗大量的内存,您想在最重要的东西上获得最佳的资源。标签越多,每个标签的多样性越多,基数越高越高的内存使用情况,您将遇到OOM问题的可能性就越大。

查看更多最佳实践在这里

Well, it depends.

If number of users are not infinite or too many (i.e. compare to other tags relatively speaking) and these users will be filtered a lot when you are doing "group by", you should put these users as tags.

Otherwise, treat them in fields.

Tag values are indexed and field values aren’t in InfluxDB. Tags consume a lot of memory and you want to make best of resources on the most important stuff. The more tags, the more diversity of each tag, the higher the cardinality, the higher memory usage, the more probability you will hit the OOM issue.

See more best practices here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文