Escolar Documentos
Profissional Documentos
Cultura Documentos
• Agenda
• Introduction, what’s driving IoT data creation and use today?
• Introducing IoT data and requirements to store it efficiently
• The IBM IoT engine, from gateway to enterprise deployments
• A brief look at TimeSeries
3 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• The operational database is a dynamic market segment evolving
from IMS in the 1960s to fast data and transactional capabilities of
today
• Here are the market trends that have shaped our strategy for this
segment:
• Open Source
• Cloud
• Real time operational
intelligence (HTAP)
• IoT
• Mobile
• Multi-structured
4 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• IBM has been delivering Internet of Things solutions for a Smarter
Planet since 2008
INTELLIGENT
5 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• All Internet of Things use cases have a common set of fundamental
requirements
• Easily provision / configure any connected “thing”
• Create a real-time communication channel with the “thing”
• Begin capturing and consolidating data from the “thing” and store it in an
enterprise-class DB
• Provide access to the collected data
6 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• IoT requires highly optimized spatial and temporal data processing
• Many IoT applications have a spatial component to them
• Vehicles, cell phones, even pets… tracking is common
• In these cases both location and time is important
• Show me the vehicles that have passed by location X in the last hour
• Where has my car been over the last few hours?
• The IBM IoT engine is optimized to allow you to combine time series
and spatial data in the same query along with other data types
7 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• IoT requires the ability to recognize patterns and predict events
• Industrial IoT is reaching a point of stabilization and standardization
• Now looking for predictive analytics for anomalies and deviations
8 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Internet of Things data is highly diverse and requires an engine that
can handle any and all data types
• Can include both standard and non-standard data types, must be able to
store all kinds of data efficiently
• Char or numeric
• Time stamped data
• Spatial
• More
• Has very good horizontal scaling but must use “sharding” to achieve vertical
scaling. However, this introduces latency to the operations
10 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Other characteristics of a NoSQL engine include
• Can not enforce business rules such as referential integrity or other
constraints easily
• There are options but the end result is either more I/O to return a record or
bloated storage because all the RI’ed data is stored redundantly inside each
object
11 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• NoSQL databases are appealing to application developers because
• Object “schema” is included as an object within the data itself, not
managed separately. Allows for constant unit test and retest as logic
expands.
• “Data schema” can change quickly as business needs change
• Impact: Applications will have shorter production lives and even shorter life-
cycles
• No need to normalize or design in advance, can just wing it
• Less bureaucratic
• Stripped down IT organization
• Programmer is the DBA
12 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Another key differentiator of a NoSQL database engine is that it
doesn’t attempt to do everything a traditional database can do
• It is a bit bucket for storage and retrieval
• All processing is done at the application level
• Advantage: the NoSQL engine is pretty quick
• Disadvantage: the NoSQL engine doesn’t have administrative or
functional refinements
• For example, it doesn’t handle reusing free space well resulting in storage
bloat, if data is moved around a lot
13 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• IBM offers two types of data support for Internet of Things / NoSQL
environments
• Simple NoSQL storage and services with Cloudant
• A silo database, it can only store and retrieve NoSQL data types
• Application-based data processing only
14 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• IBM has positioned Informix as the full Internet of Things database
engine when:
• Simple NoSQL storage is not sufficient
• System of record and system of engagement data must be integrated
together
• Enterprise level rules / requirements must be applied to Internet of
Things data
15 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• The business value of this integration is two-fold
• Hybrid storage – reduces cost and complexity
• IoT and relational data stored in the same engine, in the same database, in
the same table if needed
• Both classes of app can use a single engine
• Utilize the strengths and features of both types of database engines
16 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Informix, the ideal database for application development and
deployment
• Supports all the data types and languages for rich, next-gen apps
17 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• With this functionality, the IBM message to the computing world is
simple and straightforward
18 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
19 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Let’s look at a specific use case for IoT data -- edge-of-the network
devices
• Perhaps it’s oven or other mechanical sensors, on-patient medical
devices, scientific / field data capture devices, and so on
• Reduces latency
• Intelligent gateways can detect and respond to local events as they happen
rather than waiting for transfer to the cloud
• Performs 80% of simple operations locally
• Security
• Gateways allow customers to capture and get value from their sensors without
sending data to the cloud
• Protocol consolidation
• Cloud does not need to deal with the hundreds of IoT protocols
Over time more and more of the IoT processing will move from the data center to gateway
devices
21 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What are the requirements for a gateway database?
• The database management system must:
• Have a small install footprint, less than 100 MB
• Run with low memory requirements – less than 256 MB
• Use lossless compression to minimize storage space
• Have built-in support for common types of IoT data like NoSQL, time series
and spatial / GIS data
• Simple application development supporting NoSQL, SQL, and REST
• Require absolutely no administration
• Be able to network multiple gateways together to create a single distributed
logical database
The database must be powerful enough to ingest, process and analyze data in
real-time
22 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Informix is the database for gateways, to feed cloud / on-prem large
scale operational / analytical systems
• Simple to use
• Hands-free operation – no administration
• Supports popular interfaces such as REST & MongoDB as well as traditional
SQL interfaces (ODBC / JDBC)
• Handles SQL and JSON / NoSQL data in the same database
• Seamless data replication and HA solutions to move or copy data where
needed
• High performance
• Unique support for TimeSeries and Spatial data
• Stream data continuously into the database
• Run analytics as data arrives
• Dynamically add and update analytics when needed
• Time oriented storage is typically 1/3 the size compared to other vendors
23 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
IBM Internet of Things
Flexible end-to-end analytics and data management
Streams
Analytics zone
Devices / sensors
24 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What is time oriented or “TimeSeries” exactly?
• Time series data is a series of events that occur over time that must be
recorded
• Can occur at regular intervals (every second, 5 minutes, hour etc.)
• Can occur at random times
• Can have “on” and “off” periods where events do not occur or are not recorded
25 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Conceptually, people think of time-oriented events or data as
sequential or array-like
• “A” happens first, followed by “B”, then “C” etc.
• Each event has to have its own ABC 2015-01-05 09:30:01.70000 12.54 250
26 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Problems with a relational approach
• Slow Performance
• Extremely slow data access, especially for ordered set of rows, due to the
data layout and disk I/O
• DML operations are hard or impossible to do in standard SQL
• Complex Querying
• Can be difficult to write SQL to work with the data
27 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Informix TimeSeries provides native support for TimeSeries data
• Store TimeSeries elements as an ordered set
• Uses less space because the "key" is factored out and the time field takes
either 0 (for regular) or 11 ( for irregular) bytes
• Access is faster than index-only reads
• SQL can be made much simpler
Stock Ticks
28 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• When looking at time-oriented data that can be stored in
TimeSeries, there are two components
• “header” data – the data that doesn’t change and is used to enforce
uniqueness
• One or more attributes such as: meter ID, location, meter type etc.
• This data is stored once, not redundantly
• “payload” data – the data that does vary from one captured moment in
time to another
• This data is loaded into the TimeSeries
Header Payload
Stock Ticks
29 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• TimeSeries provides a significant performance advantage
• A real world benchmark against “another database”
30 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Comparison of time series data stored in a standard relational table
and in the Informix TimeSeries table
Relational TimeSeries
Storage space Stores one row for every Significant reduction in
record. Duplicates the disk space needed to
information in non-time store the same data. The
series columns. Stores index size on disk is also
timestamps. Null data smaller.Stores all time
takes as much space as series data for a single
actual data. The index source in the same row.
typically includes the time No duplicate information.
stamp column and several Calculates instead of
other columns. stores the time stamp.
Null data does not require
any space. The index
does not include the time
stamp column.
31 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Relational TimeSeries
Query speed Data for a single source Queries that use a time
can be intermixed on criteria require many
multiple data pages in no fewer disk reads and
particular order. significantly less I/O. Data
is loaded very
efficiently.Data for a single
source is stored together
in time stamp order.
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Requirements for Advanced Analytics Functions
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Examples of Advanced Analytics Functions
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Spatiotemporal Search Functions
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• The spatiotemporal search solution builds upon the data types and
routines from the Informix TimeSeries solution and the data types,
routines, and R-tree indexes from the Informix Spatial solution.
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Spatiotemporal Search Routines (examples)
IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Another benchmark on a gateway system
1. The two figures for data loading with Informix reflect a slight difference in performance between the DK100 and
DK50. DK100 had more running components causing a drop in performance vs DK50
2. Data loading with SQLite had significant variations in load performance as the database size increased.
3. The moving average result for SQLite is a projected figure that is based on a partial result after 10 minutes.
39 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
What does a true IoT engine
look like?
40 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Informix uses a communication layer called the “wire listener” to
interface between the database engine and NoSQL applications
• Is a Java layer that can be configured as needed and can allow or
disallow application functionality
• What port number will the app connect from?
• REST or MongoDB style syntax
• Both can be used
• Allow database creation?
• Limit the size of bson objects?
• NoSQL engines are limited to 16 MB, Informix can store up to 2 GB
• Allow or disallow sharding operations
• More
Wire listener
Informix instance
NoSQL app In: 32488 DBSERVER =
Port 32488 60000
DBSERVERALIA
Out: 60001
S = 60001
41 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• With the wire listener properly configured and started, NoSQL
applications like the MongoDB Shell can connect to and use an
Informix instance for data storage / use
• There is an ifmx_stores (structured) database in the instance, is it
accessible?
42 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Using a NoSQL application against Informix
Yes it will!
43 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Using a NoSQL application against Informix
• There is a structured customer table in the database, can a NoSQL
application access data in it through the wire listener?
Yes, it can
44 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Using a NoSQL application against Informix
• Why does the wire listener act this way with structured databases and
tables?
• If the Informix database(s) and table(s) were displayed through the wire
listener like collection a NoSQL developer might try to use them as such
• Would get errors back if the data inserted / modified didn’t match the schema of the
structured table
• While databases are displayed as “empty,” at this time a developer has to know of
the existence and schema of a structured table to use it through the wire listener
• This may change in the future
45 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Using a NoSQL application against Informix
• Using SQL-passthru functionality, it is possible for a NoSQL app to
perform joins and other operations not normally supported by a simple
NoSQL engine
• Can join NoSQL, SQL or both types of data
• For example, this statement includes the use of multiple tables (could
also be collections), a join as well as a group by clause, none of
which can be executed using standard NoSQL operations
• This functionality can be used to enrich NoSQL applications if it can be
deployed securely
46 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
47 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• There are two methods to return NoSQL data through an SQL
statement, both use casting to transform the data:
• One returns the data in the defined data types, aka SQL-oriented results
48 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• The syntax is very simple
49 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• For example, using specific data types to return SQL-style results
50 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• The columns can be aliased if desired
51 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• Option 2 – use the json data type to return in key:value pairs
52 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• In the previous examples, the predicate clauses used structured data
types, e.g. where data.z_ip::int = 79925
53 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
54 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Accessing Informix NoSQL data in collections with SQL
• If there are nested fields, nest the field names in the query like with
named row types
• For example, the manager collection stored in Informix:
{
"name":"John Miller",
"age":21,
"count":27,
"employees": [
{ "firstName":"John" , "lastName":"Doe" },
{ "firstName":"Anna" , “middle”:”Marie”, "lastName":"Smith" },
{ "firstName":"Peter" , "lastName":"Jones" }
] }
55 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What about joining traditional Informix data to NoSQL data stored in
Informix
• For example, the demo stores database with NoSQL data?
• Yes and no
• It is possible, however the database locales must match
• Most NoSQL databases use UTF-8 as their default locale
• This carries over to default Informix NoSQL functionality
• Ensure that the locale is correctly configured in the database for traditional and
NoSQL objects
• A configuration parameter in the wire listener can help here
56 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• A simple example of using NoSQL and structured data together
• Question – what is the GPS location of the post offices supporting my
customers?
57 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• A simple example of using NoSQL and structured data together
• The mon_zip_info collection in the mon_test_db contains post
office location data
58 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• A simple example of using NoSQL and structured data together
• With Informix, write a query that uses both kinds of data together
• In this case, the NoSQL data is in a different database within Informix!
59 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Part of the functionality Informix provides and makes it a “true”
Internet of Things engine is the ability to integrate NoSQL and SQL
data together
• The previous example of joining a collection and a table in a statement is
one example of this functionality
60 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• In Informix, the answer is “of course you can!” because NoSQL is
‘just another data type’ like a char, int, node, timeseries and
so on
• The bson data type can used like other types when creating a table
• The bson column will store NoSQL documents like those stored in
collections
• There are a couple of nuances to be aware of however when used this way
61 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• For example, create a table that includes columns with both
structured and bson data types
62 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Can the row be queried?
• Yes, but the results will be affected by how the bson column is cast
• Without casting into a compatible type, the bson data can’t be displayed
63 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Can the row be queried?
• When cast into a compatible type, the bson data can be displayed
64 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Can the row be queried?
• While data from the structured columns can be selected from a table, is it
possible to query just the JSON data? What is the syntax?
• The syntax is exactly the same as querying from a collection
• Remember, it’s just another data type within Informix!
65 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Can the row be queried?
• What about through the wire listener and a NoSQL application, is the
data available and what is its format?
• Of course it is
• The structured columns are returned as key:value pairs as shown previously
• The bson column is returned as a JSON array type composed of key:value
pairs
66 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Continuing on, insert another row into the table
• Leveraging “dynamic elasticity”, use a different kind of data in the bson
column
• Reminder – first row had an ID along with first and last name
67 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Query the table, properly formatting the bson column
68 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
69 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
What replication options
exist?
70 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Informix is been at the forefront of providing data replication and
business continuity solutions in the IM marketplace
• NO OTHER DATA SERVER offers the breadth and depth of
technology Informix provides:
• High Availability Clustering (HA Clustering) for business continuity and
failover
• Other data servers have started to mimic portions of this functionality
• Enterprise Replication (ER) for server-driven selective distribution of
data throughout the enterprise
• No other data server offers this type of technology
• Flexible Grid (Grid) easily create small to large clusters providing, server,
database and/or data replication options
• No other data server offers this type of technology
• Sharded tables or collections (Shard) to fragment a table or collection
across multiple nodes
• Also know as “Poor man’s MPP”
71 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Informix’s replication technologies can be used together to create a
data availability or replication solution that meets customer’s needs
without expensive hardware or software add-ons
72 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Enterprise Replication (ER) for
data distribution – selective
replication
• Supports active/active updates
• Very low latency
• Selectively replicate data
• All nodes are independent and
active/active
• Flexible scalability
• Subset of data
• Local data design
• Integrated
• Compatible with other availability
solutions
• Any server can also have one or
more H/A secondary instances
• Secure data communications
73 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• With Enterprise Replication, you decide What data, gets replicated
Where and When it replicates
74 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
A preview of the lab exercises
75 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• The hands-on exercises will take you through all the steps of
• Installing
• Capturing
• Storing
• Aggregating
• Replicating into the “corporate data center”
• Could be cloud or on-prem
• Using IoT and traditional data together to produce a viable business
result
• The lab will use simple, easy-to-use technology built into Informix to
accomplish these tasks
76 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Texas Instruments SensorTags have multiple environmental
sensors built into them
• Infrared and ambient temperature, humidity, ambient light level,
barometric pressure and more
77 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Each Raspberry Pi has an Informix timeseries environment
configured and active
• You will create the database objects to capture the data
• Then using Node-RED, you will “wire” a “flow” that links the SensorTag
to the Informix environment so the temperature data is stored in the
database
• Node-RED is installed on the Raspberry Pi
78 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What is Node-RED?
• From the web site (nodered.org)
79 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What is Node-RED?
• Node-Red is a browser-based tool
• You will be using the main, “flow building” interface though there are
optional interfaces to create graphs and so on
80 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• What is Node-RED?
• For example, a node that can connect to and read an environmental
sensor is “wired” to a debug node to check connectivity and if the device
is producing data
• Using the Debug panel, you can see the sensor’s data in real-time
81 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Once you’ve verified data capture and storage, you’ll configure and
start replication between the Raspberry Pi and an Informix
environment running in the “corporate server”
82 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
• Once in the “corporate server” a simple query that joins traditional,
relational data and the replicated NoSQL, timeseries data is
executed to return an answer to a business question
• No other database can execute these types of operations
83 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
Lab on!!
84 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation
ITALIAN HINDI FRENCH JAPANESE BRAZILIAN PORTUGUESE SIMPLIFIED CHINESE
85 IoT data from network’s edge to the IBM IoT database engine © 2016 IBM Corporation