Databases & Caching
Production-ready databases and caching solutions for structured data, NoSQL, graph relationships, and high-performance in-memory storage.Available Services
PostgreSQL
Port: 5432 | Memory: 256 MB | Maturity: StablePowerful open-source relational database for structured data, supporting advanced SQL features, JSONB, and full-text search.Features:
- ACID compliance
- Advanced SQL support
- JSONB document storage
- Full-text search
- Foreign keys and constraints
- Mature ecosystem
- Environment:
POSTGRES_HOST,POSTGRES_PORT
Redis
Port: 6379 | Memory: 128 MB | Maturity: StableIn-memory data store for caching, session management, pub/sub messaging, and high-performance key-value operations.Features:
- In-memory speed
- Pub/sub messaging
- Sorted sets and lists
- Persistence options
- Lua scripting
- Cluster support
- Skill:
redis-cache - Environment:
REDIS_HOST,REDIS_PORT,REDIS_PASSWORD
Convex
Port: 3210 (API), 3211 (HTTP) | Memory: 256 MB | Maturity: StableSelf-hosted Convex reactive backend. Real-time database, server functions, and file storage in a single service.Features:
- Real-time reactivity
- Server functions
- File storage
- TypeScript support
- SQLite or PostgreSQL
- Mission Control required
Neo4j
Port: 7474 (HTTP), 7687 (Bolt) | Memory: 512 MB | Maturity: StableGraph database platform for connected data, enabling knowledge graphs, fraud detection, and relationship-driven queries with Cypher.Features:
- Native graph storage
- Cypher query language
- ACID transactions
- Index-free adjacency
- Graph algorithms
- Visual browser
- Environment:
NEO4J_HOST,NEO4J_BOLT_PORT,NEO4J_HTTP_PORT
Supabase
Port: 3000 (Studio), 8000 (API) | Memory: 2048 MB | Maturity: StableThe open source Firebase alternative. Build production-grade backends instantly with database, auth, storage, and edge functions.Features:
- PostgreSQL database
- Authentication
- Real-time subscriptions
- Storage
- Edge functions
- Studio dashboard
Valkey
Port: 6380 | Memory: 128 MB | Maturity: StableOpen-source, high-performance key-value store and Redis-compatible fork maintained by the Linux Foundation.Features:
- Redis compatibility
- Linux Foundation backed
- In-memory speed
- Pub/sub messaging
- Persistence
- Open governance
- Environment:
REDIS_HOST,REDIS_PORT(Redis-compatible)
Usage Examples
Full Stack Database Setup
Minimal Cache + Database
Backend Platform
Database Comparison
| Database | Type | Use Case | ACID | Memory | Maturity |
|---|---|---|---|---|---|
| PostgreSQL | SQL | Structured data, complex queries | ✅ | 256 MB | Stable |
| Redis | Key-Value | Caching, sessions, pub/sub | ⚠️ | 128 MB | Stable |
| Convex | Real-time | Reactive apps, server functions | ✅ | 256 MB | Stable |
| Neo4j | Graph | Relationships, knowledge graphs | ✅ | 512 MB | Stable |
| Supabase | Platform | Full backend, auth, storage | ✅ | 2048 MB | Stable |
| Valkey | Key-Value | Redis alternative, caching | ⚠️ | 128 MB | Stable |
Architecture Patterns
Layered Caching
Graph + Relational Hybrid
Real-Time Backend
Performance Optimization
PostgreSQL
- Indexes: Create indexes on frequently queried columns
- Connection Pooling: Use PgBouncer for connection management
- Partitioning: Partition large tables by date or key
- JSONB: Use JSONB for semi-structured data
- Vacuum: Configure autovacuum appropriately
Redis
- Memory Management: Set
maxmemoryand eviction policies - Persistence: Choose RDB or AOF based on needs
- Key Naming: Use consistent key naming conventions
- Expiration: Set TTLs on cached data
- Pipeline: Use pipelining for bulk operations
Neo4j
- Indexes: Create indexes on frequently queried properties
- Constraints: Use constraints for data integrity
- Query Optimization: Use EXPLAIN for query analysis
- Batch Imports: Use LOAD CSV or batch APIs
- Memory Configuration: Tune heap and page cache
Data Persistence
Volumes
All databases use Docker volumes for persistence:Backup Strategies
PostgreSQL Backups
Redis Backups
Neo4j Backups
Security Best Practices
Authentication
- Strong Passwords: Generate random passwords for production
- Environment Variables: Store credentials in
.env - Network Isolation: Use Docker networks
- Connection Limits: Configure max connections
- SSL/TLS: Enable encrypted connections in production
Access Control
- User Roles: Create separate users with minimal permissions
- Database Isolation: Use separate databases per service
- Network Policies: Restrict database ports to internal network
- Audit Logs: Enable logging for security events
- Regular Updates: Keep database images updated
Integration Patterns
Application Stack
AI + Database
Full Platform
Monitoring
Monitor database health with:- Grafana + Prometheus: Metrics dashboards
- Health Checks: Built-in Docker health checks
- Logs: Access via
docker logs - Query Performance: Enable slow query logs