SlideShare a Scribd company logo
1 of 26
Download to read offline
MySQL Connectors 8.0.19
& DNS SRV
with examples using docker & consul
Kenny Gryp
MySQL Product Manager
1 / 19
2 / 192 / 19
 
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purpose only, and may not be
incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied up
in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle´s
product remains at the sole discretion of Oracle.
3 / 19
DNS-SRV
DNS Service record - RFC 2782
"defining the location, i.e., the hostname and port number, of servers for specified services"
Example
_service._proto.name. TTL class SRV priority weight port target.
_mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_1.domain.
_mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_2.domain.
_mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_3.domain.
...
4 / 19
What is DNS-SRV
# dig database-router-ro.service.consul SRV
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> database-router-ro.service.consul SRV
...
;; QUESTION SECTION:
;database-router-ro.service.consul. IN SRV
;; ANSWER SECTION:
database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac14000a.addr.dc1.consul.
database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac140007.addr.dc1.consul.
database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac14000b.addr.dc1.consul.
;; ADDITIONAL SECTION:
ac14000a.addr.dc1.consul. 0 IN A 172.20.0.10
ac140007.addr.dc1.consul. 0 IN A 172.20.0.7
ac14000b.addr.dc1.consul. 0 IN A 172.20.0.11
;; Query time: 6 msec
;; SERVER: 172.20.0.2#53(172.20.0.2)
;; WHEN: Mon Jan 27 19:43:07 UTC 2020
;; MSG SIZE rcvd: 560
5 / 19
How do I configure DNS-SRV?
Do I need to configure BIND and list the Database Servers manually?
6 / 19
How do I configure DNS-SRV?
Do I need to configure BIND and list the Database Servers manually? NO!
Use Service Discovery Tools!
6 / 19
How do I configure DNS-SRV?
Do I need to configure BIND and list the Database Servers manually? NO!
Use Service Discovery Tools!
Service Discovery Tools
   
   
 
6 / 19
How do I configure DNS-SRV?
Do I need to configure BIND and list the Database Servers manually? NO!
Use Service Discovery Tools!
Service Discovery Tools
   
   
 
Container Orchestration
6 / 19
Released for native protocol connectors
Connector/NET
Connector/ODBC
Connector/J
Connector/Node.js
Connector/Python
Connector/C++
Both X & Classic Protocol
MySQL 8.0.19 Supports DNS-SRV
7 / 19
Released for native protocol connectors
Connector/NET
Connector/ODBC
Connector/J
Connector/Node.js
Connector/Python
Connector/C++
Both X & Classic Protocol
In progress for...
Connector/C / libmysqlclient
& dependent community connectors:
Perl
MySQL/Ruby
mysql-python
PHP Plugin
Awaiting PHP release
Not started...
native community drivers:
go-sql-driver
MySQL 8.0.19 Supports DNS-SRV
7 / 19
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Use Cases - MySQL InnoDB Cluster / ReplicaSet
When MySQL Router cannot be installed on Application servers!
8 / 19
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Use Cases - MySQL InnoDB Cluster / ReplicaSet
When MySQL Router cannot be installed on Application servers!
9 / 19
Use Cases
Ease of Use
Changes in database architecture does not require handling/changing:
virtual IPs
Load Balancers
change connector configuration
consul-template
Elasticity
New endpoints can register/deregister, adding/removing them from service discovery
Customization
Ability to customize & automate integration from application to data
10 / 19
MySQL InnoDB Cluster Steps
1. Router Starts
2. consul-agent register with consul cluster
3. consul-agent performs health checks
4. connectors do DNS SRV request to find MySQL Router
servers
How to Use -- 1. Registration & Health Checking
11 / 19
DNS Server Level: Local Forwarders
dnsmasq
How to Use -- 2. DNS Forwarding
1. Connectors do not do any form of caching or forwarding.
Every new connection does a new DNS SRV request.
2. Service Discovery is usually different from other DNS infrastructure, which then requires DNS Forwarding
Excellent implementation guide:
HashiCorp - Consul - Forward DNS
12 / 19
How to Use -- 3. Example Connector/Python Configuration
Example:
cnx = mysql.connector.connect(
user='root', password='mysql',
host='database-router-rw.service',
dns_srv=True)
13 / 19
How to Use -- 3. Example Connector/Python Configuration
Example:
cnx = mysql.connector.connect(
user='root', password='mysql',
host='database-router-rw.service',
dns_srv=True)
Wait... not according to RFC 2782? (expecting _mysql._tcp.service)
13 / 19
How to Use -- 3. Example Connector/Python Configuration
Example:
cnx = mysql.connector.connect(
user='root', password='mysql',
host='database-router-rw.service',
dns_srv=True)
Wait... not according to RFC 2782? (expecting _mysql._tcp.service)
Nope
13 / 19
How to Use -- 3. Example Connector/Python Configuration
Example:
cnx = mysql.connector.connect(
user='root', password='mysql',
host='database-router-rw.service',
dns_srv=True)
Wait... not according to RFC 2782? (expecting _mysql._tcp.service)
Nope
Consul does not fully adhere to RFC, allowing:
# all
database-router-rw.service
_database-router-rw._tcp.service
# tag ghent
ghent.database-router-rw.service
_database-router-rw._ghent.service
13 / 19
Priority
Servers with lower priority MUST be attempted
(Not supported by Consul)
Weight
Larger weights SHOULD be given a proportionately higher
probability of being selected.
(Supported by Consul)
DNS SRV Priority & Weights -- According to RFC 2782
Connectors implement RFC:
Calculation
For each Priority (lowest first)
calculated SUM(weights), assign each number to a Server
choose random number BETWEEN 0 AND SUM(weights)
find server that is greater than or equal the random number
14 / 19
TTL
TTL can be configured to allow caching on DNS Level, but be wary of impact:
TTL of 0 means no caching:
service discovery that is down will result in database connection issues
TTL that is too high reduces flexibility:
takes time before a broken server is taken out of the pool, causing connection issues
(Supported by Consul)
DNS Servers/Caching/Forwarders configuration might not respect TTL, doublecheck!
15 / 19
MySQL InnoDB Cluster MySQL InnoDB Cluster
Endless Possibilities
16 / 19
Docker as Environment
Consul as Service Discovery
Registrator as Service Registry
MySQL InnoDB Cluster as Database Backend
MySQL Router as Proxy
Python Application to demonstrate
Demo
17 / 19
Demo time!
18 / 19
MySQL Connectors 8.0.19
& DNS SRV
with examples using docker & consul
Kenny Gryp
MySQL Product Manager
19 / 19

