Database Management Guide: Monitoring, Scaling & Optimization | Nife Docs
Monitor your databases, scale resources, perform updates, and maintain performance.
Accessing Database Management#
From Dashboard#
- Go to Databases page
- Click database name
- See management options
Available Options#
- Overview: Database status and metrics
- Performance: Metrics and monitoring
- Backups: Backup management
- Settings: Configuration options
- Logs: Activity and error logs
Monitoring Performance#
Key Metrics#
CPU Usage
- Percentage of CPU being used
- Green (< 70%): Healthy
- Yellow (70-85%): Monitor
- Red (> 85%): Performance issue
Memory Usage
- Percentage of RAM used
- Green (< 70%): Healthy
- Yellow (70-80%): Monitor
- Red (> 80%): Scale needed
Disk Usage
- Percentage of storage used
- Green (< 70%): Healthy
- Yellow (70-80%): Plan scaling
- Red (> 90%): Critical, scale immediately
Connections
- Current active connections
- Compare to max connections
- If near limit, scale up
Query Performance
- Average query time
- Slow queries count
- Long-running queries
Reading the Dashboard#
Healthy Database:
- CPU < 70%
- Memory < 70%
- Disk < 80%
- Few slow queries
- Active connections normal
Warning Signs:
- CPU > 85% consistently
- Memory > 80%
- Disk > 85%
- Many slow queries
- Connection limit approaching
Critical Issues:
- CPU at 100%
- Memory at 100%
- Disk > 95%
- Queries failing
- Connection refused errors
Scaling Your Database#
Vertical Scaling (More Power)#
Increase CPU and memory:
When to scale:
- CPU consistently > 80%
- Memory consistently > 80%
- Queries getting slow
- Response times increasing
How to scale:
- Go to Settings
- Click Change Plan
- Select larger plan
- Apply changes
Downtime: Usually 1-5 minutes
Horizontal Scaling (More Storage)#
Increase storage capacity:
When to scale:
- Disk usage > 70%
- Disk usage growing rapidly
- Approaching storage limit
- Planning for future growth
How to scale:
- Go to Settings
- Click Increase Storage
- Select new size
- Apply changes
Downtime: Usually none (online scaling)
Storage tiers:
- 1 GB โ 100 GB available
- Scale in increments
- One-way increase (can't decrease)
Read Replicas#
Add read-only copies for scale-out:
When to use:
- Read traffic overwhelming primary
- Need distributed reads
- High-availability needed
- Multiple regions wanted
Benefits:
- Scales read traffic
- High availability
- Disaster recovery
- Low latency for reads
Cost: Additional replicas increase cost
Database Updates#
Version Upgrades#
Update to newer database versions:
Available Upgrades:
- Minor versions (7.5 โ 7.6)
- Major versions (14 โ 15)
- Check compatibility first
Before Upgrading:
- Test in staging environment
- Backup current database
- Review breaking changes
- Plan maintenance window
Upgrade Process:
- Go to Settings
- Click Upgrade Version
- Select new version
- Confirm compatibility
- Schedule upgrade
Downtime: Usually 5-30 minutes
Security Patches#
Automatic security updates applied:
What happens:
- Security patches applied automatically
- Usually no downtime
- Transparent to applications
- Logged in activity logs
You can:
- Schedule preferred time
- View patch history
- Enable/disable auto-patching
Backup Management#
Automatic Backups#
Included with all databases:
Backup Schedule:
- Daily automatic backups
- Weekly full backups
- Monthly long-term backups
Retention:
- 7-day backups: 7 days
- 30-day backups: 30 days
- 1-year backups: 1 year
Coverage:
- Full data backup
- Schema backup
- Configuration backup
Manual Backups#
Create on-demand backups:
When to create:
- Before major changes
- Before version upgrade
- Before scaling operations
- Before maintenance
- Before application changes
How to create:
- Go to Backups
- Click Create Backup
- Add description
- Confirm
Time taken: 5-60 minutes depending on size
Backup Storage#
Where backups are stored:
Locations:
- Same region as database (default)
- Multiple regions available
- Encrypted storage
- Geo-redundant options
Cost: Usually included in database cost
Recovery Options#
Point-in-Time Recovery (PITR)#
Restore to any point in time:
Availability:
- Last 7 days available
- Any timestamp within window
- Minute-level granularity
How to use:
- Go to Backups
- Click Point-in-Time Recovery
- Select timestamp
- Confirm recovery
Result: New database created with data from that point
Restore from Backup#
Restore from a specific backup:
Available backups:
- Daily backups
- Weekly backups
- Manual backups
- Automatic backups
How to restore:
- Go to Backups
- Click Restore on backup
- Create new database or overwrite
- Confirm
Result: New database with backup data
Backup Export#
Download backup for external storage:
Formats:
- SQL dump for MySQL/PostgreSQL
- JSON for MongoDB
- RDB dump for Redis
How to export:
- Go to Backups
- Click Export on backup
- Select format
- Download file
Use for:
- Long-term archival
- Off-site storage
- Migration
- Compliance requirements
Maintenance#
Regular Tasks#
Weekly:
- Monitor metrics
- Check disk usage
- Review slow queries
- Verify backups
Monthly:
- Review performance trends
- Optimize indexes
- Archive old data
- Update documentation
Quarterly:
- Test recovery
- Review scaling needs
- Plan upgrades
- Security audit
Database Optimization#
Index Optimization:
Vacuum and Analyze:
Archive Old Data:
- Move old records to archive table
- Delete unnecessary data
- Rebuild indexes
- Update statistics
Monitoring Logs#
View database activity:
Available logs:
- Error logs
- Slow query logs
- Access logs
- Audit logs
How to view:
- Go to Logs
- Filter by date/type
- Search for keywords
- Export for analysis
Troubleshooting#
Problem: High CPU Usage#
Symptoms:
- CPU > 85%
- Slow queries
- Connection timeouts
Causes:
- Heavy queries
- Many concurrent connections
- Missing indexes
- Inefficient code
Solutions:
- Identify slow queries from logs
- Optimize problem queries
- Add missing indexes
- Implement caching
- Scale up if needed
Problem: High Memory Usage#
Symptoms:
- Memory > 80%
- Slow performance
- Out of memory errors
Causes:
- Large result sets
- Inadequate indexes
- Memory leaks
- Large temporary tables
Solutions:
- Check for large queries
- Add indexes
- Optimize queries
- Increase batch size
- Scale memory
Problem: Disk Space Running Out#
Symptoms:
- Disk > 90%
- Write errors
- Cannot insert data
Causes:
- Accumulation of data
- Large tables
- Uncleared logs
- Transaction logs
Solutions:
- Archive old data
- Delete unnecessary data
- Clear logs
- Increase storage immediately
- Implement data retention policy
Problem: Slow Queries#
Symptoms:
- Queries taking > 1 second
- Application slower
- High CPU with few queries
Causes:
- Missing indexes
- Poor query design
- Outdated statistics
- Large tables
Solutions:
- Enable query logging
- Identify slow queries
- Add needed indexes
- Rewrite problematic queries
- Optimize schema
Best Practices#
1. Monitor Regularly#
- Check metrics daily
- Set up alerts
- Review performance trends
- Act on warnings early
2. Plan for Growth#
- Monitor disk usage
- Forecast data growth
- Scale before hitting limits
- Don't wait for emergency
3. Backup Regularly#
- Verify backups work
- Test restoration quarterly
- Keep backups in multiple locations
- Document recovery procedures
4. Optimize Performance#
- Monitor slow queries
- Add needed indexes
- Archive old data
- Update statistics
5. Keep Updated#
- Apply security patches
- Upgrade versions periodically
- Follow upgrade schedule
- Test before upgrading
6. Secure Access#
- Restrict network access
- Use SSL/TLS
- Change default passwords
- Monitor access logs
7. Document Changes#
- Keep change log
- Document schema changes
- Note scaling events
- Record optimization changes
Next Steps#
- Backup & Recovery - Deep dive into backups
- Database Best Practices - Optimization tips
- Troubleshooting - Common issues
Support#
Questions about management?
- Check sections above
- Review metrics regularly
- Contact support: [email protected]