1. 程式人生 > >最適合物聯網的開源資料庫

最適合物聯網的開源資料庫

the Internet of Things (IoT) can be regarded as a network in which various things are connected to each other through a common platform. Just visualise a scenario in which every device at home and the workplace is connected, and a world where the air-conditioning in a room automatically lowers its temperature when the outside temperature rises up, when the number of people in any public gathering is easily known, and when one’s health parameters can be monitored on a daily basis. This is the possible impact of the Internet of Things. 

物聯網(IoT)可以被看作是通過一個通用平臺將各種事物相互連線起來的網路。只需將家中和工作場所的所有裝置連線起來的場景以及室外空氣溫度升高時室內空調自動降溫的環境中觀察,任何公眾聚會中的人數都很容易知曉,並且可以每天監測一個人的健康引數。這是物聯網可能帶來的影響。

The current state of the Internet of Things is very fragmented. There are different companies and organisations that are building their own platforms for either their customers or their individual needs. But a common platform on which all the devices, irrespective of their company, can be connected with each other via a user friendly interface, is still missing.

物聯網的現狀非常分散。有不同的公司和組織正在為其客戶或其個人需求構建自己的平臺。但是一個通用的平臺,所有的裝置,無論他們的公司,都可以通過使用者友好的介面相互連線,但仍然缺失。

IoT devices are estimated to number in the trillions in the coming five years.

Is a database necessary for IoT?

估計未來五年物聯網裝置的數量將達到數萬億。
資料庫是物聯網所必需的嗎?

The Internet of Things creates many tedious challenges, especially in the field of database management systems, like integrating tons of voluminous data in real-time, processing events as they stream and dealing with the security of data. For instance, IoT based traffic sensors applied in smart cities would produce huge amounts of data on traffic in real-time. Databases have a very important role to play in handling IoT data adequately. Therefore, along with a proper platform, the right database is equally important. As IoT operates across a diverse environment in the world, it becomes very challenging to choose an adequate database.

物聯網產生了許多乏味的挑戰,特別是在資料庫管理系統領域,例如實時整合大量的大量資料,在處理資料流時處理事件以及處理資料安全性等方面。例如,智慧城市中應用的基於物聯網的交通感測器將實時生成大量的交通資料。資料庫在充分處理物聯網資料方面發揮著非常重要的作用。因此,隨著一個適當的平臺,正確的資料庫同樣重要。由於物聯網在全球多元化的環境中運作,選擇適當的資料庫變得非常具有挑戰性。

The factors that should be considered before choosing a database for IoT applications are:
1) Size, scale and indexing
2) Effectiveness while handling a huge amount of data
3) User-friendly schema
4) Portability
5) Query languages
6) Process modelling and transactions
7) Heterogeneity and integration
8) Time series aggregation
9) Archiving

10) Security and cost

在為物聯網應用選擇資料庫之前應考慮的因素有:
1)尺寸,比例和索引
2)處理大量資料時的有效性
3)使用者友好的模式
4)便攜性
5)查詢語言
6)流程建模和交易
7)異質性和一體化
8)時間序列聚合
9)存檔

10)安全性和成本

The types of data in the Internet of Things are:
1) RFID: Radio frequency identification
2) Addresses/unique identifiers
3) Descriptive data for processes, systems and objects
4) Pervasive environmental data and positional data
5) Sensor data: Multi-dimensional time series data
6) Historical data
7) Physics models: Models that are templates for reality

8) State of actuators and command data for control

物聯網中的資料型別有:
1)RFID:射頻識別
2)地址/唯一識別符號
3)過程,系統和物件的描述性資料
4)普遍的環境資料和位置資料
5)感測器資料:多維時間序列資料
6)歷史資料
7)物理模型:模型是現實的模板
8)用於控制的執行器和命令資料的狀態

Databases suited for the Internet of Things

InfluxDB: InfluxDB was first released in 2013, and is one of the recent databases. The Go programming language was used in developing this database, which is totally based on LevelDB, a key-value database. InfluxDB is a time series database, which is used to optimise and handle time series data. Time series data was first released by Kdb in 2000, but InfluxDB became popular with the rise in the Internet of Things as it gave movement to NoSQL, NewSQL and a vast amount of increasing data.

適用於物聯網的資料庫
InfluxDB:InfluxDB於2013年首次釋出,是最近的資料庫之一。 Go程式語言用於開發此資料庫,該資料庫完全基於LevelDB,一個鍵值資料庫。 InfluxDB是一個時間序列資料庫,用於優化和處理時間序列資料。 2000年Kdb首次釋出時間序列資料,但隨著物聯網的興起,InfluxDB開始流行起來,因為它推動了NoSQL,NewSQL和大量不斷增加的資料。

The advantages of using InfluxDB for IoT data include:
1) Allows indexing of series
2) It has an SQL-like query language
3) It also provides the built-in linear interpolation for missing data
4) It supports automatic data down sampling