More Related Content

What's hot

MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMiguel Araújo
 
Node.js and the MySQL Document Store
Node.js and the MySQL Document StoreNode.js and the MySQL Document Store
Node.js and the MySQL Document StoreRui Quelhas
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionMarkus Michalewicz
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsMydbops
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Miguel Araújo
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesKenny Gryp
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB plc
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Severalnines
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoKeith Hollman
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !Frederic Descamps
 
MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!Vittorio Cioe
 
Proxysql sharding
Proxysql shardingProxysql sharding
Proxysql shardingMarco Tusa
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaJoe Stein
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
 

What's hot (20)

MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
 
Node.js and the MySQL Document Store
Node.js and the MySQL Document StoreNode.js and the MySQL Document Store
Node.js and the MySQL Document Store
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion Edition
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !
 
MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!
 
MySQL Cluster Basics
MySQL Cluster BasicsMySQL Cluster Basics
MySQL Cluster Basics
 
Proxysql sharding
Proxysql shardingProxysql sharding
Proxysql sharding
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
 

Similar to MySQL Connectors 8.0.19 & DNS SRV

PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusDashamir Hoxha
 
Oracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesOracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesMarkus Flechtner
 
Com 135 final project user manual
Com 135 final project user manualCom 135 final project user manual
Com 135 final project user manualbiasimistfur1984
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyMediafly
 
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...Mydbops
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdfssusercbaa33
 
Get your instance by name integration of nova, neutron and designate
Get your instance by name  integration of nova, neutron and designateGet your instance by name  integration of nova, neutron and designate
Get your instance by name integration of nova, neutron and designateMiguel Lavalle
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodLudovico Caldara
 
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Big Data Spain
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rulesFreddy Buenaño
 
Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Dave Stokes
 
Flink sql for continuous sql etl apps & Apache NiFi devops
Flink sql for continuous sql etl apps & Apache NiFi devopsFlink sql for continuous sql etl apps & Apache NiFi devops
Flink sql for continuous sql etl apps & Apache NiFi devopsTimothy Spann
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
101 apend. networking linux
101 apend. networking linux101 apend. networking linux
101 apend. networking linuxAcácio Oliveira
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationRadek Baczynski
 

Similar to MySQL Connectors 8.0.19 & DNS SRV (20)

PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and Radius
 
Oracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesOracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection Issues
 
Com 135 final project user manual
Com 135 final project user manualCom 135 final project user manual
Com 135 final project user manual
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
 
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...
 
