Skip to content
SENS Platform Docs

Data Model

This document describes the initial conceptual data model.

The final schema will be defined through SQL migrations.

Represents a hard data and security boundary.

Represents flexible nested customer structure inside a tenant.

Represents a human user.

Connects a user to a tenant, organization unit, and role.

Represents a sensor or telemetry-producing device.

For LoRaWAN devices, DevEUI is a key external identity.

Represents LoRaWAN gateway infrastructure.

Gateways are separate from devices because they have different lifecycle and meaning.

Represents a category of device and links to decoder behavior.

Represents a versioned decoder implementation.

Represents a raw message received from the Network Server.

Default retention: approximately one month.

Represents decoded telemetry.

Default retention: at least five years.

Represents an asynchronous CSV export request.

Represents security-relevant or operationally relevant administrative actions.

A physical sensor can be replaced while the business measurement point may remain the same.

This means the platform may eventually need to distinguish:

  • Physical device.
  • Device identity.
  • Measurement point or asset.
  • Organization assignment.

V1 may start with device-centric modeling but must not make later separation impossible.

Devices may change tenant or organization assignment.

The data model must preserve historical correctness for telemetry visibility and exports.

The exact historical assignment model is an open design decision.

One payload may decode into multiple measurements.

Example measurement keys:

  • temperature
  • battery
  • counter_value
  • humidity

Some values are cumulative counter values.

Decoder output should preserve enough information to interpret whether a value is a counter, gauge, status, or event.

Raw payloads:

  • Approximately one month.

Normalized measurements:

  • At least five years.
  • Architecture should allow seven to eight years.

Audit logs:

  • Retention to be decided.

Exports:

  • Export files and metadata retention to be decided.
  • Final schema.
  • Historical device assignment model.
  • Measurement table shape.
  • Whether measurement keys are fully dynamic or constrained by device type.
  • Export file storage location.
  • Backup and restore target RPO/RTO.