Database Model
This document explains where and how the gateway stores data. Refer to it when adjusting retention periods, managing disk space, or querying data directly.
Edge stores its data in a local Cassandra(127.0.0.1:9042, keyspace PE).
This is separate from the Cassandra instance on the upper Platform (pp) — it is the gateway's own storage to keep collecting even when disconnected from the platform.
There are only 11 tables, divided into two categories.
| Prefix | Purpose |
|---|---|
APP_ | Configuration — what to collect |
TM_ | Time series and operational logs — collected data and collection history |
APP_ — Collection Configuration
Everything created on the UI (Connection · Tag) is stored here as-is.
| Table | Content |
|---|---|
APP_OPC | Connection definition — OPC_ID · name · protocol (OPC_TYPE) · target IP/port · collection interval (TIMECYCLE) · auto-collection flag |
APP_TAG | Tag definition — address to read and data type |
Time series can be recollected, but configuration is human-made and cannot be recovered. Do not leave these two tables out of your backup → Backup.
TM_ — Collected Values and Operational Logs
| Table | Content |
|---|---|
TM_TAG_POINT | Raw collected values — the core of this storage |
TM_TAG_POINT_ARCHIVE | Archival copy |
TM_TAG_ERROR | Per-tag collection errors |
TM_TAG_STAT | Per-tag statistics |
TM_TAG_WRITE | Write (control) history |
TM_OPC_STAT | Per-connection statistics |
TM_PLC_PING | Target equipment response confirmation history |
TM_MONITOR | Gateway resource and status |
TM_API_LOG | REST API call log |
TM_TAG_POINT Structure
PRIMARY KEY (TAG_ID, TIMESTAMP)
WITH CLUSTERING ORDER BY (TIMESTAMP DESC)
| Property | Value |
|---|---|
| Partition key | TAG_ID — one tag per partition |
| Clustering | TIMESTAMP descending — reads from most recent first |
| Columns | VALUE · QUALITY · ERROR_CODE · TYPE · ATTRIBUTE (map) |
| Compaction | TimeWindowCompactionStrategy, 10-minute window |
The gateway only writes, reads briefly, and discards via TTL. By grouping SSTables into time windows, it can drop entire expired windows with almost no compaction cost.
Retention Period — The Number Appears in Two Places
scheme.cql has default_time_to_live of 30 days (2592000 seconds), but at startup
the table TTL is ALTER TABLE with the edge.ttl value from app.properties, overriding it.
The factory default is edge.ttl = 60 (days), so actual retention is 60 days.
Do not conclude it is 30 days by looking at the schema file alone.
To change it, edit edge.ttl and restart.
cd /opt/kopens/plantpulse-edge/bin
./config.sh --get edge.ttl
./config.sh --set edge.ttl 90
./config.sh --restart # 기동 시 ALTER TABLE 로 반영된다
If you reduce the TTL, data older than the new TTL will be reclaimed on the next compaction. This cannot be undone. If you are reducing it due to disk pressure, verify that required historical data has been sent to the upper platform before making the change.
When Disk Space Runs Out
Capacity is determined by number of tags × collection interval × retention days. You must reduce one of these three.
| What to adjust | How |
|---|---|
| Retention days | Reduce edge.ttl (see above) |
| Collection interval | Increase TIMECYCLE on the connection — keep only tags that truly need per-second collection |
| Number of tags | Disable auto-collection on unused tags |
For diagnostics, see Diagnostics.
Related Documentation
- Backup — what you must capture
- app.properties Guide — keys including
edge.ttl - Monitoring
- Point Search — querying time series from the UI