Simplify Networking for Containers
Simplify Networking for ContainersSimplify Networking for Containers
Simplify Networking for Containers
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdf
 
Get your instance by name integration of nova, neutron and designate
Get your instance by name  integration of nova, neutron and designateGet your instance by name  integration of nova, neutron and designate
Get your instance by name integration of nova, neutron and designate
 
Oracle Client Failover - Under The Hood
Oracle Client Failover - Under The HoodOracle Client Failover - Under The Hood
Oracle Client Failover - Under The Hood
 
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019Python And The MySQL X DevAPI - PyCaribbean 2019
Python And The MySQL X DevAPI - PyCaribbean 2019
 
Flink sql for continuous sql etl apps & Apache NiFi devops
Flink sql for continuous sql etl apps & Apache NiFi devopsFlink sql for continuous sql etl apps & Apache NiFi devops
Flink sql for continuous sql etl apps & Apache NiFi devops
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
101 apend. networking linux
101 apend. networking linux101 apend. networking linux
101 apend. networking linux
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
Docker for mac & local developer environment optimization
Docker for mac & local developer environment optimizationDocker for mac & local developer environment optimization
Docker for mac & local developer environment optimization
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
Quad9 and DNS Privacy
Quad9 and DNS PrivacyQuad9 and DNS Privacy
Quad9 and DNS Privacy
 
Load demo-oct2016
Load demo-oct2016Load demo-oct2016
Load demo-oct2016
 

More from Kenny Gryp

MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08Kenny Gryp
 
MySQL Operator for Kubernetes
MySQL Operator for KubernetesMySQL Operator for Kubernetes
MySQL Operator for KubernetesKenny Gryp
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialKenny Gryp
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLKenny Gryp
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureKenny Gryp
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialKenny Gryp
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupKenny Gryp
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteKenny Gryp
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationKenny Gryp
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB ClusterKenny Gryp
 

More from Kenny Gryp (13)

MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08
 
MySQL Operator for Kubernetes
MySQL Operator for KubernetesMySQL Operator for Kubernetes
MySQL Operator for Kubernetes
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suite
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & Optimization
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB Cluster
 

Recently uploaded

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainAbdul Ahad
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotEdgard Alejos
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 

Recently uploaded (20)

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software Domain
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform Copilot
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 

