Notification Database
Overview
PostgreSQL database storing notification preferences, delivery logs, and notification history for audit and analytics.
Database Schema
user_preferences- Per-user notification preferenceschannel_settings- Email, push, Slack channel configsquiet_hours- Do-not-disturb schedulesmuted_entities- Muted tasks, projects, users
notifications- Notification recordsnotification_recipients- Who should receive notificationsnotification_batches- Grouped digest notificationsnotification_templates- Message templates
delivery_log- Delivery attempts and statusdelivery_failures- Failed deliveries for retryunsubscribe_requests- Opt-out records
Retention: Delivery logs 90 days, preferences indefinite
Technical Details
Specifications:
- Version: PostgreSQL 15.x
- Size: 200 GB
- Backup: Daily full backup
- Replication: Multi-AZ with 1 read replica
- Encryption: AES-256 encryption at rest, TLS 1.3 in transit
Performance:
- IOPS: 5,000 provisioned
- Connections: Max 200 concurrent
- Query Performance: P95 < 50ms
- Write Throughput: 2,000 writes/second
- Uptime SLA: 99.9%
Data Management
📊 Data Retention
Delivery logs automatically archived after 90 days, preferences stored indefinitely.
-
Active Data
Recent notifications and delivery logs (90 days)
-
Archival
Older delivery logs moved to cold storage
-
Preferences
User preferences retained indefinitely
-
Cleanup
Automated cleanup jobs for old batches
Access Patterns
- Notification Service: Read/write preferences, write delivery logs
- Email Service: Read templates and preferences
- Analytics Service: Read delivery metrics
- User Settings API: Read/write user preferences
Disaster Recovery
- RPO: 24 hours (maximum data loss)
- RTO: 4 hours (recovery time objective)
- Backup Retention: 30 days
- Geographic Redundancy: Single region (non-critical data)