Building blocks for IoT Architecture and Technology

Jani Karhunen © 2016

## Focus This presentation gives few alternative building blocks for IoT / Industrial Internet solutions. Presentation progresses chronologically from data collection through data storage to data utilization. *By no means is this presentation the only truth to the vast subject. I simply present components, methods and services which I am familiar and have experience with.*
# Section 1: Architecture
## Paradigm 1: Utilization of Cloud Technology and Services
## Paradigm 2: Scalability, independence, fault tolerance, reactivity & flexibility (also cost wise) [**Microservices**]( and **Containers**, e.g. [Docker](
# Paradigm 3: [*Serverless Architecture*](
## Paradigm 4: Utilization of **APIs** (*Application Programming Interface*). As both - consumer and provider.
## Paradigm 5: Web Browser based interfaces for management and use, which scales to all devices - from desktop to mobile.
## Paradigm 6: Management ja Information Security
# Section 2: Data collection & transfer
## Sensors and meters Vast amount of different options based on the use case and requirements, including: - environment (e.g. temperature, humidity, pressure, luminance) - energy, current, voltage - flow of gas/liquid
## Data transfer Vast amount of choices based on use case and requirements, e.g.: TCP/IP based solutions - WLAN - Ethernet - 2/3/4G Mobile networks Bus based solutions - [Modbus]( - [Profibus]( Some are very easy to implement, some need more work.
# Section 3: Data Storage
## Data Storage alternatives - Relational Databases, [MS SQL Server](, [Oracle DB](, [MariaDB/MySQL](, [PostgreSQL](, [Amazon RDS]( - NoSQL Databases, e.g. [MongoDB](, [Cassandra](, [Neo4j](, [Amazon DynamoDB]( - [Time Series optimized Databases](, e.g. [InfluxDB]( and [OpenTSDB](
# Section 4: Data Validation & Processing
## Validation The raw data from sensors and meters must be validated either before or after storage. Processing rules determines, what is done to *invalid* and *missing* values.
## Missing & invalid value correctin Processing rules defines, what kind of *algorithm* estimates missing or invalid values to complete the time series.
# Section 5: Integration & APIs
## Data transfer between private (own) services 1. [API]( 2. [Queue](, e.g. [RabbitMQ]( and [Amazon Simple Queue Service](
## Data transfer between 3rd party (public/external) services 1. [API](, individual messages 2. File based transfer (e.g. XML, JSON, CSV), mass processing
# Section 6: Data Visualization & reporting
## Data Visualization Data from sensors and other integrated data sources can be made useful to customers and business by visualizations. Data can be utilized in Business Intelligence tools, such as [Qlik]( or [Tableau]( ... or it can be part of a online service, visualized with e.g. [D3.js]( or other available tools.
## Reporting Data can be presented in static reports, which are automatically delivered e.g. via email or to a [Slack]( channel.
# Section 7: Advanced Data Processing
## Machine Learning and Predictive Analytics [Machine Learning]( enables advanced tools, e.g. in a form of recommendation engines. There are few "plug-in" SaaS platforms for Machine Learning, e.g. [Amazon Machine Learning](
# Section 8: Platforms
## Infrastructure as Code Entire Data Center can be defined as code, which can be executed and thus is automatically deployed. - [ThoughtWorks Infrastructure as Code: A Reason to Smile]( - [Ansible]( - [Vagrant]( - [AWS CloudFormation](
## Amazon Web Services [AWS]( offers vast amount of various IaaS and PaaS Services with *Pay as you go* principle.
## Microsoft Azure [Azure IoT Suite]( offers large amount of various IaaS and PaaS Services with *Pay as you go* principle.
## IBM Bluemix [IBM Bluemix]( offers quite large amount of various IaaS and PaaS Services with *Pay as you go* principle.
# Section 9: Monitoring and management
## On the Cloud Just as everything else, monitoring and management of services and resources is possible to implement with cloud tools, e.g. - [Amazon CloudWatch](
# Simple example
## Temperature measurement and visualization As an extremely simple example of the previous technologies I present a solution which measures temperatures and relative humidity in few places in my house and yard.
## What and where? 1. Measurement and data collection with a [**RaspberryPi** based solution]( and wireless sensors. Measurement is done in 1 h resolution. 2. Data is presented on a (private) web site, and in **Twitter** and **Slack** channel via APIs in real time.
## How, part 1 3. Measurement event is sent to a queue waiting processing and storage. Implemented with [**CloudAMQP**]( 4. Measurement event is pulled from the queue and processed on a VPS in [Hetzner's cloud]( with a [Python]( application. The application stores the measurement event to a PostgreSQL (relational) database, which is self-hosted on the same VPS.
## How, part 2 5. A separate Python application validates measurements, and fills missing values based on previous values on the same time series. The same processing is done to significantly differing values. 6. Measurement data is visualized in real time on a private web site with D3.js. 7. Data is posted on Twitter and on Slack channel via APIs.
## Further development There are numerous ideas and possibilities to develop this solution further, e.g. - expand with new sensors and measurements - develop the visualization - estimation of future temperature and humidity (which is obviously not going to work very well...)