MySQL Connectors 8.0.19 & DNS SRV

  • 1. MySQL Connectors 8.0.19 & DNS SRV with examples using docker & consul Kenny Gryp MySQL Product Manager 1 / 19
  • 2. 2 / 192 / 19
  • 3.   Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purpose only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle´s product remains at the sole discretion of Oracle. 3 / 19
  • 4. DNS-SRV DNS Service record - RFC 2782 "defining the location, i.e., the hostname and port number, of servers for specified services" Example _service._proto.name. TTL class SRV priority weight port target. _mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_1.domain. _mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_2.domain. _mysql._tcp.domain. 0 IN SRV 0 5 3306 mysql_server_3.domain. ... 4 / 19
  • 5. What is DNS-SRV # dig database-router-ro.service.consul SRV ; <<>> DiG 9.11.5-P4-5.1-Debian <<>> database-router-ro.service.consul SRV ... ;; QUESTION SECTION: ;database-router-ro.service.consul. IN SRV ;; ANSWER SECTION: database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac14000a.addr.dc1.consul. database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac140007.addr.dc1.consul. database-router-ro.service.consul. 0 IN SRV 1 1 6447 ac14000b.addr.dc1.consul. ;; ADDITIONAL SECTION: ac14000a.addr.dc1.consul. 0 IN A 172.20.0.10 ac140007.addr.dc1.consul. 0 IN A 172.20.0.7 ac14000b.addr.dc1.consul. 0 IN A 172.20.0.11 ;; Query time: 6 msec ;; SERVER: 172.20.0.2#53(172.20.0.2) ;; WHEN: Mon Jan 27 19:43:07 UTC 2020 ;; MSG SIZE rcvd: 560 5 / 19
  • 6. How do I configure DNS-SRV? Do I need to configure BIND and list the Database Servers manually? 6 / 19
  • 7. How do I configure DNS-SRV? Do I need to configure BIND and list the Database Servers manually? NO! Use Service Discovery Tools! 6 / 19
  • 8. How do I configure DNS-SRV? Do I need to configure BIND and list the Database Servers manually? NO! Use Service Discovery Tools! Service Discovery Tools           6 / 19
  • 9. How do I configure DNS-SRV? Do I need to configure BIND and list the Database Servers manually? NO! Use Service Discovery Tools! Service Discovery Tools           Container Orchestration 6 / 19
  • 10. Released for native protocol connectors Connector/NET Connector/ODBC Connector/J Connector/Node.js Connector/Python Connector/C++ Both X & Classic Protocol MySQL 8.0.19 Supports DNS-SRV 7 / 19
  • 11. Released for native protocol connectors Connector/NET Connector/ODBC Connector/J Connector/Node.js Connector/Python Connector/C++ Both X & Classic Protocol In progress for... Connector/C / libmysqlclient & dependent community connectors: Perl MySQL/Ruby mysql-python PHP Plugin Awaiting PHP release Not started... native community drivers: go-sql-driver MySQL 8.0.19 Supports DNS-SRV 7 / 19
  • 12. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Use Cases - MySQL InnoDB Cluster / ReplicaSet When MySQL Router cannot be installed on Application servers! 8 / 19
  • 13. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Use Cases - MySQL InnoDB Cluster / ReplicaSet When MySQL Router cannot be installed on Application servers! 9 / 19
  • 14. Use Cases Ease of Use Changes in database architecture does not require handling/changing: virtual IPs Load Balancers change connector configuration consul-template Elasticity New endpoints can register/deregister, adding/removing them from service discovery Customization Ability to customize & automate integration from application to data 10 / 19
  • 15. MySQL InnoDB Cluster Steps 1. Router Starts 2. consul-agent register with consul cluster 3. consul-agent performs health checks 4. connectors do DNS SRV request to find MySQL Router servers How to Use -- 1. Registration & Health Checking 11 / 19
  • 16. DNS Server Level: Local Forwarders dnsmasq How to Use -- 2. DNS Forwarding 1. Connectors do not do any form of caching or forwarding. Every new connection does a new DNS SRV request. 2. Service Discovery is usually different from other DNS infrastructure, which then requires DNS Forwarding Excellent implementation guide: HashiCorp - Consul - Forward DNS 12 / 19
  • 17. How to Use -- 3. Example Connector/Python Configuration Example: cnx = mysql.connector.connect( user='root', password='mysql', host='database-router-rw.service', dns_srv=True) 13 / 19
  • 18. How to Use -- 3. Example Connector/Python Configuration Example: cnx = mysql.connector.connect( user='root', password='mysql', host='database-router-rw.service', dns_srv=True) Wait... not according to RFC 2782? (expecting _mysql._tcp.service) 13 / 19
  • 19. How to Use -- 3. Example Connector/Python Configuration Example: cnx = mysql.connector.connect( user='root', password='mysql', host='database-router-rw.service', dns_srv=True) Wait... not according to RFC 2782? (expecting _mysql._tcp.service) Nope 13 / 19
  • 20. How to Use -- 3. Example Connector/Python Configuration Example: cnx = mysql.connector.connect( user='root', password='mysql', host='database-router-rw.service', dns_srv=True) Wait... not according to RFC 2782? (expecting _mysql._tcp.service) Nope Consul does not fully adhere to RFC, allowing: # all database-router-rw.service _database-router-rw._tcp.service # tag ghent ghent.database-router-rw.service _database-router-rw._ghent.service 13 / 19
  • 21. Priority Servers with lower priority MUST be attempted (Not supported by Consul) Weight Larger weights SHOULD be given a proportionately higher probability of being selected. (Supported by Consul) DNS SRV Priority & Weights -- According to RFC 2782 Connectors implement RFC: Calculation For each Priority (lowest first) calculated SUM(weights), assign each number to a Server choose random number BETWEEN 0 AND SUM(weights) find server that is greater than or equal the random number 14 / 19
  • 22. TTL TTL can be configured to allow caching on DNS Level, but be wary of impact: TTL of 0 means no caching: service discovery that is down will result in database connection issues TTL that is too high reduces flexibility: takes time before a broken server is taken out of the pool, causing connection issues (Supported by Consul) DNS Servers/Caching/Forwarders configuration might not respect TTL, doublecheck! 15 / 19
  • 23. MySQL InnoDB Cluster MySQL InnoDB Cluster Endless Possibilities 16 / 19
  • 24. Docker as Environment Consul as Service Discovery Registrator as Service Registry MySQL InnoDB Cluster as Database Backend MySQL Router as Proxy Python Application to demonstrate Demo 17 / 19
  • 26. MySQL Connectors 8.0.19 & DNS SRV with examples using docker & consul Kenny Gryp MySQL Product Manager 19 / 19