5) Supports continuous queries to compute aggregates

使用InfluxDB進行物聯網資料的優勢包括:
1)允許編制索引
2)它有一個類似於SQL的查詢語言
3)它還提供了缺失資料的內建線性插值
4)它支援自動資料下采樣
5)支援連續查詢來計算聚合

CrateDB: CrateDB is a distributed SQL database management system. Being open source and written in Java, it includes components from Facebook Presto, Apache Lucene, Elasticsearch and Netty—thus it is designed for high scalability. CrateDB was made for putting IoT data to work. From the industrial Internet and connected cars to wearables, CrateDB is the database of choice for innovators of new IoT solutions.

CrateDB:CrateDB是一個分散式SQL資料庫管理系統。作為開原始碼並以Java編寫,它包含了來自Facebook Presto,Apache Lucene,Elasticsearch和Netty的元件,因此它的設計具有很高的可擴充套件性。 CrateDB是為了使物聯網資料正常工作而開發的。從工業網際網路和連線汽車到可穿戴裝置,CrateDB是新型物聯網解決方案創新者的首選資料庫。

The advantages of using CrateDB for IoT data include:
1) Millions of data points per second: Fast, linearly scalable data ingestion
2) Real-time queries: Columnar indices and field caches provide in-memory SQL performance
3) Dynamic schema: Add and query new sensor data structures on-the-fly
4) IoT analytics: Fast, robust time series, AI, geospatial, text search, joins, aggregations
5) Always on: Built-in data replication and cluster rebalancing ensure non-stop performance
6) ANSI SQL: No lock-in, and easy for any developer to use and integrate 
7) Built-in MQTT broker: Direct device-to-database integration
8) IoT ecosystem: Works with Kafka, Grafana, NodeRED, and other popular IoT stack software

9) Runs anywhere for efficient processing at the edge or in the cloud

使用CrateDB進行物聯網資料的優勢包括:
1)每秒數百萬個數據點:快速,可線性擴充套件的資料攝取
2)實時查詢:列式索引和欄位快取提供記憶體中的SQL效能
3)動態模式:即時新增和查詢新的感測器資料結構
4)物聯網分析:快速,強大的時間序列,AI,地理空間,文字搜尋,連線,聚合
5)始終開啟:內建資料複製和群集重新平衡確保不間斷的效能
6)ANSI SQL:無需鎖定,便於任何開發人員使用和整合
7)內建MQTT代理:直接從裝置到資料庫整合
8)物聯網生態系統:適用於Kafka,Grafana,NodeRED和其他流行的物聯網堆疊軟體

9)在任何地方執行,以便在邊緣或雲中進行高效處理

MongoDB: MongoDB is a free and open source cross-platform document-oriented database program. It is categorised as a NoSQL database program. JSON-like documents with schemas are used by MongoDB. It is preferred by organisations for IoT, as it lets them store data from any context, which can be analysed in real-time, and also to change the schema as they go along.

MongoDB:MongoDB是一個免費且開放原始碼的跨平臺面向文件的資料庫程式。它被分類為NoSQL資料庫程式。 MongoDB使用帶模式的類似JSON的文件。組織傾向於物聯網,因為它允許他們儲存來自任何上下文的資料,這些資料可以實時分析,也可以在架構隨時更改。

The advantages of using MongoDB for IoT data include:
1) Highly powerful database
2) Document-oriented
3) Has uses for general purposes

4) Being a NoSQL database, it uses JSON-like documents with schemas

使用MongoDB進行物聯網資料的優勢包括:
1)高度強大的資料庫
2)面向文件
3)用於一般目的
4)作為NoSQL資料庫,它使用類似JSON的文件和模式

RethinkDB: In the open source database list, RethinkDB stands at the top. It is a scalable JSON database for the real-time Web, which is built from the ground up. RethinkDB introduces an exciting new access model by transposing the traditional database architecture. It can continuously push updated query results to applications in real-time, when a command is given to it by the developer. This is a feature the developers call changefeeds. RethinkDB serves as a database, real-time repository and message broker of the system state, which is allowed by changefeed. Its real-time push architecture dramatically reduces the time and effort necessary to build scalable real-time apps.

RethinkDB:​​在開源資料庫列表中,RethinkDB位於頂部。它是用於實時Web的可擴充套件JSON資料庫,它是從頭開始構建的。 RethinkDB通過轉換傳統的資料庫體系結構引入了令人興奮的新訪問模式。當開發人員向其傳送命令時,它可以不斷將更新後的查詢結果推送至應用程式。這是開發人員稱為換卡的功能。 RethinkDB作為系統狀態的資料庫,實時儲存庫和訊息代理,這是更改程序允許的。其實時推送體系結構大大減少了構建可擴充套件實時應用程式所需的時間和精力。
將RethinkDB用於物聯網感測器資料的優點包括:

