Overview
MySQL has been a cornerstone of the open-source database landscape for decades, powering millions of applications worldwide. Aiven for MySQL provides the reliability and features you expect from MySQL, with the added benefits of fully managed operations, automated backups, and enterprise-grade security.Why Choose Aiven for MySQL
Fully Managed
Automated backups, updates, monitoring, and maintenance with zero downtime
High Availability
Multi-node replication with automatic failover for business continuity
MyHoard Backups
Aiven’s open-source backup and restore tool for MySQL with point-in-time recovery
Remote Replicas
Create read replicas across regions for disaster recovery and read scaling
Key Features
High Availability Configuration
High Availability Configuration
Aiven for MySQL provides automatic replication and failover:Single-Node Plans (Hobbyist/Startup):
- Development and testing
- Cost-effective for non-critical workloads
- Automatic backups and restore
- Primary-replica replication
- Automatic failover on primary failure
- Read replicas for scaling reads
- Synchronous replication options
MyHoard Backup System
MyHoard Backup System
Aiven’s open-source backup solution for MySQL:
- Continuous binary log streaming
- Point-in-time recovery (PITR)
- Encrypted backups in object storage
- Fast restoration from backups
- Cross-region backup storage
- Hobbyist/Startup: 2 days
- Business: 14 days
- Premium: 30 days
Remote Read Replicas
Remote Read Replicas
Create read replicas in different regions:
- Reduce read latency for global users
- Disaster recovery standby
- Cross-region data distribution
- Promote replica to primary if needed
Performance Optimization
Performance Optimization
Automatic tuning based on workload:
- InnoDB buffer pool sizing
- Connection pool management
- Query cache configuration
- Slow query logging
- Performance schema enabled
Getting Started
Create MySQL Service
Deploy a MySQL service using Aiven Console, CLI, or API:Available MySQL Versions: 8.0 (recommended)
Connection Examples
- Python
- Node.js
- Java
- PHP
- Go
Performance Tuning
Connection Management
Connection Management
Optimize connection handling:
- Use connection pooling in your application
- Set appropriate
max_connectionsfor your workload - Monitor active connections:
SHOW PROCESSLIST - Configure
wait_timeoutandinteractive_timeout
Indexing Best Practices
Indexing Best Practices
Create effective indexes:
Query Optimization
Query Optimization
Identify and optimize slow queries:
Memory Configuration
Memory Configuration
MySQL automatically tunes memory based on your plan:
- InnoDB buffer pool (largest memory consumer)
- Query cache (for repeated queries)
- Sort buffer and join buffer
- Connection buffers
High Availability and Replication
- Automatic Failover
- Read Replicas
- Disaster Recovery
Business and Premium plans include automatic failover:
- Primary node handles all writes
- Replica nodes synchronize continuously
- Automatic promotion on primary failure
- Service URI remains constant
- Typical failover time: 1-2 minutes
Monitoring and Troubleshooting
Key Metrics to Monitor
Connection Metrics
- Active connections
- Connection errors
- Max connections reached
- Aborted connections
Query Performance
- Queries per second
- Slow query count
- Average query time
- Query cache hit rate
Replication
- Replication lag
- Replica IO/SQL thread status
- Binary log position
- Replica errors
Resource Usage
- CPU utilization
- Memory usage
- Disk I/O
- Disk space available
Troubleshooting Common Issues
Too Many Connections
Too Many Connections
Slow Queries
Slow Queries
Replication Lag
Replication Lag
Security Best Practices
User Management
User Management
Create users with appropriate privileges:
SSL/TLS Connections
SSL/TLS Connections
Always use encrypted connections:
- Aiven requires SSL by default
- Download CA certificate from console
- Configure clients with
--ssl-mode=REQUIRED - Verify server certificate
Network Security
Network Security
- Enable VPC peering for private access
- Use IP allowlisting to restrict access
- Configure AWS PrivateLink
- Implement application-level encryption for sensitive data
Migration to Aiven
Prepare Source Database
- Ensure MySQL version compatibility (5.7 or 8.0)
- Note custom configurations
- Plan maintenance window
Use Cases
- Web Applications
- SaaS Applications
- Mobile Backends
- E-commerce platforms
- Content management systems
- Blog platforms (WordPress, Drupal)
- User authentication systems
Related Services
Apache Kafka
Stream database changes with Debezium CDC
Grafana
Visualize MySQL metrics and data
ClickHouse
Replicate to ClickHouse for analytics
Apache Flink
Real-time processing with MySQL connector
Resources
Primary Keys Required: Aiven for MySQL requires primary keys on all tables for replication. Learn how to create missing primary keys.