SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Evolution of DBA in the Cloud Era
Presenter by
Manosh Malai
Kabilesh PR
www.mydbops.com info@mydbops.com
Kabilesh P.R
Co-Founder/DB Consultant @Mydbops
kabi@mydbops.com
Manosh Malai
Senior Devops and DB/Cloud Consultant @Mydbops
mmalai@mydbops.com
@ManoshMalai
About us
Mydbops at a Glance
● Mydbops is on Database Consulting with core specialization on MySQL and MongoDB
Administration and Support. Scaling a few largest MySQL Farms in India and US.
● Mydbops was created with a motto of developing a Devops model for Database
administration.
● We help organisations to scale in MySQL/Mongo and implement the advanced technologies in
MySQL/Mongo.
● Founded in 2015, HQ in Bangalore India, 25 Employees.
Mydbops at a GlanceHappy Customers
4
Agenda
● DBA’s Top responsibilities before cloud & after DBaaS
● Fascinating features in DBaaS
● Where DBA skills are needed in cloud.
● Choosing the right vendor.
● Capacity planning and Cost management
● DBA role in cloud
● Real production use case
● Conclusion
DBA’s Top Responsibilities: Before Cloud
Installing, upgrades
and Patching
Fine Tuning
React to DB issues
Backup/Recovery
Ensure DB
Availability
After DBaas
Purview of
The DBass
Provider
Installing,
upgrading and
Patching
Monitoring &
Alerting
Some level
Config
Tweaking
Backup
Fascinating Feature in DBaaS
Elasticity
● Provisioned IOPS
● Instance resize in minutes (vertical)
Security & Patching
● Host level security is provided by
Vendor
● Host patches is also taken by
vendor
HA
● Multi-Availability Zones
● Cross-Region Replicas
● Scale out globally
Scalability
● Read-replica within region(horizontal)
● Load balancer
DBaas eliminate the need of DB Expertise?
Database Schema Design and Optimization
Where DBA Skill needed on Cloud?
Experience on Cost Control ($)
Query Optimization
Support on Choosing Cloud Vendor
In-depth knowledge of Capacity planning
Database Schema Design and Optimisation
Expertise in Database Infrastructure Design
Provide Cloud Vendor Advice
Lot of Parameters need to be consider before choosing a right Cloud
vendor
DBaas Provider’s
Database Features & Control
4
Full Customizable RAM,
Disk Size & Instance Type
5
Replication Technology
1
DB Super User Access
2
SSH Access To
Underlying Machine
3
Plugin Extension
Support
6
Custom Read Replica
Set Config
Backup and Security
4
Encryption at Rest
5
Control Access With
Security Group
1
Custom Schedule For
Backup
2
Selective Restores
3
Continuous
Backup/Point-In-Time
Recovery
Support and Monitoring
4
Configuration Management
& Tuning
5
24X7 Support, 1 Hour
Response SLA
1
Access to DB Server
Logs
2
Monitoring OS & DB
Metrics
3
Slow Query Analysis
Capacity Planning and Cost Management
● Capacity planning for the cloud isn’t about getting an exactly right answer.
● Aim to avoid underestimation or overestimation.
● Check with current footprint of the database including any advance feature such as standby and clustering ?
Do Right-Sizing
● Measuring and Managing ROI
○ You can't manage what you can't measure.
○ Before scaling the resource we need to answer the question what, where, when, why and how it
meet the business requirement.
○ we know ROI is then a matter of acting on that data.
Database Infrastructure Design
● Understand your system limits.
● Estimate your application throughput at Peak.
● Distribute the load.
● Do not hard code endpoints, Use LB / DNS.
● Group servers based on business flows, Do not mix
○ Prod
○ Reports
○ Analytics
● Handle connection pooling with care.
● Having decades of data ? Think where it can be handled better
Database Schema
● Choose right data type the data requires.
● Aware of data type limitations with Texts, Blobs, Json when used
● Choose right storage engine, format
● Partitioning table is not only a DB activity
● Primary key / Natural key ?
● Get the normalisation right
Interesting Read
http://www.ovaistariq.net/199/databases-normalization-or-denormalization-which-is-the-better-technique/#.W7yq5kUzYYI
Query optimization
Facts
● Index based on query and it’s fingerprint.
● Scans reduction can help you to decide index addition.
● Composite keys can be beneficial
● Complex queries can be broken down as SP’s.
● Don't add index on all your columns
● Adding too many index can slow down writes
Query optimization
Subqueries
● Rows returned by subquery decides usage.
● Few can be easily rewritten into joins.
long running queries
● sometimes it may require most of the data to be processed. (Summaries can help to speed up process).
● Locking can be a cause, Identify Cause.
● MySQL JSON explain is verbose and detailed.
Use Case
Our X is an e-commerce website and multi-brand top selling retailer selling beauty and wellness products from all
the leading brands. X is committed to bring to you the best and the biggest brands, an incredible shopping
experience and excellent customer service.
Use Case
● Amazon RDS 5.6
● Data Size 288 GB
● QPS 50k(Master)
● IOPS 6k(RW)
● CPU Spike 85%(Master)
Database
● Instance Type: R4.16xLarge
● vCpu: 64
● Memory: 488 GiB
● Disk: 1000(EBS)
● Provisioned IOPS: 5000
Master
● Instance Type: R4.8xLarge
● vCpu: 32
● Memory: 244 GiB
● Disk: 1000(EBS)
● Provisioned IOPS: 5000
Read Replicas
Problem Statements:
● Slow response from DB for both reads & Writes
● CPU usage in DB boxes rages to 85%.
● Unable to handle peak time load
● High connection usage
● DB locking at high Concurrency
Architecture
$ Cost of The Architecture
OPtimized Throughput of Instances provisioned
● Below is the Max throughput for the described instance, during stress test with sysbench load
https://www.slideshare.net/KiranVittalapurThimm/benchmarking-aws-instanceformysqldatabaseserverce
2
Machine Type CPU IO Throughput MAX Iops CPU Speed CPU Capacity
Anticipated
Write QPS
Anticipated
Read QPS
Approximate
Capacity
r4.8xlarge 32 875 37500 2.3 73.6 74210 76953 75582
r4.16xlarge 64 1750 75000 2.3 147 82429 99708 91069
Sysbench Benchmark
Anticipated Read QPS
● 99708 (Master)
● 74210 (Replica)
Anticipated Write QPS
● 82429 (Master)
● 74210 (Replica)
CPU Speed
● 2.3 (Master)
● 2.3 (Replica)
vCPU
● 64 (Master)
● 32 (Replica)
Machine Type
● R4.16xlarge (Master)
● R4.8xlarge (Replica)
Approximate Capacity
● 91069 (Master)
● 75582 (Replica)
Is the full capacity being used ?
Being having this Big server with High capacity, below is some of the usage at the Max.
● Mixed load QPS of 50k
● Max write IO usage at 4500 IOPS
● Max Read IO usage at 1500 IOPS
● CPU usage spiked at 85%
● Connections at a Range of 2k
Optimizations Done at DB level
● Complete review of the Systems CPU, IO usage (Audit)
● Query Optimization with Indexing and rewrite (Reduced high CPU and IO usage)
● Schema level optimisation to use the right data-type (Reduced disk & memory Footprint)
● Transaction logs resize based on the incoming write set (Reduced commit latency WRT writes)
● Parameter group changed with Optimised values based on the instance type
Applying all these in a step-by-step fashion, we could see a considerable performance improvement
Complete review of the System
Knowing what your system is upto is the best way to optimise based on the workload, We had used
PMM (Percona Monitoring & Management).
● Completely Open Source
● Easy to deploy
● Deeper insights on MySQL and Innodb Internals
● Real Time Performance Stats
● QAN (Query Analytics)
● Integration with Cloud watch.
● Beautiful Dashboards
Resolving Slow Writes
● Since with RDS this parameter Innodb_log_file_size remains the same as default of 128MB, Regardless of
workload.
● Redo log should hold at least an hour of transaction
● The hourly writes exceeded by a huge margin.
Resolving Slow Writes
● Having small transaction log size can slow down your write performance. Ie., commit latency, by waiting for
transaction logs to get freed up.
● After resizing InnoDB Transaction logs has reduced our write IO contention and CPU usage.
Resolving Slow Reads
● Focus on your top 20% queries
● Use the right tool to collect and visualise queries
Resolving slow Reads
● Queries were profiled against a test instance, new indexes and query rewrite was proposed.
● We had also identified some Duplicate indexes too.
● After applying new indexes, Query rewrite & also removing the duplicate index we see drastic improve in
performance.
Other Parameters Tweaks
● innodb_buffer_pool_dump_at_shutdown
● innodb_buffer_pool_load_at_startup
● innodb_checksum_algorithm
● innodb_file_format
● innodb_flush_log_at_trx_commit
● innodb_read_io_threads
● innodb_write_io_threads
● innodb_stats_persistent_sample_pages
● innodb_stats_transient_sample_pages
Schema level optimisation to use the right data-type & Duplicate Index Removed
Data types should be chosen based the characteristics of the DATA that will be stored,
Choosing the right data-type can help you to reduce your disk,Memory footprint which obviously helps in
faster writes and retrieval of data.
Having too many indexes instead of the right index can lead to duplicate index and which ultimately
reduces the write throughput of your DB, Since the index pages has also to be updated.
With our client X we had seen many duplicate index, which was analysed using the
pt-duplicate-key-checker.
Current Utilization and Future Scope
PAST PRESENT FUTURE(Expectation)
100K50K 50K
1 QPS
-
85% 40%2 CPU
8K+Burstable Capacity6K 2.5K3 IOPS
What We Changed Here?
What We Changed Here?
50%
Current Instance Type and its Cost
How much they paid
How much we reduced
Total Saving: $27570/mo
Queries
Contact us
Email : info@mydbops.com
Phone : 08048505683
www.mydbops.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
What is new in Galera 4 ?
What is new in Galera 4 ?What is new in Galera 4 ?
What is new in Galera 4 ?
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & Optimization
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)
 
