Database Management
Database Configuration
PlantPulse AI uses six databases, each serving a different purpose.
| Database | Purpose | Data Type |
|---|---|---|
| PostgreSQL | Relational metadata | User information, chat history, RAG metadata, feature store |
| Cassandra | Time series storage | Sensor data, copilot tasks, inference history |
| Neo4j | Graph data | Ontology (plant hierarchy, equipment relationships) |
| Qdrant | Vector storage | Document embeddings, equipment feature vectors |
| Valkey (Redis) | Cache | Sessions, temporary data, search cache |
| MinIO | Object storage | Document files, images, reports |
PostgreSQL
Database List
| Database | User | Service Using It |
|---|---|---|
ch | ch | AI Chat Web (users, chat history, apps, settings) |
lightrag | ch | LightRAG (document status doc_status) |
Management
# PostgreSQL 접속
psql -h 127.0.0.1 -U ch -d ch
# 데이터베이스 목록 확인
psql -h 127.0.0.1 -U postgres -c '\l'
Cassandra
Keyspaces
| Keyspace | Purpose |
|---|---|
pi | PlantPulse AI main (copilot tasks, inference history) |
Management
# Cassandra CQL 접속
cqlsh 127.0.0.1 9042 -u cassandra -p cassandra
# 키스페이스 목록
DESCRIBE KEYSPACES;
# 테이블 목록
USE pi;
DESCRIBE TABLES;
info
The Cassandra keyspace is created automatically by the db/cassandra/support/keyspace-create.sh script on first startup.
Neo4j
Connection Information
| Item | Value |
|---|---|
| Browser URL | http://<Server IP>:7474 |
| Bolt URI | bolt://127.0.0.1:7687 |
| User | neo4j |
| Password | neo4j123 |
Management
Manage the graph with Cypher queries in Neo4j Browser (http://<Server IP>:7474):
// 노드 타입별 카운트
MATCH (n) RETURN labels(n), count(n) ORDER BY count(n) DESC;
// 관계 타입별 카운트
MATCH ()-[r]->() RETURN type(r), count(r) ORDER BY count(r) DESC;
Qdrant
Connection Information
| Item | Value |
|---|---|
| REST API | http://127.0.0.1:6333 |
| Dashboard | http://127.0.0.1:6333/dashboard |
| API Key | qdrant-key-123 |
Collections
| Collection | Purpose |
|---|---|
| (auto-created by LightRAG) | RAG document vectors (managed by LightRAG) |
MinIO
Connection Information
| Item | Value |
|---|---|
| API | http://127.0.0.1:9000 |
| Console | http://127.0.0.1:9001 |
| Access Key | minio |
| Secret Key | minio123! |
Buckets
| Bucket | Purpose |
|---|---|
documents-bucket | Storage for original RAG documents |
Data Storage Paths
| Path | Contents |
|---|---|
/data1/pp-data/ | Main data directory |
/data1/pp-data/lightrag/ | LightRAG storage (index, uploads) |
/data1/pp-temp/ | Temporary files |
Backup Recommendations
| Target | Method | Frequency |
|---|---|---|
| PostgreSQL | pg_dump | Once daily |
| Neo4j | neo4j-admin dump | Once daily |
| MinIO | mc mirror | Once daily |
| Qdrant | Snapshot API | Once weekly |
template/env.sh | File copy | On change |