Logo docs

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#

  1. Storage Configuration - Configure storage backend
  2. Configuration Reference - All database options
  3. High Availability - PostgreSQL/MySQL for HA
  4. Operations Guide - Backup strategies

Related Documentation#