How Does TDS Handle Measurement Data Long Term?
In the TDS storage configuration section, you learn about how TDS has multiple locations for storing inspections data:
- The common database (
common-file
inside the config file) stores all template and processed inspection data. - The measurements database (
db-file
inside the config file) stores raw A-Scan measurement data. - The backup directory (
backup-dir
inside the config file) archives older A-Scan measurements into long-term storage.
Here is the relevant section of the tds-server.json
file:
"db": {
"common-file": "D://dbs//database.sqlite3",
"snapshot-dir": "C://ProgramData//tessonics//tds2//data//snapshots",
"revisions-dir": "C://ProgramData//tessonics//tds2//data//revisions",
"measurement-storage": {
"db-file": "D://dbs//measurements.sqlite3",
"backup-dir": "C://ProgramData//tessonics//tds2//data//ms-backup",
"keep-bytes": 1073741824,
"keep-count": 1048576,
"backup-bytes": 1073741824,
"backup-count": 1048576
}
},
Over time, as more inspections and measurements grow inside TDS, the backup-dir
folder increases in size drastically. If you are facing storage issues with your database, this folder is almost always the culprit.
How TDS Archives Old Measurements
Whenever an inspection is imported into TDS, the processed data is stored within the common database. Each of these inspections uses negligible storage on its own.
However, the raw A-Scan measurement data is stored within the measurements database. Once this database reaches its maximum size, it automatically archives all these measurements into a separate database file stored within the backup directory. This is controlled by two values from the above configuration:
- The
keep-bytes
field controls how many bytes of storage the measurements database may hold. - The
keep-count
field controls how many measurements the database may hold.
If the measurements database exceeds the size of keep-bytes
+ backup-bytes
, or the number of measurements stored exceeds keep-count
+ backup-count
, TDS will automatically archive these measurements.
Thus, the backup procedure does not run on a set time schedule. Instead, it runs whenever the size of the measurements database exceeds the preset maximum.
For most cases, it is unnecessary to change the default values, which constrain the measurements database to a maximum size of 1GB.
How to Save Storage
If you are running out of storage over the long term, this is the recommended procedure:
- Attach a permanent high-capacity drive with at least 1TB of storage.
- Create a folder there for backing up the measurements.
- Copy all backed-up measurements from your
backup-dir
folder into the new folder. - Change the
backup-dir
field within the configuration file to match the location of the new folder. - Restart TDS.