Database
PostgreSQL serves as the authoritative store for application data, providing ACID guarantees, mature replication capabilities, and enterprise-proven reliability for mission-critical digital asset operations.
Overview
PostgreSQL provides persistent storage for all DALP application data. This includes user accounts, asset configurations, indexed blockchain state, workflow state, and audit records. PostgreSQL's maturity, reliability, and extensive ecosystem make it the foundation for data persistence.
Enterprise deployments require proven database technology. PostgreSQL represents decades of production hardening at scale. Major financial institutions trust PostgreSQL for mission-critical workloads. DALP benefits from this maturity and the extensive expertise available in the market.
Data domains
| Domain | Content | Characteristics |
|---|---|---|
| Identity | Users, roles, sessions | High read, moderate write |
| Configuration | Asset definitions, system settings | Low volume, high importance |
| Indexed state | Blockchain-derived data | High volume, append-heavy |
| Workflow | Execution engine state | Moderate volume, frequent updates |
| Audit | Activity logs, compliance records | High volume, append-only |
Schema organization
Schemas partition data by domain for organizational clarity and access control:
dalp_identity - Authentication and authorization
dalp_assets - Asset configuration and metadata
dalp_indexed - Chain indexer output
dalp_workflows - Execution engine state
dalp_audit - Audit and compliance logsSchema-level permissions enable principle of least privilege. Components access only schemas required for their function.
High availability
Production deployments implement high availability through PostgreSQL replication:
Synchronous replication: Write operations confirm only after replica acknowledgment. Zero data loss during primary failure.
Read replicas: Query workloads distribute across replicas. Primary handles writes exclusively.
Automatic failover: Patroni or cloud-managed failover promotes replica to primary during outages.
Backup strategy
Data protection implements multiple backup layers:
| Method | Frequency | Retention | Recovery time |
|---|---|---|---|
| Streaming replication | Continuous | Real-time | Minutes |
| Point-in-time recovery | Continuous | 30 days | Hours |
| Full backups | Daily | 90 days | Hours |
| Archive storage | Weekly | 7 years | Days |
Point-in-time recovery enables restoration to any moment within the retention window. This capability supports compliance investigations and operational recovery scenarios.
Performance optimization
Connection pooling
PgBouncer pools database connections, reducing connection overhead and enabling higher concurrency than direct connections support.
Query optimization
Schema design anticipates query patterns. Indexes cover common filter and join operations. Query analysis guides ongoing optimization.
Partitioning
High-volume tables partition by time or tenant. Partition pruning reduces scan scope for bounded queries. Partition management automates retention enforcement.
Caching
Application-level caching reduces database load for repeated queries. Cache invalidation coordinates with database transactions for consistency.
Security
Encryption
At rest: Storage encryption protects data on disk. Managed deployments use cloud provider encryption with customer-managed keys.
In transit: TLS encrypts all database connections. Certificate verification prevents connection interception.
Access control
Role-based access restricts database operations to authorized components. Service accounts receive minimum necessary privileges. Administrative access requires multi-factor authentication.
Audit logging
PostgreSQL audit logs capture all data access. Log retention satisfies compliance requirements. SIEM integration enables security monitoring.
Managed deployment options
| Provider | Service | Key features |
|---|---|---|
| AWS | RDS PostgreSQL | Multi-AZ, automated backups |
| GCP | Cloud SQL | High availability, private networking |
| Azure | Azure Database | Geo-replication, compliance certifications |
| Self-managed | Patroni cluster | Full control, any infrastructure |
See also
- Chain Indexer for indexed data
- Observability for database monitoring
Observability
The observability stack provides comprehensive visibility into platform operations through metrics collection, log aggregation, distributed tracing, and pre-built dashboards for proactive monitoring and rapid incident response.
Failure Modes
Catalog of architecture-level failure modes across DALP components, documenting degradation behavior, detection mechanisms, and recovery strategies for each failure scenario.