Use OCI Object Storage to Store Historical IoT Data

The Oracle Cloud Infrastructure (OCI) Object Storage service is an internet-scale, high-performance storage platform that offers reliable and cost-efficient data durability. If you have a subscription for OCI Object Storage, you can use it to store your IoT sensor and analytics data for long-term persistence.

You can learn more about OCI Object Storage here:

Use the following steps to add and configure your external OCI Object Storage:

  1. Add an Oracle Cloud Account
  2. Connect to an OCI Object Storage Instance
  3. Add and Configure Your External OCI Object Storage Integration

Add an Oracle Cloud Account

Use the Settings > Integrations page in your IoT application to configure an Oracle Cloud account. This Oracle Cloud account is used when specifying integration settings, such as OCI Object Storage settings.

  1. In your IoT application, click Menu (Menu icon), and then click Settings.
  2. Click Integrations.
  3. Click Add Add icon to add a new integration.
  4. In the Add Integration dialog, select Oracle Cloud Account and click Add.
    Tip: You can also search for an integration name in the list.

    Add Integration dialog with Oracle Cloud Account selected

    Oracle Cloud Account integration gets added to the Integrations page.
  5. Under Oracle Cloud Account, add your cloud account details:
    1. Enter your Tenant OCID.
      The tenancy details are available from the Oracle Cloud Infrastructure Console. You need to log in to your Oracle Cloud Infrastructure Console. From the Profile menu, click Tenancy: <YourTenancyName>.
      The tenancy OCID is shown under Tenancy Information. Click Copy to copy it to your clipboard.

      Tenant OCID

      Paste this value under Tenant OCID in your IoT application.
    2. Enter the User OCID.
      The user details are available from the Oracle Cloud Infrastructure Console. You need to log in to your Oracle Cloud Infrastructure Console. From the Profile menu, click User Settings.

      The user OCID is shown under User Information. Click Copy to copy it to your clipboard.

      Paste this value under User OCID in your IoT application.
    3. Under Public Key, click Generate.
    4. Click Close.
  6. Set the public key in OCI Object Storage.
    1. On the Settings>Integration page of your IoT application, under Oracle Cloud Account, click Copy against Public Key to copy the public key that you generated earlier.
    2. Log in to your Oracle Cloud Infrastructure Console.
    3. Under the Profile menu, click User Settings.
    4. Click API Keys under Resources.
    5. Click Add Public Key.
      Note: If three public keys are already listed under API Keys, you have to first delete one public key. An OCI Object Storage service user can't have more than three public keys.
    6. Select Paste Public Keys and paste the key that you copied from your IoT application.
    7. Click Add.
      The fingerprint for the added public key appears under API Keys. The fingerprint should be the same as that displayed on the Settings page of your IoT application.

Connect to an OCI Object Storage Instance

Use the Integrations page in your IoT application to configure OCI Object Storage connection details and to enable Object Storage.

Before configuring the OCI Object Storage connection, you should have already added your Oracle Cloud account on the Settings page.
  1. In your IoT application, click Menu (Menu icon), and then click Settings.
  2. Click Integrations.
  3. Click Add Add icon to add a new integration.
  4. In the Add Integration dialog, select Oracle Object Storage Service and click Add.
    Tip: You can also search for an integration name in the list.
    Oracle Object Storage integration gets added to the Integrations page.
  5. On the Integrations page, under Object Storage Service, click Connect.
  6. In the Oracle Object Storage dialog, provide your object storage connection details.
    1. Enter the Storage URL for your OCI Object Storage.
      For example, https://objectstorage.us-phoenix-1.oraclecloud.com.
    2. Enter the object storage Namespace for your tenancy.
      You can find the object storage namespace in your Oracle Cloud Infrastructure Console. You need to log in to your Oracle Cloud Infrastructure Console. From the Profile menu, click Tenancy: <YourTenancyName>.
    3. Enter the Default Bucket name that stores the data.
      The bucket name must already exist in your OCI Object Storage instance.
    4. Click Verify Connectivity to verify the connection details and bucket name.
    5. Click Save to save the OCI Object Storage connection details.
  7. To enable the connection on the Integrations page, click Edit Configuration under Oracle Object Storage.
  8. Toggle the Integration Status switch to ON, and click Save.

Add and Configure Your External OCI Object Storage Integration

To start storing IoT historical data in your OCI Object Storage, add and configure a new integration for External Data Storage (Oracle Object Storage).

Note:

You should have already added an Oracle Cloud account and specified the connection settings for your OCI Object Storage instance.

  1. In your IoT application, click Menu (Menu icon), and then click Settings.
  2. Click Integrations.
  3. Click Add Add icon to add a new integration.
  4. In the Add Integration dialog, select External Data Storage (Oracle Object Storage) and click Add.
    Tip: You can also search for an integration name in the list.

    Add Integration Dialog (described in Steps)

    Note:

    You can only have one external data storage integration at a time. So, you cannot add both Oracle Autonomous Database and Oracle Object Storage integrations at the same time. If you need to switch from Oracle Autonomous Database integration to Oracle Object Storage, you should first remove the Oracle Autonomous Database integration from the Integrations page.
    The External Data Storage (Oracle Object Storage) integration gets added to the Integrations page.
  5. On the Integrations page, under External Data Storage (Oracle Object Storage), click Edit Configuration.
    1. Optionally enter a File Prefix.
      Your IoT application prefixes the specified File Prefix to the file names that it stores in OCI Object Storage. This helps with easy identification of files.
    2. The Default Bucket is pre-populated with the bucket that you have used in your Object Storage connection settings.
    3. Optionally change the Export Interval if you want your application to write more frequently to OCI Object Storage.
      The default data export interval is 4 Hours.
    4. Select the IoT data that you wish to store externally:
      • Attributes: You can choose to export all raw sensor attribute data. Alternatively, you can choose to export only aggregated attribute data, which exports aggregates, such as Average, Maximum, and Minimum values of your attribute values. Under Attributes Granularity Level, select Aggregated to export only aggregated attribute data. Under Attributes Granularity Level Interval , specify the aggregation interval. This determines the frequency at which the aggregated values are calculated.

        If you select None (raw data), then all raw sensor data is exported.

      • Metrics: Select to export metric data corresponding to system metrics and computed metrics.

      • Anomalies: Select to export anomaly data.

      • Predictions: Select to export prediction data.

      • Trends: Select to export data related to trends.

      • Incidents: Select to export your rule incidents.
      • Warnings:Select to export your rule warnings.
    5. Toggle the Integration Status switch to Enabled.
  6. Click Save to save your configuration settings.