Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
love your data
© Pythian Services Inc. 2025
Lessons learned when
managing MySQL in the
Cloud
March 2025
Pythian Services Inc. | Confidential | 3
About Me
󰞵 Principal Consultant: Pythian (OSDB Practice)
🎓 Education: MSc in Software Engineering
📜 Certifications
● MongoDB Certified DBA
● Oracle Professional MySQL 5.7
● Terraform Associate Certified
● GCP Professional Architect
💻 Expertise: Bash, Python, Hybrid Cloud
🌟 Personal: Husband and Father, Avid Traveler, Speaker
🌐 Social
@igorle doncovski in/igorle
Pythian Services Inc. | Confidential | 4
🛠 Hands-On Experience
💡 No GenAI Content (except…)
☁ Cloud-Focused (DBaaS)
❌ Not a Training Session
🌱 Beginner Friendly
About
Pythian Services Inc. | Confidential | 5
🎤 Introduction
⚙ Configuration and Installation
🤖 Automation
📦 Version Control and Upgrades
📊 Performance Tuning
📈 Cost-Effective Scalability
🌍 High Availability
📉 Monitoring
♻ Disaster Recovery
🔒 Security
💬 Q&A
Agenda
Pythian Services Inc. | Confidential | 6
Automation Scalability Cost Efficiency Collaboration
Resilience and DR
Security and Compliance
Innovation
Benefits of Cloud Adoption
Pythian Services Inc. | Confidential | 7
Infrastructure as Code
● Terraform (OpenTofu)
● Cloud Formation
● Cloud Development Kit
● Helm (Kubernetes)
● Ansible
● Chef
● Puppet
● Reverse Engineering
Pythian Services Inc. | Confidential | 8
Infrastructure as Code
provider "aws" {
region = "us-west-1" # Change to your preferred region
}
resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0" # Valid AMI ID for the region
instance_type = "t2.micro"
root_block_device {
volume_size = 20 # OS disk size in GB
}
ebs_block_device {
device_name = "/dev/sdb"
volume_size = 500 # MySQL partition size in GB
}
network_interface {
network_interface_id = aws_network_interface.example.id
device_index = 0
}
tags = {
Name = "MyEC2Instance"
}
}
resource "aws_network_interface" "example" {
subnet_id = "subnet-d744039d" # Replace with your subnet ID
private_ips = ["10.0.1.100"]
}
provider "google" {
project = "my-gcp-project" # Replace with valid GCP project ID
region = "us-west1"
}
resource "google_compute_instance" "example" {
name = "my-gcp-instance"
machine_type = "e2-medium"
zone = "us-west1-a"
boot_disk {
initialize_params {
image = "debian-cloud/debian-11" # Replace with a valid image
size = 20 # OS disk size in GB
}
}
attached_disk {
source = google_compute_disk.mysql_disk.id
device_name = "mysql-disk"
}
network_interface {
network = "default"
subnetwork = google_compute_subnetwork.example.id
network_ip = "10.0.1.100"
}
}
resource "google_compute_disk" "mysql_disk" {
name = "mysql-disk"
type = "pd-ssd"
size = 500 # MySQL partition size in GB
zone = "us-west1-a"
}
resource "google_compute_subnetwork" "example" {
name = "example-subnet"
ip_cidr_range = "10.0.1.0/24"
network = "default"
region = "us-west1"
}
Pythian Services Inc. | Confidential | 9
Self managed MySQL
🛠 Flexibility & Customization
● Full control over MySQL version, storage, and configurations
● Ability to fine-tune performance settings (OS and Database layer)
● Choose instance types based on workload needs
● Similar experience for all setups, making migration easier
📉 Management Overhead
● OS patching, MySQL upgrades, backups, and monitoring
● Scaling requires downtime or complex automation
● Increased complexity and lack of expertise
● No managed failover, needs custom HA solutions (e.g., Orchestrator)
Pythian Services Inc. | Confidential | 10
Self Managed vs DBaaS
✅ Self Managed
● Workloads needing custom MySQL tuning
● Applications requiring specific MySQL versions
or extensions
● Teams with DBA expertise to handle operations
● Custom OS patching and tuning
🛠 Managed Database Service
● Automated backups with PITR, failover, and
scaling
● Your workload is highly dynamic and benefits
from serverless options
● Fully managed security & compliance without
manual effort
Pythian Services Inc. | Confidential | 11
● High Availability (Production, Dev/Test, Free Tier)
● Multi AZ deployment (standby, replicas)
● Cost and Pricing (On Demand, Reserved)
● Storage Autoscaling
● Parameter Group (Flags) for GLOBAL VARIABLES
● Primary instance, Secondary instances
● Data Migration (DMS, Logical Backup, xtrabackup …)
● Performance (Query) Insights (7 days free tier)
● Backup storage (up to 35 days with no extra cost)
DBaaS Provisioning
Pythian Services Inc. | Confidential | 12
High Availability (AWS RDS)
● Multi AZ deployment (single standby or two readable standbys)
● Read replicas - asynchronous replication
Pythian Services Inc. | Confidential | 13
High Availability (GCP CloudSQL)
● Multi AZ deployment - synchronous replication to a standby node
● Read replicas - asynchronous replication
Pythian Services Inc. | Confidential | 14
● Storage and IO is not included in the Price (USD)
Pricing
Resource On-Demand Price 1-Year Commitment 1-Year Discount (%) 3-Year Commitment 3-Year Discount (%)
vCPUs $36.208 per vCPU $27.16 25% $17.38 52%
Memory $6.132 per GB $4.60 25% $2.94 52%
HA vCPUs $72.343 per vCPU $54.26 25% $34.72 52%
HA Memory $12.264 per GB $9.20 25% $5.89 52%
Resource On-Demand Hourly Rate 1-Year Reserved Instance 1-Year Savings (%) 3-Year Reserved Instance 3-Year Savings (%)
db.t3.micro $0.02 $0.01 29% $0.01 34%
db.m5.large $0.19 $0.13 30% $0.12 37%
db.r5.xlarge $0.48 $0.33 30% $0.30 37%
Pythian Services Inc. | Confidential | 15
Parameter Group
Parameter Groups
● Default parameter group - non modifiable
● Custom parameter group (some options also non modifiable)
● Best practice, one parameter group per instance (or group of
instances)
● At least one parameter group per Writer and Reader
● Some changes are applied only after instance reboot
● Cluster parameter groups
● Compare parameter groups
Source
Analytics Dashboard
mysql8-c1-writer
mysql8-c1-dashboard
mysql8-c1-analytics
Replication
Pythian Services Inc. | Confidential | 16
Database migration
● Cloud native DMS tools
○ Does not always work, hard to troubleshoot (Oracle, MSSQL → MySQL)
● Xtrabackup
○ Works with AWS, also hard to troubleshoot
● mydumper
○ Logical multi threaded, issues with JSON column type
● Mysqldump
○ Single threaded, takes long for large datasets
● MySQL Workbench
○ Single threaded, graphical interface for database migration. (Oracle,
MSSQL → MySQL)
● MySQL Shell
○ Multi threaded, logical backup
Pythian Services Inc. | Confidential | 17
Database migration plan
● Create custom parameter group upfront
○ log_bin_trust_function_creators=ON (if importing stored procedures)
○ SUPER, SYSTEM_VARIABLES_ADMIN, FILE privileges are restricted
● Choose the proper instance size that matches your on-prem instance
(CPU, Memory, Disk, Network)
● Skip the multi-AZ initially if loading huge data
● Create an instance with the same DB minor version as your source
instance
● Backups and Performance Insights are free with 7 days retention period
● Maintenance - disable auto minor version upgrades
● Use Deletion protection to prevent accidental deletion of the instance
Pythian Services Inc. | Confidential | 18
Database migration execution
● Mysql Shell (Migrating from Google CloudSQL to AWS RDS)
● Single command, util.copyInstance()
mysqlsh --uri mysql://<username>:<password>@<dbass-endpoint-gcp>:3306
util.copyInstance('mysql://<username>@<dbass-endpoint-rds>:3306', {checksum: true, compatibility:
["strip_definers"], users: false, dropExistingObjects: true, dryRun : true})
pt-show-grants -h<dbass-endpoint-gcp> -u<username> --ask-pass > users.sql
mysql -u<username> -h<dbaas-endpoint-rds> -p < users.sql
Pythian Services Inc. | Confidential | 19
Replication
CHANGE MASTER to MASTER_HOST=<external_host>, MASTER_USERNAME=<username>, MASTER_PASSWORD=<password>,
MASTER_PORT=<port>, MASTER_LOG_FILE=<binlog>, MASTER_LOG_POS=<position>;
START SLAVE;
CHANGE REPLICATION SOURCE to SOURCE_HOST=<external_host>, SOURCE_USERNAME=<username>,
SOURCE_PASSWORD=<password>, SOURCE_PORT=<port>, SOURCE_LOG_FILE=<binlog>, SOURCE_LOG_POS=<position>;
START REPLICA;
MySQL < 8.4
MySQL >= 8.4
Pythian Services Inc. | Confidential | 20
Replication
MySQL < 8.4
MySQL >= 8.4
CHANGE MASTER to MASTER_HOST=<external_host>, MASTER_USERNAME=<username>, MASTER_PASSWORD=<password>,
MASTER_PORT=<port>, MASTER_LOG_FILE=<binlog>, MASTER_LOG_POS=<position>;
START SLAVE;
CHANGE REPLICATION SOURCE to SOURCE_HOST=<external_host>, SOURCE_USERNAME=<username>,
SOURCE_PASSWORD=<password>, SOURCE_PORT=<port>, SOURCE_LOG_FILE=<binlog>, SOURCE_LOG_POS=<position>;
START REPLICA;
Pythian Services Inc. | Confidential | 21
Replication
● CALL mysql.rds_set_external_master (host_name, host_port, replication_user_name, replication_user_password,
mysql_binary_log_file_name, mysql_binary_log_file_location, ssl_encryption);
● CALL mysql.rds_set_external_source_gtid_purged(server_uuid, start_pos, end_pos);
● CALL mysql.rds_set_external_master_with_auto_position (host_name, host_port, replication_user_name,
replication_user_password, ssl_encryption, delay);
● CALL mysql.rds_start_replication;
● CALL mysql.rds_reset_external_master;
Pythian Services Inc. | Confidential | 22
Replication
Pythian Services Inc. | Confidential | 23
● Create Aurora read replica
● Set RDS Primary as read-only
● Confirm replication is in sync
● Promote Aurora as Standalone
● Point Apps to Aurora
Replication - switch to Aurora
Pythian Services Inc. | Confidential | 24
Major version upgrade
● Latest major version might not be available as soon as the community version
● Upgrading to next major version might fail if:
○ The current version is not the latest minor version
○ The current instance class is not supported (only current and next
generation classes are supported)
○ Custom parameter group is not created for the next version
● Restore a test instance from snapshot
● Attempt an upgrade on the test instance
● The provider does pre-check for upgrade and report on issues
● Verify application compatibility and deprecated features
● Upgrade secondary nodes prior upgrading Primary
● Promote a Secondary node
● Extended support for EOL version ($$)
Pythian Services Inc. | Confidential | 25
Blue - Green Deployments
● Blue - current environment
● Green - staging environment
● Green environment can be changed without affecting
the Blue environment
● Test the Green environment
● Switchover in less than a minute with no App changes
● Can be useful for schema changes on big tables
● Major version upgrades with failback option
Pythian Services Inc. | Confidential | 26
● Create the blue-green deployment
○ Verify binary logging is ON
○ Create new parameter groups
○ Create a blue-green deployment
○ Change the binlog retention for the new cluster
● Switchover to next major MySQL
○ Switchover to the green environment
○ Capture the binary log file name and position
○ Delete the blue-green deployment
○ Set the previous (old) server to NOT writeable
○ Verify the old server has been set to read-only
● Setup replication from new MySQL to old
○ Create a replication user on the new writer
○ Set up reverse replication
BG Deployments - major upgrade
Pythian Services Inc. | Confidential | 27
Percona toolkit
Collection of advanced open source command-line tools
pt-show-grants -h<endpoint.amazonaws.com> -u<username> --ask-pass > users.sql
pt-online-schema-change --alter 'ADD COLUMN id INT' h=<endpoint.amazonaws.com> D=<database>,t=<table>;
pt-duplicate-key-checker -h<endpoint.amazonaws.com> -u<username> --ask-pass > duplicate_indexes.txt
pt-query-digest --processlist h=<endpoint.amazonaws.com> -u<username> --run-time=300s --daemonize --ask-pass >
query_digest_$(date '+%Y-%m-%d').txt
pt-mysql-summary -h<endpoint.amazonaws.com> -u<username> --ask-pass > mysql_summary.txt
Bastion Host
Pythian Services Inc. | Confidential | 28
Monitoring - Performance Insights
Pythian Services Inc. | Confidential | 29
Monitoring - PMM
Pythian Services Inc. | Confidential | 30
🖥 System Resources
● CPU Overload
When the database uses too much
CPU power, it struggles to process
queries efficiently
● Slow Disk Access
If the database has to read or write
a lot of data, it can cause delays
● Not Enough Memory
If there isn’t enough memory,
queries take longer reading data
from disk
📊 Workload
● Slow queries
Some queries take a long time to
finish, missing index is common
reason
● Complex queries
Queries that join many tables or
process large amounts of data take
longer to run. Partial indexes or
queries doing analytics
● High concurrency
When too many users are running
queries at the same time, it can
slow things down
Common Performance Issues
⚙ Configuration
● Wrong Settings
Some database settings might not
be ideal for the workload, leading to
reduced performance
● Repeated Queries
Queries run 1000s of times without
adding caching layer
Pythian Services Inc. | Confidential | 31
Horizontal
Vertical
us-west-1
Scaling
db.t3.micro
db.t4g.xlarge
us-west-1
db.t3.micro db.t3.micro
us-west-2
db.t3.micro db.t3.micro
Write traffic Read traffic Replication
Primary Replica Intermediate Primary
Pythian Services Inc. | Confidential | 32
Vertical Scaling
Pythian Services Inc. | Confidential | 33
Horizontal Scaling
● Scalability
● High Availability
● Shard Management
● Topology Management
● Monitoring
● Support for Transactions
● Query route
Pythian Services Inc. | Confidential | 34
Autoscaling
● Aurora only feature
● Capacity
○ Min 0 replica
○ Max 15 replicas
● Target Metric
○ CPU Utilization
○ Average connections
● Cooldown period (default 5 min)
Pythian Services Inc. | Confidential | 35
🔑 IAM for access, store credentials in Secrets Manager
🔒 Principle of least privilege granting minimal permissions
🏠 Deploy the database and application in the same VPC
🌍 Don’t expose the instance publicly, use private subnets and
VPNs where necessary
🔐 Encryption at REST. Storage encryption to protect sensitive
data. Use TLS/SSL for in-transit encryption
📲 Multi-factor authentication where possible
📅 Track CVEs and keep the database on the latest minor version
🔍 Enable and configure audit plugin where possible
Security
Pythian Services Inc. | Confidential | 36
Prompt engineering
INSERT INTO `t1` (`p1`, `pp1`, `c1`, `v1`, `name`, `zzzz`, `tt`)
SELECT
FLOOR(RAND() * 1000), -- Random integer for p1
FLOOR(RAND() * 1000), -- Random integer for pp1
FLOOR(RAND() * 1000), -- Random integer for c1
FLOOR(RAND() * 5000) + 1, -- v1 must be NOT NULL
CONCAT('Name_', FLOOR(RAND() * 10000)), -- Random name
FLOOR(RAND() * 1000), -- Random integer for zzzz
FLOOR(RAND() * 1000) -- Random integer for tt
FROM (SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4
UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8
UNION ALL
SELECT 9 UNION ALL SELECT 10) AS a
CROSS JOIN (SELECT 1 AS b FROM information_schema.tables LIMIT 1000) AS b;
Pythian Services Inc. | Confidential | 37
Cloud Only
New MySQL Hypergraph Optimizer - OCI Heatwave
Vector Store and GEN AI - OCI Heatwave
MySQl Autopilot Indexing - OCI Heatwave
Javascript Stored Programs Support - OCI Heatwave
Aurora features (parallel query, ML) - AWS
Aurora Global Database - AWS
Vector Store - GCP
Adaptive Caching Layer - GCP
© Pythian Services Inc. 2025
Thank You!
Questions?

