Database
Database Configuration#
Configure ncps database backends: SQLite, PostgreSQL, or MySQL/MariaDB.
Overview#
ncps supports three database backends for storing metadata (NarInfo, cache statistics, etc.):
- SQLite: Embedded database, no external dependencies
- PostgreSQL: Production-ready, concurrent access support
- MySQL/MariaDB: Production-ready, concurrent access support
Quick Comparison#
| Feature | SQLite | PostgreSQL | MySQL/MariaDB |
|---|---|---|---|
| Setup Complexity | None (embedded) | Moderate | Moderate |
| External Service | ❌ No | ✅ Yes | ✅ Yes |
| Concurrent Writes | ❌ Limited (1 connection) | ✅ Excellent | ✅ Excellent |
| HA Support | ❌ Not supported | ✅ Supported | ✅ Supported |
| Performance | Good (embedded) | Excellent | Excellent |
| Best For | Single-instance | HA, Production | HA, Production |
Next Steps#
- Storage Configuration - Configure storage backend
- Configuration Reference - All database options
- High Availability - PostgreSQL/MySQL for HA
- Operations Guide - Backup strategies
Related Documentation#
- Configuration Reference - All configuration options
- High Availability Guide - HA database setup
- Backup and Restore Guide - Backup strategies