什么 NoSQL DB 用于稀疏时间序列(如数据)? [英] What NoSQL DB to use for sparse Time Series like data?

查看:14
本文介绍了什么 NoSQL DB 用于稀疏时间序列(如数据)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计划一个附带项目,我将在其中处理时间序列之类的数据,并且想尝试其中一个闪亮的新 NoSQL DB,并正在寻找建议.

I'm planning a side project where I will be dealing with Time Series like data and would like to give one of those shiny new NoSQL DBs a try and am looking for a recommendation.

对于一组(不断增长的)symbols,我将有一个 (time,value) 元组列表(随着时间的推移而增加).并非所有 symbols 都会更新;一些 symbols 可能会更新,而其他可能不会更新,并且可能会添加全新的 symbols.

For a (growing) set of symbols I will have a list of (time,value) tuples (increasing over time). Not all symbols will be updated; some symbols may be updated while others may not, and completely new symbols may be added.

因此数据库应该允许:

  • 使用初始单元素(元组)列表添加符号.例如.答:[(2012-04-14 10:23, 50)]
  • 使用新元组更新符号.(将该元组附加到该符号的列表中).
  • 读取给定品种的数据.(理想情况下,甚至让我指定应返回数据的时间范围)

创建和更新操作应该是原子的.如果一次读取多个符号是可能的,那会很有趣.

The create and update operations should possibly be atomic. If reading multiple symbols at once is possible, that would be interesting.

性能并不重要.更新/创建大约每隔几个小时就会发生一次.

Performance is not critical. Updates/Creates will happen roughly once every few hours.

推荐答案

我相信几乎所有主要的 NoSQL 数据库都会支持这个要求,特别是如果你实际上没有大量数据(这引出了一个问题,为什么NoSQL?).

I believe literally all the major NoSQL databases will support that requirement, especially if you don't actually have a large volume of data (which begs the question, why NoSQL?).

也就是说,我最近必须为时间序列数据设计和使用 NoSQL 数据库,因此可以就该设计提供一些输入,然后可以推断出所有其他的.

That said, I've had to recently design and work with a NoSQL database for time series data so can give some input on that design, which can then be extrapolated for all others.

我们选择的数据库是Cassandra,我们的设计如下:

Our chosen database was Cassandra, and our design was as follows:

  • 所有符号"的单一键空间
  • 每个符号都是一个新行
  • 每个时间条目都是该相关行的新列
  • 每个值(可以是多个值)是时间条目的值部分

这可以让您实现您所要求的一切,最明显的是读取单个符号的数据,并在必要时使用范围(列范围调用).尽管您说性能并不重要,但它对我们来说也非常高效 - 任何单个符号的所有数据都按定义排序(列名排序)并始终存储在同一节点上(简单查询没有跨节点通信).最后,这种设计可以很好地转化为其他具有动态列的 NoSQL 数据库.

This lets you achieve everything you asked for, most notably to read the data for a single symbol, and using a range if necessary (column range calls). Although you said performance wasn't critical, it was for us and this was quite performant also - all data for any single symbol is by definition sorted (column name sort) and always stored on the same node (no cross node communication for simple queries). Finally, this design translates well to other NoSQL databases that have have dynamic columns.

除此之外,这里有一些关于将 MongoDB(以及必要时的上限集合)用于时间序列存储的信息:MongoDB 作为时间序列数据库

Further to this, here's some information on using MongoDB (and capped collections if necessary) for a time series store: MongoDB as a Time Series Database

最后,这里讨论一下时间序列的 SQL 与 NoSQL:https://dba.stackexchange.com/questions/7634/timeseries-sql-or-nosql

Finally, here's a discussion of SQL vs NoSQL for time series: https://dba.stackexchange.com/questions/7634/timeseries-sql-or-nosql

我可以在讨论中添加以下内容:

I can add to that discussion the following:

  • NoSQL 的学习曲线会更高,就软成本"而言,您不会免费获得额外的灵活性和功能.谁将在运营上支持该数据库?
  • 如果您希望此功能在未来有所增长(无论是向每个时间条目添加更多字段,还是在符号数量或符号时间序列大小方面更大的容量),那么一定要使用 NoSQL.灵活性的好处是巨大的,并且您在每个符号"和符号数量"的基础上获得的可扩展性(通过上述设计)几乎是无限的(我说几乎是无限的 - 每行的最大列数为数十亿,最大值我相信每个键空间的行数是无限的).

这篇关于什么 NoSQL DB 用于稀疏时间序列(如数据)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