存储实时数据的建议,允许使用 .NET API 进行高速存储/检索
我正在尝试找到最佳解决方案,以基本上替换当前正在开发但正在运行的解决方案中的 SQL 数据库。数据存储需要包括可备份和/或转入/转出的表分区和文件组(如 IBM DB2 分区中所述:http://www.ibm.com/developerworks/data/library/techarticle/dm-0605ahuja2/index.html),但也允许批量行插入/更新。
目前,存储在SQL数据库中的表的结构很简单: ID 长(主键) 时间戳日期时间(主键) 价值浮动 属性 int
该 ID 与当前数据库中的任何 ID 无关,而是来自其他地方。 ID 和时间戳一起用作
在表中插入/更新数据的主键。目前,.NET 使用带有表值参数的存储过程,以允许一次将 50K 行数据合并到表中。目前我在开发机器上测量了大约 10K 条目/秒,对此我很满意。但是,由于该解决方案对成本敏感,并且由于表增长时的性能要求,我需要能够进行表分区(按 TimeStamp 字段排列)并将分区划分为多个文件以简化维护/备份。此外,我需要客户能够至少通过 ODBC 对数据执行查询(只读)。
我研究了几个 NoSQL 选项:mySQL 和 DB2(目前看来最合适)。如果有人对最合适的方案有任何见解,我将不胜感激。当然,总是可以选择将“分区”逻辑移至代码中,但如果可能的话,我想避免这种情况。
I am trying to find the best solution to essentially replace a SQL database in a solution that is currently under development, but is working. The data store needs to to include table partitioning and file groups that can be backed up and/or rolled in/out (such as described in IBM DB2 partitioning here: http://www.ibm.com/developerworks/data/library/techarticle/dm-0605ahuja2/index.html), but also allow mass row insert/updates.
The tables stored in the SQL database currently have a simple structure:
ID long (PRIMARY KEY)
TimeStamp DateTime (PRIMARY KEY)
Value float
Attribute int
The ID is not related to any ID in the current database but comes from elsewhere. The ID and Timestamp together are used as the primary key for inserting/updating
data in the table. Currently, a stored procedure with a Table-Valued Parameter is used from .NET to allow for data to be merged into the table 50K rows at a time. Currently I have measured around 10K entries/s on the development machine, which I am happy with. However, as the solution is cost sensitive, and due to performance requirements as the table grows, I need the ability to do table partitioning (ranged by the TimeStamp field) and divide the partitions among multiple files for simplified maintenance/backup. In addition, I need the ability for a customer to execute queries (read only) on the data, at minimum, via ODBC.
I have looked at a couple of NoSQL options, mySQL, and DB2 (which seems to be the closest fit right now). I would appreciate any insight anyone has as to what the best fit may be. There is of course always the option to move the "partitioning" logic into the code, but I'd like to avoid that if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也一直在研究 NonSQL 解决方案。我最喜欢的是 Twitter 和 Facebook 使用的 Cassandra。
http://cassandra.apache.org/
使用 .net 与 Cassandra 交互的方式也有多种:
http://www.ridgway.co.za/archive/2009/11/06/net-developers-guide-to-getting-started-with-cassandra.aspx
http://wiki.apache.org/cassandra/ClientOptions06
I have also been looking into NonSQL Solutions. My favorite is Cassandra which is used by Twitter and Facebook.
http://cassandra.apache.org/
There are several ways to interact with Cassandra using .net as well:
http://www.ridgway.co.za/archive/2009/11/06/net-developers-guide-to-getting-started-with-cassandra.aspx
http://wiki.apache.org/cassandra/ClientOptions06