Storage layer
Chive uses multiple specialized databases, each optimized for different access patterns:
| Database | Purpose | Documentation |
|---|---|---|
| PostgreSQL | Primary data store for eprints, reviews, profiles | PostgreSQL |
| Elasticsearch | Full-text search, faceted navigation | Elasticsearch |
| Neo4j | Knowledge graph, citations, field hierarchy | Neo4j |
| Redis | Caching, rate limiting, sessions | Redis |
Architecture
All storage adapters implement consistent interfaces for dependency injection:
interface IStorageBackend {
connect(): Promise<void>;
disconnect(): Promise<void>;
healthCheck(): Promise<boolean>;
}
Data flow
- Write path: Firehose events → Services → PostgreSQL → Async sync to ES/Neo4j
- Read path: API → Services → PostgreSQL/ES/Neo4j (based on query type)
- Cache: Redis sits in front of expensive queries
See also
- Core services - How services use storage adapters
- Observability - Database monitoring and metrics