The advantages of using RethinkDB for IoT sensor data include:
1) RethinkDB has an adaptable query language for examining APIs, which is very easy to set up and learn.
2) Commands are automatically shifted to a new server if any primary server fails.
3) Plug-and-play function of nodes in real-time, without any downtime for even a single second, helps in the easy addition of nodes.
4) Offers asynchronous queries via Eventmachine in Ruby and Tornado, which gives an asynchronous application programming interface.
5) It offers SSL access just to have secured access to RethinkDB via public Internet.

6) Floor, ceil and round are various mathematical operators that are offered by RethinkDB.

1)RethinkDB具有適用於檢查API的查詢語言,這非常容易設定和學習。
2)如果任何主伺服器發生故障,命令會自動轉移到新伺服器。
3)實時即插即用的節點功能,即使是一秒鐘也沒有停機時間,有助於節點的輕鬆新增。
4)通過Ruby和Tornado中的Eventmachine提供非同步查詢,從而提供非同步應用程式程式設計介面。
5)它提供SSL訪問只是為了通過公共網際網路安全地訪問RethinkDB。

6)Floor,Ceil和Round是由RethinkDB提供的各種數學運算子。

SQLite: SQLite Database Engine is a process library that provides a serverless (self-contained) transactional SQL database engine. It has had a major impact on game and mobile application development due to its portability and
small footprint.
SQLite works appropriately with the devices that do not require any human support, as the database requires no administrative permissions. It is a good fit for use in cell phones, set-top boxes, televisions, game consoles, cameras, watches, kitchen appliances, thermostats, automobiles, machine tools, air planes, remote sensors, drones, medical devices and robots, as well as in IoT.

Client/server database engines are designed to live inside a data centre at the core of the network. SQLite works there too, but SQLite also thrives at the edge of the network, fending for itself while providing fast and reliable data services to applications that would otherwise have dodgy connectivity.

SQLite:SQLite資料庫引擎是一個提供無伺服器(自包含)事務性SQL資料庫引擎的流程庫。由於可移植性和可移植性,它對遊戲和移動應用程式的開發產生了重大影響
佔地面積小。
SQLite適用於不需要任何人力支援的裝置,因為資料庫不需要管理許可權。它非常適合用於手機,機頂盒,電視機,遊戲機,相機,手錶,廚房電器,恆溫器,汽車,機床,飛機,遙感器,無人機,醫療裝置和機器人等。如在物聯網中。
客戶端/伺服器資料庫引擎旨在位於網路核心的資料中心內。 SQLite也可以在那裡工作,但SQLite也在網路邊緣蓬勃發展,為自己提供幫助,同時為應用程式提供快速和可靠的資料服務,否則這些應用程式會存在不可靠的連線。

The advantages of using SQLite for IoT data include:
1) Offers a small memory footprint
2) It is authentic
3) No setting up required prior to use

4) Has no dependencies

使用SQLite進行物聯網資料的優勢包括:
1)提供小記憶體佔用
2)它是真實的
3)使用前不需要設定
4)沒有依賴關係

Apache Cassandra: Apache Cassandra is a free and open source distributed NoSQL database management system, which was initially released in 2008. It was intended to handle huge amounts of data through many commodity servers, providing high availability with no single point of failure.

In IoT, the generation, tracking and sharing of data through a variety of networks is carried out on an immense scale due to the massive number of connected devices.  Cassandra is excellent at utilising lots of time series data that comes directly from devices, users, sensors, and similar mechanisms that subsist in diverse geographic locations.

Apache Cassandra:Apache Cassandra是一個免費的開源分散式NoSQL資料庫管理系統,最初於2008年釋出。它旨在通過許多商品伺服器處理大量資料,提供高可用性,無單點故障。
在物聯網中,由於大量連線的裝置,通過各種網路生成,跟蹤和共享資料的規模非常巨大。 Cassandra非常擅長利用大量時間序列資料,這些資料直接來自裝置,使用者,感測器以及存在於不同地理位置的類似機制。

The advantages of using Apache Cassandra for IoT data include:
1) Fault tolerant
2) Demonstrates high performance
3) Decentralised: Every node in the cluster is identical
4) Scalable
5) Durable
6) Ensures you’re in control: Each update has a choice of synchronous and asynchronous replication
7) Elastic: Both read and write execute in real-time, thus there is no downtime for any application

8) Professionally supported: It reinforces contracts and services that are available from third parties.

使用Apache Cassandra獲得物聯網資料的優勢包括:
1)容錯
2)演示高效能
3)分散化:叢集中的每個節點都是相同的
4)可擴充套件
5)耐用
6)確保您處於控制之下:每個更新都可以選擇同步和非同步複製
7)彈性:讀取和寫入都是實時執行的,因此任何應用程式都沒有停機時間
8)專業支援:它強化了第三方提供的合同和服務。