简体   繁体   English

如何存储工厂数据以及存储在哪里?

[英]How to store the plant data and where to store?

Plant data is real time data from plant process, such as, press, temperature, gas flow and so on. 工厂数据是来自工厂过程的实时数据,例如压力机,温度,气体流量等。 The data model of these data is typically like this: 这些数据的数据模型通常是这样的:
(Point Name, Time stamps, value(float or integer), state(int))

We have thousands of points and longtime to store. 我们有数千个积分,而且需要长时间存储。 And important, we want search them easy and quickly when we need. 重要的是,我们希望在需要时轻松快速地搜索它们。

A typically search request is like: 典型的搜索请求如下:

get data order by time stamp 
    from database 
    where Point name is P001_Press 
    between 2010-01-01 and 2010-01-02

A database similar to MySql is not suitable for us, because the records is too many and the query is too slowly. 类似于MySql不适合我们,因为记录太多并且查询太慢。

So, how to store data (like above) and where to store them? 那么,如何存储数据(如上所述)以及将数据存储在何处? Any NOSQL databases?? 任何NOSQL数据库?

Thanks! 谢谢!

This data and query pattern actually fits pretty well into a flat table in a SQL database, which means implementing it with NoSQL will be significantly more work than fixing your query performance in SQL. 实际上,这种数据和查询模式非常适合SQL数据库中的平面表,这意味着与在SQL中固定查询性能相比,使用NoSQL实施该数据和查询的工作量要大得多。

If your data is inserted in real time, you can remove the order by clause as the date will already be sorted by timestamp and there is no need to waste time resorting it. 如果您的数据是实时插入的,则可以删除order by子句,因为日期已经按照时间戳进行排序,因此无需浪费时间重新使用它。 An index on point name and timestamp should get you good performance on the rest of the query. 点名称和时间戳的索引应在其余查询中获得良好的性能。

If you are really getting to the limits of what a SQL table can hold (many millions of records) you have the option of sharding - a table for each data point may work fairly well. 如果您真的要达到SQL表可以容纳的数量(数百万条记录)的极限,则可以选择分片-每个数据点的表都可以很好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM