Skip to main content
Aiven for MySQL is a fully managed relational database service that provides a reliable, scalable MySQL platform for your applications. Available from single-node starter plans to highly available production clusters with automated backups and monitoring.

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

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
Multi-Node Plans (Business/Premium):
  • Primary-replica replication
  • Automatic failover on primary failure
  • Read replicas for scaling reads
  • Synchronous replication options
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
Backup Retention:
  • Hobbyist/Startup: 2 days
  • Business: 14 days
  • Premium: 30 days
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
Automatic tuning based on workload:
  • InnoDB buffer pool sizing
  • Connection pool management
  • Query cache configuration
  • Slow query logging
  • Performance schema enabled

Getting Started

1

Create MySQL Service

Deploy a MySQL service using Aiven Console, CLI, or API:
Available MySQL Versions: 8.0 (recommended)
2

Create Database and Tables

Connect and create your database schema:
3

Configure Application

Use connection details from service overview to connect your application with SSL enabled.

Connection Examples

Using SQLAlchemy:

Performance Tuning

Optimize connection handling:
  • Use connection pooling in your application
  • Set appropriate max_connections for your workload
  • Monitor active connections: SHOW PROCESSLIST
  • Configure wait_timeout and interactive_timeout
Create effective indexes:
Identify and optimize slow queries:
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

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 Replication:

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

Security Best Practices

Create users with appropriate privileges:
Always use encrypted connections:
  • Aiven requires SSL by default
  • Download CA certificate from console
  • Configure clients with --ssl-mode=REQUIRED
  • Verify server certificate
  • 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

1

Prepare Source Database

  • Ensure MySQL version compatibility (5.7 or 8.0)
  • Note custom configurations
  • Plan maintenance window
2

Export Data

3

Import to Aiven

4

Verify and Test

  • Compare row counts
  • Test application connectivity
  • Verify all tables and indexes
  • Check stored procedures and triggers

Use Cases

  • E-commerce platforms
  • Content management systems
  • Blog platforms (WordPress, Drupal)
  • User authentication systems

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.