MySQL Performance Schema in Action
MySQL Performance Schema in Action MySQL Performance Schema in Action
MySQL Performance Schema in Action
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
High Availability With InnoDB Clusters
High Availability With InnoDB ClustersHigh Availability With InnoDB Clusters
High Availability With InnoDB Clusters
 
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
 
Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®Global Data Replication with Galera for Ansell Guardian®
Global Data Replication with Galera for Ansell Guardian®
 
MySQL HA Percona cluster @ MySQL meetup Mumbai
MySQL HA Percona cluster @ MySQL meetup MumbaiMySQL HA Percona cluster @ MySQL meetup Mumbai
MySQL HA Percona cluster @ MySQL meetup Mumbai
 
Insight on MongoDB Change Stream - Abhishek.D, Mydbops Team
Insight on MongoDB Change Stream - Abhishek.D, Mydbops TeamInsight on MongoDB Change Stream - Abhishek.D, Mydbops Team
Insight on MongoDB Change Stream - Abhishek.D, Mydbops Team
 
PostgreSQL and MySQL
PostgreSQL and MySQLPostgreSQL and MySQL
PostgreSQL and MySQL
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores MyDUMPER : Faster logical backups and restores
MyDUMPER : Faster logical backups and restores
 
Inside CynosDB: MariaDB optimized for the cloud at Tencent
Inside CynosDB: MariaDB optimized for the cloud at TencentInside CynosDB: MariaDB optimized for the cloud at Tencent
Inside CynosDB: MariaDB optimized for the cloud at Tencent
 
