Use PostgreSQL v16 with TimescaleDB
Database layout
- Single database
cryostats
- One table per function
temperatures
states
- Setup benefits:
- Easy to setup downsampling operations on each individual schema — might want different downsamping for state vs temperatures
- Easy to query full list of cryostat names (e.g. for temperatures)
- If there ends up being more than state/temperatures later, can just add a new schema
- Having everything in a private database means if you want to use it you just start with a fresh one. Also it’s easy to copy JUST the cryostat data
Database users
- Admin / superuser responsible for
- Read-only user
viewer
(for e.g. grafana / backup) - Read + write user
- Unable to delete/update lines
Uploading to the database
- Each cryostat has a python process which exposes a JSON file via HTTP:
temperatures
"40K" = 57.6
"4K" = 3.7
states
"1k" = "heat_switch_cooling"
- A “collection” server handles uploading the data to the database
- It has a list of cryostats like
hpd = 132.163.100.100:4000
- It scans through the cryostat IPs and uploads the latest data
- It has a list of cryostats like
Python functions needed
- Upload new data
- Create new cryostat tables (+ add permissions)
- Download a time range of data (with downsampling)
- Dump table (for backup/testing purposes)
Other notes
- Run on Proxmox
- Backup with borgmatic