I'm looking for a simple database to use in my .NET application to log values from different sources, and retrieve values back later filtered by a date time range.
我正在寻找一个简单的数据库,用于在我的.NET应用程序中记录来自不同来源的值,并在以后按日期时间范围过滤后检索值。
The values that should be stored can be as simple as
应该存储的值可以很简单
{
"timestamp": "2015-05-13 16:40:23",
"temperature": 22.3
}
though another source could have a more complex value, such as a value with several members:
虽然另一个源可能具有更复杂的值,例如具有多个成员的值:
{
"timestamp": "2015-05-13 16:40:23",
"velocity": {
"x": 1.3,
"y": 1.01,
"z": 0.04
}
}
or alternatively a value being an array:
或者一个值是一个数组:
{
"timestamp": "2015-05-13 16:40:23",
"velocity": [1.3, 1.01, 0.04]
}
}
Each data source will not supply samples more often than twice a second, and there will not be many of them "live" at any given time (maybe 10 that are active and supplying data, while another 20 are idle. Though which are active and which are idle changes), so performance is not really that important. The most important part is to simply add new "tables" to a database if new data sources with different value structures are added to the system.
每个数据源不会提供超过一秒两次的样本,并且在任何给定时间都不会有很多“实时”(可能有10个是活动的并且提供数据,而另外20个是空闲的。虽然它们是活动的并且这是空闲的变化),因此性能并不是那么重要。最重要的部分是,如果将具有不同值结构的新数据源添加到系统,则只需向数据库添加新的“表”。
I am most familiar with using SQL, but I figured there may be something simpler for my use-case where there are no relationships, just keys (the timestamp) and values. I tried googling, and mostly found solutions for Linux-systems.
我最熟悉使用SQL,但我认为可能有一些更简单的用例,其中没有关系,只有键(时间戳)和值。我尝试使用Google搜索,并且主要找到Linux系统的解决方案。
1 个解决方案
#1
0
I think that you can use mongoDB for that, and it has .net driver supports http://docs.mongodb.org/ecosystem/drivers/csharp/?jmp=docs
我认为你可以使用mongoDB,它有.net驱动支持http://docs.mongodb.org/ecosystem/drivers/csharp/?jmp=docs
#1
0
I think that you can use mongoDB for that, and it has .net driver supports http://docs.mongodb.org/ecosystem/drivers/csharp/?jmp=docs
我认为你可以使用mongoDB,它有.net驱动支持http://docs.mongodb.org/ecosystem/drivers/csharp/?jmp=docs