docs: initial prototype of the db schema

This commit is contained in:
Даниил 2025-02-24 19:59:42 +04:00
parent c7ec61994b
commit 9c8987f5b1
Signed by: nm17
GPG key ID: 3303B70C59145CD4

View file

@ -1,17 +1,29 @@
# Архитектура KV DB (Dragonfly) # Архитектура KV DB (Dragonfly)
- `apikey_{apikey}` - `apikey_{apikey}`
- API ключ для приложений
- Поля - Поля
- `owner` - `owner`
- Имеет время окончания - Имеет TTL
- `devices_{device_id}` - `devices_{device_uuid}`
- Поля
- Вся информация о девайсе
- `devices_{device_id}_{tai_timestamp}_{sensor_id}`
- Только значение
- `devices_{device_id}`
- Поля - Поля
- `exists`: bool - `exists`: bool
- `tls_only`: bool
- `mtls_only`: bool
- `lat`: decimal
- `long`: decimal
- `alt`: decimal
- `devices_{device_uuid}_sensor{sensor_mac}_{tai_timestamp}`
- Только значение
- `devices_{device_uuid}_{sensor_mac}`
- Поля
- `unit`: str - `unit`: str
- `devices_{device_uuid}_commands`
- `devices_mac{device_mac}`
- Маппинг до device_uuid
- `users_{user_uuid}`
- username: string
- password_hash: string
!!!! Убедитесь что в переменных ключей нет `_` !!!! !!!! Убедитесь что в переменных ключей нет `_` !!!!