Databases Overview
Database Stack
The infrastructure includes multiple database systems, each chosen for specific use cases.
graph TB
subgraph Applications
Hub[Hub API]
Parquet[Parquet API]
end
subgraph databases namespace
Mongo[(MongoDB)]
Influx[(InfluxDB)]
MySQL[(MySQL)]
end
subgraph monitoring namespace
ES[(Elasticsearch)]
end
Hub --> Mongo
Hub --> Influx
Hub --> ES
Parquet --> Mongo
Database Comparison
| Database |
Type |
Use Case |
Port |
| MongoDB |
Document |
Application data |
27017 |
| InfluxDB |
Time Series |
Metrics, telemetry |
8086 |
| MySQL |
Relational |
Structured data |
3306 |
| Elasticsearch |
Search/Analytics |
Logs, search |
9200 |
Storage Requirements
| Database |
Storage Class |
Capacity |
| MongoDB |
longhorn |
50Gi |
| InfluxDB |
longhorn |
100Gi |
| MySQL |
longhorn |
20Gi |
| Elasticsearch |
longhorn |
100Gi |
Connection Patterns
Internal Connections
All databases use ClusterIP services:
mongodb.databases.svc.cluster.local:27017
influxdb.databases.svc.cluster.local:8086
mysql.databases.svc.cluster.local:3306
elasticsearch.monitoring.svc.cluster.local:9200
Connection Pooling
| Database |
Pool Size |
Timeout |
| MongoDB |
100 |
30s |
| MySQL |
25 |
15s |
| InfluxDB |
10 |
10s |
Backup Strategy
Backup Schedule
| Database |
Frequency |
Retention |
| MongoDB |
Daily |
7 days |
| MySQL |
Daily |
7 days |
| InfluxDB |
Weekly |
4 weeks |
| Elasticsearch |
Daily |
7 days |
Backup Methods
| Database |
Method |
| MongoDB |
mongodump |
| MySQL |
mysqldump |
| InfluxDB |
influxd backup |
| Elasticsearch |
Snapshot API |
High Availability
Current Configuration
| Database |
Replicas |
HA Status |
| MongoDB |
1 |
Standalone |
| InfluxDB |
1 |
Standalone |
| MySQL |
1 |
Standalone |
| Elasticsearch |
1 |
Standalone |
Future HA Options
- MongoDB: Replica Set (3 nodes)
- MySQL: Galera Cluster
- InfluxDB: Enterprise clustering
- Elasticsearch: Multi-node cluster
Monitoring
Key Metrics
| Metric |
Alert Threshold |
| Connection count |
>80% max |
| Query latency |
>1s p95 |
| Storage usage |
>80% |
| Replication lag |
>10s |
Dashboards
- MongoDB performance
- InfluxDB metrics
- MySQL statistics
- Elasticsearch cluster health
Security
Authentication
| Database |
Auth Method |
| MongoDB |
SCRAM-SHA-256 |
| InfluxDB |
Token-based |
| MySQL |
Native password |
| Elasticsearch |
Native realm |
Network Policies
Databases are isolated to the databases namespace with explicit allow rules for authorized namespaces.
Maintenance
Regular Tasks
| Task |
Frequency |
| Vacuum/Compact |
Weekly |
| Index optimization |
Monthly |
| Log rotation |
Daily |
| Backup verification |
Weekly |