Faster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDBFaster, better, stronger: The new InnoDB
Faster, better, stronger: The new InnoDB
 
Configuring workload-based storage and topologies
Configuring workload-based storage and topologiesConfiguring workload-based storage and topologies
Configuring workload-based storage and topologies
 

Ähnlich wie Evolution of DBA in the Cloud Era

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
Morgan Tocker
 

Ähnlich wie Evolution of DBA in the Cloud Era (20)

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
MariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and OptimizationMariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and Optimization
 
Running MySQL in AWS
Running MySQL in AWSRunning MySQL in AWS
Running MySQL in AWS
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
 
Enabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speedEnabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speed
 
EQUNIX - PPT 11DB-Postgres™.pdf
EQUNIX - PPT 11DB-Postgres™.pdfEQUNIX - PPT 11DB-Postgres™.pdf
EQUNIX - PPT 11DB-Postgres™.pdf
 
Enabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speedEnabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speed
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptx
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
Maximizing performance via tuning and optimization
Maximizing performance via tuning and optimizationMaximizing performance via tuning and optimization
Maximizing performance via tuning and optimization
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 
Eko10 Workshop Opensource Database Auditing
Eko10  Workshop Opensource Database AuditingEko10  Workshop Opensource Database Auditing
Eko10 Workshop Opensource Database Auditing
 
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
 
