SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationFrederic Descamps
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorialFrederic Descamps
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...Frederic Descamps
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesFrederic Descamps
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesFrederic Descamps
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScaleMariaDB plc
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLOlivier DASINI
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)Altinity Ltd
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLKenny Gryp
 
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
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)Kenny Gryp
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewRené Cannaò
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 

Was ist angesagt? (20)

MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best Practices
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database System
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
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
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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 InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialKenny 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
 

Mehr von Kenny Gryp (11)

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 InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
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
 

Kürzlich hochgeladen

JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.Sharon Liu
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 

Kürzlich hochgeladen (20)

JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 

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