More Related Content

Recently uploaded (20)

autonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdfautonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdf
JyotiLohar6
 
Mathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptxMathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptx
ppkmurthy2006
 
BS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptxBS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptx
VinkuMeena
 
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptxUNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
KesavanT10
 
decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
 
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptxRAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
JenTeruel1
 
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Daniel Donatelli
 
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
 
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
slayshadow705
 
Lecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptxLecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptx
rabiaatif2
 
Industrial Construction shed PEB MFG.pdf
Industrial Construction shed PEB MFG.pdfIndustrial Construction shed PEB MFG.pdf
Industrial Construction shed PEB MFG.pdf
PLINTH & ROOFS
 
How to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using ArduinoHow to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using Arduino
CircuitDigest
 
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdfCS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
PonniS7
 
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
 
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
 
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
US Patented ReGenX Generator, ReGen-X Quatum Motor EV Regenerative Accelerati...
Thane Heins NOBEL PRIZE WINNING ENERGY RESEARCHER
 
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
 
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
NgocThang9
 
Turbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdfTurbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdf
Totok Sulistiyanto
 
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
 
autonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdfautonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdf
JyotiLohar6
 
Mathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptxMathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptx
ppkmurthy2006
 
BS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptxBS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptx
VinkuMeena
 
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptxUNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
UNIT 1FUNDAMENTALS OF OPERATING SYSTEMS.pptx
KesavanT10
 
decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
 
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptxRAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
JenTeruel1
 
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Daniel Donatelli
 
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
 
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
Structural QA/QC Inspection in KRP 401600 | Copper Processing Plant-3 (MOF-3)...
slayshadow705
 
Lecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptxLecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptx
rabiaatif2
 
Industrial Construction shed PEB MFG.pdf
Industrial Construction shed PEB MFG.pdfIndustrial Construction shed PEB MFG.pdf
Industrial Construction shed PEB MFG.pdf
PLINTH & ROOFS
 
How to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using ArduinoHow to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using Arduino
CircuitDigest
 
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdfCS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
PonniS7
 
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
 
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
 
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
15. Smart Cities Big Data, Civic Hackers, and the Quest for a New Utopia.pdf
NgocThang9
 
Turbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdfTurbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdf
Totok Sulistiyanto
 
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
 

Featured (20)

2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design ProcessStorytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 

Lessons learned when managing MySQL in the Cloud

  • 2. © Pythian Services Inc. 2025 Lessons learned when managing MySQL in the Cloud March 2025
  • 3. Pythian Services Inc. | Confidential | 3 About Me 󰞵 Principal Consultant: Pythian (OSDB Practice) 🎓 Education: MSc in Software Engineering 📜 Certifications ● MongoDB Certified DBA ● Oracle Professional MySQL 5.7 ● Terraform Associate Certified ● GCP Professional Architect 💻 Expertise: Bash, Python, Hybrid Cloud 🌟 Personal: Husband and Father, Avid Traveler, Speaker 🌐 Social @igorle doncovski in/igorle
  • 4. Pythian Services Inc. | Confidential | 4 🛠 Hands-On Experience 💡 No GenAI Content (except…) ☁ Cloud-Focused (DBaaS) ❌ Not a Training Session 🌱 Beginner Friendly About
  • 5. Pythian Services Inc. | Confidential | 5 🎤 Introduction ⚙ Configuration and Installation 🤖 Automation 📦 Version Control and Upgrades 📊 Performance Tuning 📈 Cost-Effective Scalability 🌍 High Availability 📉 Monitoring ♻ Disaster Recovery 🔒 Security 💬 Q&A Agenda
  • 6. Pythian Services Inc. | Confidential | 6 Automation Scalability Cost Efficiency Collaboration Resilience and DR Security and Compliance Innovation Benefits of Cloud Adoption
  • 7. Pythian Services Inc. | Confidential | 7 Infrastructure as Code ● Terraform (OpenTofu) ● Cloud Formation ● Cloud Development Kit ● Helm (Kubernetes) ● Ansible ● Chef ● Puppet ● Reverse Engineering
  • 8. Pythian Services Inc. | Confidential | 8 Infrastructure as Code provider "aws" { region = "us-west-1" # Change to your preferred region } resource "aws_instance" "example" { ami = "ami-0c55b159cbfafe1f0" # Valid AMI ID for the region instance_type = "t2.micro" root_block_device { volume_size = 20 # OS disk size in GB } ebs_block_device { device_name = "/dev/sdb" volume_size = 500 # MySQL partition size in GB } network_interface { network_interface_id = aws_network_interface.example.id device_index = 0 } tags = { Name = "MyEC2Instance" } } resource "aws_network_interface" "example" { subnet_id = "subnet-d744039d" # Replace with your subnet ID private_ips = ["10.0.1.100"] } provider "google" { project = "my-gcp-project" # Replace with valid GCP project ID region = "us-west1" } resource "google_compute_instance" "example" { name = "my-gcp-instance" machine_type = "e2-medium" zone = "us-west1-a" boot_disk { initialize_params { image = "debian-cloud/debian-11" # Replace with a valid image size = 20 # OS disk size in GB } } attached_disk { source = google_compute_disk.mysql_disk.id device_name = "mysql-disk" } network_interface { network = "default" subnetwork = google_compute_subnetwork.example.id network_ip = "10.0.1.100" } } resource "google_compute_disk" "mysql_disk" { name = "mysql-disk" type = "pd-ssd" size = 500 # MySQL partition size in GB zone = "us-west1-a" } resource "google_compute_subnetwork" "example" { name = "example-subnet" ip_cidr_range = "10.0.1.0/24" network = "default" region = "us-west1" }
  • 9. Pythian Services Inc. | Confidential | 9 Self managed MySQL 🛠 Flexibility & Customization ● Full control over MySQL version, storage, and configurations ● Ability to fine-tune performance settings (OS and Database layer) ● Choose instance types based on workload needs ● Similar experience for all setups, making migration easier 📉 Management Overhead ● OS patching, MySQL upgrades, backups, and monitoring ● Scaling requires downtime or complex automation ● Increased complexity and lack of expertise ● No managed failover, needs custom HA solutions (e.g., Orchestrator)
  • 10. Pythian Services Inc. | Confidential | 10 Self Managed vs DBaaS ✅ Self Managed ● Workloads needing custom MySQL tuning ● Applications requiring specific MySQL versions or extensions ● Teams with DBA expertise to handle operations ● Custom OS patching and tuning 🛠 Managed Database Service ● Automated backups with PITR, failover, and scaling ● Your workload is highly dynamic and benefits from serverless options ● Fully managed security & compliance without manual effort
  • 11. Pythian Services Inc. | Confidential | 11 ● High Availability (Production, Dev/Test, Free Tier) ● Multi AZ deployment (standby, replicas) ● Cost and Pricing (On Demand, Reserved) ● Storage Autoscaling ● Parameter Group (Flags) for GLOBAL VARIABLES ● Primary instance, Secondary instances ● Data Migration (DMS, Logical Backup, xtrabackup …) ● Performance (Query) Insights (7 days free tier) ● Backup storage (up to 35 days with no extra cost) DBaaS Provisioning
  • 12. Pythian Services Inc. | Confidential | 12 High Availability (AWS RDS) ● Multi AZ deployment (single standby or two readable standbys) ● Read replicas - asynchronous replication
  • 13. Pythian Services Inc. | Confidential | 13 High Availability (GCP CloudSQL) ● Multi AZ deployment - synchronous replication to a standby node ● Read replicas - asynchronous replication
  • 14. Pythian Services Inc. | Confidential | 14 ● Storage and IO is not included in the Price (USD) Pricing Resource On-Demand Price 1-Year Commitment 1-Year Discount (%) 3-Year Commitment 3-Year Discount (%) vCPUs $36.208 per vCPU $27.16 25% $17.38 52% Memory $6.132 per GB $4.60 25% $2.94 52% HA vCPUs $72.343 per vCPU $54.26 25% $34.72 52% HA Memory $12.264 per GB $9.20 25% $5.89 52% Resource On-Demand Hourly Rate 1-Year Reserved Instance 1-Year Savings (%) 3-Year Reserved Instance 3-Year Savings (%) db.t3.micro $0.02 $0.01 29% $0.01 34% db.m5.large $0.19 $0.13 30% $0.12 37% db.r5.xlarge $0.48 $0.33 30% $0.30 37%
  • 15. Pythian Services Inc. | Confidential | 15 Parameter Group Parameter Groups ● Default parameter group - non modifiable ● Custom parameter group (some options also non modifiable) ● Best practice, one parameter group per instance (or group of instances) ● At least one parameter group per Writer and Reader ● Some changes are applied only after instance reboot ● Cluster parameter groups ● Compare parameter groups Source Analytics Dashboard mysql8-c1-writer mysql8-c1-dashboard mysql8-c1-analytics Replication
  • 16. Pythian Services Inc. | Confidential | 16 Database migration ● Cloud native DMS tools ○ Does not always work, hard to troubleshoot (Oracle, MSSQL → MySQL) ● Xtrabackup ○ Works with AWS, also hard to troubleshoot ● mydumper ○ Logical multi threaded, issues with JSON column type ● Mysqldump ○ Single threaded, takes long for large datasets ● MySQL Workbench ○ Single threaded, graphical interface for database migration. (Oracle, MSSQL → MySQL) ● MySQL Shell ○ Multi threaded, logical backup
  • 17. Pythian Services Inc. | Confidential | 17 Database migration plan ● Create custom parameter group upfront ○ log_bin_trust_function_creators=ON (if importing stored procedures) ○ SUPER, SYSTEM_VARIABLES_ADMIN, FILE privileges are restricted ● Choose the proper instance size that matches your on-prem instance (CPU, Memory, Disk, Network) ● Skip the multi-AZ initially if loading huge data ● Create an instance with the same DB minor version as your source instance ● Backups and Performance Insights are free with 7 days retention period ● Maintenance - disable auto minor version upgrades ● Use Deletion protection to prevent accidental deletion of the instance
  • 18. Pythian Services Inc. | Confidential | 18 Database migration execution ● Mysql Shell (Migrating from Google CloudSQL to AWS RDS) ● Single command, util.copyInstance() mysqlsh --uri mysql://<username>:<password>@<dbass-endpoint-gcp>:3306 util.copyInstance('mysql://<username>@<dbass-endpoint-rds>:3306', {checksum: true, compatibility: ["strip_definers"], users: false, dropExistingObjects: true, dryRun : true}) pt-show-grants -h<dbass-endpoint-gcp> -u<username> --ask-pass > users.sql mysql -u<username> -h<dbaas-endpoint-rds> -p < users.sql
  • 19. Pythian Services Inc. | Confidential | 19 Replication CHANGE MASTER to MASTER_HOST=<external_host>, MASTER_USERNAME=<username>, MASTER_PASSWORD=<password>, MASTER_PORT=<port>, MASTER_LOG_FILE=<binlog>, MASTER_LOG_POS=<position>; START SLAVE; CHANGE REPLICATION SOURCE to SOURCE_HOST=<external_host>, SOURCE_USERNAME=<username>, SOURCE_PASSWORD=<password>, SOURCE_PORT=<port>, SOURCE_LOG_FILE=<binlog>, SOURCE_LOG_POS=<position>; START REPLICA; MySQL < 8.4 MySQL >= 8.4
  • 20. Pythian Services Inc. | Confidential | 20 Replication MySQL < 8.4 MySQL >= 8.4 CHANGE MASTER to MASTER_HOST=<external_host>, MASTER_USERNAME=<username>, MASTER_PASSWORD=<password>, MASTER_PORT=<port>, MASTER_LOG_FILE=<binlog>, MASTER_LOG_POS=<position>; START SLAVE; CHANGE REPLICATION SOURCE to SOURCE_HOST=<external_host>, SOURCE_USERNAME=<username>, SOURCE_PASSWORD=<password>, SOURCE_PORT=<port>, SOURCE_LOG_FILE=<binlog>, SOURCE_LOG_POS=<position>; START REPLICA;
  • 21. Pythian Services Inc. | Confidential | 21 Replication ● CALL mysql.rds_set_external_master (host_name, host_port, replication_user_name, replication_user_password, mysql_binary_log_file_name, mysql_binary_log_file_location, ssl_encryption); ● CALL mysql.rds_set_external_source_gtid_purged(server_uuid, start_pos, end_pos); ● CALL mysql.rds_set_external_master_with_auto_position (host_name, host_port, replication_user_name, replication_user_password, ssl_encryption, delay); ● CALL mysql.rds_start_replication; ● CALL mysql.rds_reset_external_master;
  • 22. Pythian Services Inc. | Confidential | 22 Replication
  • 23. Pythian Services Inc. | Confidential | 23 ● Create Aurora read replica ● Set RDS Primary as read-only ● Confirm replication is in sync ● Promote Aurora as Standalone ● Point Apps to Aurora Replication - switch to Aurora
  • 24. Pythian Services Inc. | Confidential | 24 Major version upgrade ● Latest major version might not be available as soon as the community version ● Upgrading to next major version might fail if: ○ The current version is not the latest minor version ○ The current instance class is not supported (only current and next generation classes are supported) ○ Custom parameter group is not created for the next version ● Restore a test instance from snapshot ● Attempt an upgrade on the test instance ● The provider does pre-check for upgrade and report on issues ● Verify application compatibility and deprecated features ● Upgrade secondary nodes prior upgrading Primary ● Promote a Secondary node ● Extended support for EOL version ($$)
  • 25. Pythian Services Inc. | Confidential | 25 Blue - Green Deployments ● Blue - current environment ● Green - staging environment ● Green environment can be changed without affecting the Blue environment ● Test the Green environment ● Switchover in less than a minute with no App changes ● Can be useful for schema changes on big tables ● Major version upgrades with failback option
  • 26. Pythian Services Inc. | Confidential | 26 ● Create the blue-green deployment ○ Verify binary logging is ON ○ Create new parameter groups ○ Create a blue-green deployment ○ Change the binlog retention for the new cluster ● Switchover to next major MySQL ○ Switchover to the green environment ○ Capture the binary log file name and position ○ Delete the blue-green deployment ○ Set the previous (old) server to NOT writeable ○ Verify the old server has been set to read-only ● Setup replication from new MySQL to old ○ Create a replication user on the new writer ○ Set up reverse replication BG Deployments - major upgrade
  • 27. Pythian Services Inc. | Confidential | 27 Percona toolkit Collection of advanced open source command-line tools pt-show-grants -h<endpoint.amazonaws.com> -u<username> --ask-pass > users.sql pt-online-schema-change --alter 'ADD COLUMN id INT' h=<endpoint.amazonaws.com> D=<database>,t=<table>; pt-duplicate-key-checker -h<endpoint.amazonaws.com> -u<username> --ask-pass > duplicate_indexes.txt pt-query-digest --processlist h=<endpoint.amazonaws.com> -u<username> --run-time=300s --daemonize --ask-pass > query_digest_$(date '+%Y-%m-%d').txt pt-mysql-summary -h<endpoint.amazonaws.com> -u<username> --ask-pass > mysql_summary.txt Bastion Host
  • 28. Pythian Services Inc. | Confidential | 28 Monitoring - Performance Insights
  • 29. Pythian Services Inc. | Confidential | 29 Monitoring - PMM
  • 30. Pythian Services Inc. | Confidential | 30 🖥 System Resources ● CPU Overload When the database uses too much CPU power, it struggles to process queries efficiently ● Slow Disk Access If the database has to read or write a lot of data, it can cause delays ● Not Enough Memory If there isn’t enough memory, queries take longer reading data from disk 📊 Workload ● Slow queries Some queries take a long time to finish, missing index is common reason ● Complex queries Queries that join many tables or process large amounts of data take longer to run. Partial indexes or queries doing analytics ● High concurrency When too many users are running queries at the same time, it can slow things down Common Performance Issues ⚙ Configuration ● Wrong Settings Some database settings might not be ideal for the workload, leading to reduced performance ● Repeated Queries Queries run 1000s of times without adding caching layer
  • 31. Pythian Services Inc. | Confidential | 31 Horizontal Vertical us-west-1 Scaling db.t3.micro db.t4g.xlarge us-west-1 db.t3.micro db.t3.micro us-west-2 db.t3.micro db.t3.micro Write traffic Read traffic Replication Primary Replica Intermediate Primary
  • 32. Pythian Services Inc. | Confidential | 32 Vertical Scaling
  • 33. Pythian Services Inc. | Confidential | 33 Horizontal Scaling ● Scalability ● High Availability ● Shard Management ● Topology Management ● Monitoring ● Support for Transactions ● Query route
  • 34. Pythian Services Inc. | Confidential | 34 Autoscaling ● Aurora only feature ● Capacity ○ Min 0 replica ○ Max 15 replicas ● Target Metric ○ CPU Utilization ○ Average connections ● Cooldown period (default 5 min)
  • 35. Pythian Services Inc. | Confidential | 35 🔑 IAM for access, store credentials in Secrets Manager 🔒 Principle of least privilege granting minimal permissions 🏠 Deploy the database and application in the same VPC 🌍 Don’t expose the instance publicly, use private subnets and VPNs where necessary 🔐 Encryption at REST. Storage encryption to protect sensitive data. Use TLS/SSL for in-transit encryption 📲 Multi-factor authentication where possible 📅 Track CVEs and keep the database on the latest minor version 🔍 Enable and configure audit plugin where possible Security
  • 36. Pythian Services Inc. | Confidential | 36 Prompt engineering INSERT INTO `t1` (`p1`, `pp1`, `c1`, `v1`, `name`, `zzzz`, `tt`) SELECT FLOOR(RAND() * 1000), -- Random integer for p1 FLOOR(RAND() * 1000), -- Random integer for pp1 FLOOR(RAND() * 1000), -- Random integer for c1 FLOOR(RAND() * 5000) + 1, -- v1 must be NOT NULL CONCAT('Name_', FLOOR(RAND() * 10000)), -- Random name FLOOR(RAND() * 1000), -- Random integer for zzzz FLOOR(RAND() * 1000) -- Random integer for tt FROM (SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10) AS a CROSS JOIN (SELECT 1 AS b FROM information_schema.tables LIMIT 1000) AS b;
  • 37. Pythian Services Inc. | Confidential | 37 Cloud Only New MySQL Hypergraph Optimizer - OCI Heatwave Vector Store and GEN AI - OCI Heatwave MySQl Autopilot Indexing - OCI Heatwave Javascript Stored Programs Support - OCI Heatwave Aurora features (parallel query, ML) - AWS Aurora Global Database - AWS Vector Store - GCP Adaptive Caching Layer - GCP
  • 38. © Pythian Services Inc. 2025 Thank You! Questions?