MongoDB Online Training.pdf
MongoDB Online Training.pdfMongoDB Online Training.pdf
MongoDB Online Training.pdf
 
Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...
Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...
Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...
 
Redis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs TalksRedis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs Talks
 
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminThe Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
 

Mehr von Mydbops

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 

Mehr von Mydbops (20)

Efficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL ExplainEfficient MySQL Indexing and what's new in MySQL Explain
Efficient MySQL Indexing and what's new in MySQL Explain
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding
 

Kürzlich hochgeladen

Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 

Kürzlich hochgeladen (20)

Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 

Evolution of DBA in the Cloud Era

  • 1. Evolution of DBA in the Cloud Era Presenter by Manosh Malai Kabilesh PR www.mydbops.com info@mydbops.com
  • 2. Kabilesh P.R Co-Founder/DB Consultant @Mydbops kabi@mydbops.com Manosh Malai Senior Devops and DB/Cloud Consultant @Mydbops mmalai@mydbops.com @ManoshMalai About us
  • 3. Mydbops at a Glance ● Mydbops is on Database Consulting with core specialization on MySQL and MongoDB Administration and Support. Scaling a few largest MySQL Farms in India and US. ● Mydbops was created with a motto of developing a Devops model for Database administration. ● We help organisations to scale in MySQL/Mongo and implement the advanced technologies in MySQL/Mongo. ● Founded in 2015, HQ in Bangalore India, 25 Employees.
  • 4. Mydbops at a GlanceHappy Customers 4
  • 5. Agenda ● DBA’s Top responsibilities before cloud & after DBaaS ● Fascinating features in DBaaS ● Where DBA skills are needed in cloud. ● Choosing the right vendor. ● Capacity planning and Cost management ● DBA role in cloud ● Real production use case ● Conclusion
  • 6. DBA’s Top Responsibilities: Before Cloud Installing, upgrades and Patching Fine Tuning React to DB issues Backup/Recovery Ensure DB Availability
  • 7. After DBaas Purview of The DBass Provider Installing, upgrading and Patching Monitoring & Alerting Some level Config Tweaking Backup
  • 8. Fascinating Feature in DBaaS Elasticity ● Provisioned IOPS ● Instance resize in minutes (vertical) Security & Patching ● Host level security is provided by Vendor ● Host patches is also taken by vendor HA ● Multi-Availability Zones ● Cross-Region Replicas ● Scale out globally Scalability ● Read-replica within region(horizontal) ● Load balancer
  • 9. DBaas eliminate the need of DB Expertise?
  • 10. Database Schema Design and Optimization Where DBA Skill needed on Cloud? Experience on Cost Control ($) Query Optimization Support on Choosing Cloud Vendor In-depth knowledge of Capacity planning Database Schema Design and Optimisation Expertise in Database Infrastructure Design
  • 11. Provide Cloud Vendor Advice Lot of Parameters need to be consider before choosing a right Cloud vendor
  • 13. Database Features & Control 4 Full Customizable RAM, Disk Size & Instance Type 5 Replication Technology 1 DB Super User Access 2 SSH Access To Underlying Machine 3 Plugin Extension Support 6 Custom Read Replica Set Config
  • 14. Backup and Security 4 Encryption at Rest 5 Control Access With Security Group 1 Custom Schedule For Backup 2 Selective Restores 3 Continuous Backup/Point-In-Time Recovery
  • 15. Support and Monitoring 4 Configuration Management & Tuning 5 24X7 Support, 1 Hour Response SLA 1 Access to DB Server Logs 2 Monitoring OS & DB Metrics 3 Slow Query Analysis
  • 16. Capacity Planning and Cost Management ● Capacity planning for the cloud isn’t about getting an exactly right answer. ● Aim to avoid underestimation or overestimation. ● Check with current footprint of the database including any advance feature such as standby and clustering ? Do Right-Sizing ● Measuring and Managing ROI ○ You can't manage what you can't measure. ○ Before scaling the resource we need to answer the question what, where, when, why and how it meet the business requirement. ○ we know ROI is then a matter of acting on that data.
  • 17. Database Infrastructure Design ● Understand your system limits. ● Estimate your application throughput at Peak. ● Distribute the load. ● Do not hard code endpoints, Use LB / DNS. ● Group servers based on business flows, Do not mix ○ Prod ○ Reports ○ Analytics ● Handle connection pooling with care. ● Having decades of data ? Think where it can be handled better
  • 18. Database Schema ● Choose right data type the data requires. ● Aware of data type limitations with Texts, Blobs, Json when used ● Choose right storage engine, format ● Partitioning table is not only a DB activity ● Primary key / Natural key ? ● Get the normalisation right Interesting Read http://www.ovaistariq.net/199/databases-normalization-or-denormalization-which-is-the-better-technique/#.W7yq5kUzYYI
  • 19. Query optimization Facts ● Index based on query and it’s fingerprint. ● Scans reduction can help you to decide index addition. ● Composite keys can be beneficial ● Complex queries can be broken down as SP’s. ● Don't add index on all your columns ● Adding too many index can slow down writes
  • 20. Query optimization Subqueries ● Rows returned by subquery decides usage. ● Few can be easily rewritten into joins. long running queries ● sometimes it may require most of the data to be processed. (Summaries can help to speed up process). ● Locking can be a cause, Identify Cause. ● MySQL JSON explain is verbose and detailed.
  • 21. Use Case Our X is an e-commerce website and multi-brand top selling retailer selling beauty and wellness products from all the leading brands. X is committed to bring to you the best and the biggest brands, an incredible shopping experience and excellent customer service.
  • 22. Use Case ● Amazon RDS 5.6 ● Data Size 288 GB ● QPS 50k(Master) ● IOPS 6k(RW) ● CPU Spike 85%(Master) Database ● Instance Type: R4.16xLarge ● vCpu: 64 ● Memory: 488 GiB ● Disk: 1000(EBS) ● Provisioned IOPS: 5000 Master ● Instance Type: R4.8xLarge ● vCpu: 32 ● Memory: 244 GiB ● Disk: 1000(EBS) ● Provisioned IOPS: 5000 Read Replicas
  • 23. Problem Statements: ● Slow response from DB for both reads & Writes ● CPU usage in DB boxes rages to 85%. ● Unable to handle peak time load ● High connection usage ● DB locking at high Concurrency
  • 25. $ Cost of The Architecture
  • 26. OPtimized Throughput of Instances provisioned ● Below is the Max throughput for the described instance, during stress test with sysbench load https://www.slideshare.net/KiranVittalapurThimm/benchmarking-aws-instanceformysqldatabaseserverce 2 Machine Type CPU IO Throughput MAX Iops CPU Speed CPU Capacity Anticipated Write QPS Anticipated Read QPS Approximate Capacity r4.8xlarge 32 875 37500 2.3 73.6 74210 76953 75582 r4.16xlarge 64 1750 75000 2.3 147 82429 99708 91069
  • 27. Sysbench Benchmark Anticipated Read QPS ● 99708 (Master) ● 74210 (Replica) Anticipated Write QPS ● 82429 (Master) ● 74210 (Replica) CPU Speed ● 2.3 (Master) ● 2.3 (Replica) vCPU ● 64 (Master) ● 32 (Replica) Machine Type ● R4.16xlarge (Master) ● R4.8xlarge (Replica) Approximate Capacity ● 91069 (Master) ● 75582 (Replica)
  • 28. Is the full capacity being used ? Being having this Big server with High capacity, below is some of the usage at the Max. ● Mixed load QPS of 50k ● Max write IO usage at 4500 IOPS ● Max Read IO usage at 1500 IOPS ● CPU usage spiked at 85% ● Connections at a Range of 2k
  • 29. Optimizations Done at DB level ● Complete review of the Systems CPU, IO usage (Audit) ● Query Optimization with Indexing and rewrite (Reduced high CPU and IO usage) ● Schema level optimisation to use the right data-type (Reduced disk & memory Footprint) ● Transaction logs resize based on the incoming write set (Reduced commit latency WRT writes) ● Parameter group changed with Optimised values based on the instance type Applying all these in a step-by-step fashion, we could see a considerable performance improvement
  • 30. Complete review of the System Knowing what your system is upto is the best way to optimise based on the workload, We had used PMM (Percona Monitoring & Management). ● Completely Open Source ● Easy to deploy ● Deeper insights on MySQL and Innodb Internals ● Real Time Performance Stats ● QAN (Query Analytics) ● Integration with Cloud watch. ● Beautiful Dashboards
  • 31. Resolving Slow Writes ● Since with RDS this parameter Innodb_log_file_size remains the same as default of 128MB, Regardless of workload. ● Redo log should hold at least an hour of transaction ● The hourly writes exceeded by a huge margin.
  • 32. Resolving Slow Writes ● Having small transaction log size can slow down your write performance. Ie., commit latency, by waiting for transaction logs to get freed up. ● After resizing InnoDB Transaction logs has reduced our write IO contention and CPU usage.
  • 33. Resolving Slow Reads ● Focus on your top 20% queries ● Use the right tool to collect and visualise queries
  • 34. Resolving slow Reads ● Queries were profiled against a test instance, new indexes and query rewrite was proposed. ● We had also identified some Duplicate indexes too. ● After applying new indexes, Query rewrite & also removing the duplicate index we see drastic improve in performance.
  • 35. Other Parameters Tweaks ● innodb_buffer_pool_dump_at_shutdown ● innodb_buffer_pool_load_at_startup ● innodb_checksum_algorithm ● innodb_file_format ● innodb_flush_log_at_trx_commit ● innodb_read_io_threads ● innodb_write_io_threads ● innodb_stats_persistent_sample_pages ● innodb_stats_transient_sample_pages
  • 36. Schema level optimisation to use the right data-type & Duplicate Index Removed Data types should be chosen based the characteristics of the DATA that will be stored, Choosing the right data-type can help you to reduce your disk,Memory footprint which obviously helps in faster writes and retrieval of data. Having too many indexes instead of the right index can lead to duplicate index and which ultimately reduces the write throughput of your DB, Since the index pages has also to be updated. With our client X we had seen many duplicate index, which was analysed using the pt-duplicate-key-checker.
  • 37. Current Utilization and Future Scope PAST PRESENT FUTURE(Expectation) 100K50K 50K 1 QPS - 85% 40%2 CPU 8K+Burstable Capacity6K 2.5K3 IOPS
  • 39. What We Changed Here? 50%
  • 40. Current Instance Type and its Cost
  • 42. How much we reduced Total Saving: $27570/mo
  • 44. Contact us Email : info@mydbops.com Phone : 08048505683 www.mydbops.com