The IBM® Cloud Databases for PostgreSQL data component provides intermediate length storage of your IoT data.
Databases for PostgreSQL is a database for your recent historical IoT data.
Databases for PostgreSQL also makes up the data lake, which is used as input for the analytics service. Analytics Service writes function output to the data lake.
Platform Service collects and retains IoT data for direct access and processing and also for historical storage and analytics with Platform Service.
The following steps constitute the data flow:
iot_devicetype
).Access information and credentials for the Databases for PostgreSQL user interface and REST API can be found on the user interface. For detailed steps, see the Get Databases for PostgreSQL credentials section.
In addition, to store IoT data from your connected devices in Databases for PostgreSQL, your environment must meet the following requirements:
The following requirements apply to messaging and to your Maximo Asset Monitor instance.
null
value support.$exists($event.property) ? $event.property : {payload_value}
.property
is the name of the property that you are modifying.$exists
checks if the property exists in the payload.{payload_value}
is the default value that you want to send if the property is missing from the actual payload, for example: "String"
, -9999
null
null
as a supported data type for the property.null
support configuration must be done by using the HTTP API, which is protected with HTTP basic authentication
and require an API key and authentication token. For more information about API keys and tokens, see API key connection.
"property": "string"
to "property": ["string", "null"]
off
.The following requirements apply to your Databases for PostgreSQL instance.
devicetype
deviceid
logicalinterface_id
eventtype
format
rcv_timestamp_utc
updated_utc
The following default configuration settings are used:
In Databases for PostgreSQL, IoT device data is stored as tables. Maximo Asset Monitor automatically creates all schemas and tables to manage all data insertion.
All user-accessible IoT data is stored in tables according to device type and uses the following naming convention: iot_devicetype
.
The following tables are available:
Table | Details |
---|---|
iot_devicetype |
This device type main table contains all device data for the current schema. |
iot_devicetype_v+timestamp |
These tables are automatically created when the schema is updated and contain data for the replaced schema, which is identified by the time stamp. For more information, see the Requirements section. |
Tip: All tables use the Cloudant NoSQL DB '_ID' parameter as the primary key.
The following identifiers are used in the previous table:
The iot_devicetype
tables are used by and controlled by Platform Service and must not be the target for any SQL operations except QUERY.
The following Platform Service logical interface driven schema upgrades can be automatically merged in Databases for PostgreSQL:
All user-accessible Analytics Service data is stored in tables according to device type and uses the following naming convention: dm_entity_grainid
.
The following tables are available:
Table | Details |
---|---|
dm_entity_grainid |
The derived metrics table that contains the output of a function at a certain grain. |
The following identifiers are used in the previous table:
device
is the device type for which derived metric data is stored. For entities that are based on IoT devices the device
part of the table name corresponds to the device type (DEVICETYPE).The Analytics Service tables are used by and controlled by IBM Maximo Asset Monitor and must not be the target for any SQL operations except QUERY.
Use an external database tool or the Databases for PostgreSQL API to extract and process the IoT data that you need. For more information about service API access, see REST APIs.
Tip: with the Analytics Service, you can access PostgreSQL data directly from the data lake with the Monitor dashboard, and use it as input for analytics functions.
In the Maximo Asset Monitor user interface, click View Details for the Databases for PostgreSQL service to get the following parameters. These parameters are required to connect to and retrieve IoT data from the database:
ibmcloudunique_identifier
15645 ... bb201
ibmclouddb
public
unique_identifier.databases.appdomain.cloud
.50000
MIIDD ... Q3oaUA==
For more information about Databases for PostgreSQL authorization and how to provide credentials in API calls, see Databases for PostgreSQL documentation.
Use an external database tool to connect to Databases for PostgreSQL and access your data. You can also access the data by using the API.
Databases for PostgreSQL recommends the PGAdmin tool. For more information, see the Administration Tools section of the Databases for PostgreSQL documentation.
To explore your IoT data, complete the following steps:
iot_devicetype
tables. dm_entity+grain
tables.The iot_devicetype
tables are used by and controlled by IBM Maximo Asset Monitor and must not be the target for any SQL operations except QUERY.
If your plan includes the Analytics Service add-on, the Monitor tab lets you derive key performance indicators (KPIs) from device data by using the built-in analytics functions. Line-of-business users can easily enrich and interact with the raw metrics data that comes from IoT entities by using the built-in configurable analytics functions. Data scientist developers can extend and customize the standard functions by using a set of APIs.
For more information, see the following Databases for PostgreSQL documentation topics: