Deep Dive into MySQL InnoDB Cluster
Read Scale-out Capabilities
MySQL Webinar Series
Miguel Araújo
Senior Principal Software Engineer
MySQL, Oracle
October 26, 2023
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.
Safe Harbor Statement
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
2
1. Business requirements
2. High Availability & Disaster Recovery Architectures
3. What architecture fits my requirements?
4. MySQL InnoDB Cluster Read Replicas
5. Live Demo
Agenda
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
3
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
4
It Disasters & Outages
Primary Causes
5 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
IT Disasters & Outages
On-site power failure is the biggest cause of significant outages
Costs are Rising
6 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
IT Disasters & Outages
Over half had experienced an outage costing more than $100,000
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
7
Business Requirements
Concepts – RTO & RPO
• RTO: Recovery Time Objective
• How long does it take to recover from a single
failure
• RPO: Recovery Point Objective
• How much data can be lost when a failure occurs
Types of Failures
• High Availability:
• Single Server Failure, Network Partition
• Disaster Recovery:
• Full Region / Network failure
• Human Error:
• Little Bobby Tables
8 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Business Requirements
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
9
High Availability & Disaster Recovery
Architectures
Manual
• Setting up Replication topology was usually
done manually, taking many steps
Including user management, restoring backups,
configuring replication...
• MySQL only offered the technical pieces,
leaving it up to the user to setup an (always
customized) architecture
• Even required other software ... bringing lots
of work for DBA's and experts, who spent their
time automating and integrating their
customized architecture
10 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Past
11 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL Solutions
One Product: MySQL
• All components developed and integrated
together
• MySQL Server
• Async Replication
• Group Replication
• MySQL Shell
• MySQL Router
• Full stack testing
Easy to use!
• One client: MySQL Shell
• Powerful interface to automate and integrate all
components
• Integrated orchestration and provisioning
• InnoDB Clone
• Configures the topologies in a standarized best
practice, preventing mistakes
• Transparent Access to Database
Architecture: MySQL Router
• Load balancing
• Application connection failover
• Stateless
'classic', 'asynchronous' Replication based
Solution, fully integrated
• MySQL Shell
• MySQL Router
• MySQL Server
12 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB ReplicaSet
RPO != 0
RTO = minutes or more (manual failover)
High Availability solution based on Group
Replication, fully integrated
• MySQL Shell
• MySQL Router
• MySQL Server
• Group Replication providing:
• Automatic Failover / Fault Tolerance
• Automatic membership changes
• Network partition handling
• Consistency
• …
13 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster
RPO = 0
RTO = seconds (automatic failover)
Disaster Tolerance Solution for InnoDB
Clusters deployments in alternate
locations, fully integrated
• High Availability (Failure within a Region)
• RPO = 0
• RTO = seconds (automatic failover)
• Disaster Recovery (Region Failure)
• RPO != 0
• RTO = minutes or more (manual failover)
• No write performance impact
• Easy to use: MySQL Shell
• Full integration of MySQL Router
14 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB ClusterSet
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
15
What architecture fits my requirements?
Single Region
MySQL InnoDB Cluster
• RPO = 0
• RTO = Seconds
MySQL InnoDB ReplicaSet
• RPO != 0
• RTO = Minutes or more (Manual failover)
16 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
High Availability
Best write performance
Manual Failover
🔴
🟢
Automatic failover
🟢
Multi Region
17 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
High Availability
MySQL InnoDB Cluster: Deployed over multiple regions
Multi-Region Multi-Primary
3 DC
Requires very stable WAN
Write performance affected by latency between DCs
• RPO = 0
• RTO = Seconds
🟢
🔴
🔴
🔴
Multi Region
18 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Disaster Recovery
MySQL InnoDB ClusterSet
RPO = 0 & RTO = seconds within Region (HA)
Write performance (no sync to other region required)
Higher RTO: Manual failover
RPO != 0 when region fails
• RPO != 0
• RTO = Minutes or more
(Manual Failover)
🔴
🔴
🟢
🟢
Scaling issues
• High loads on the Cluster
members
• Primary or Secondaries
• Read intensive workloads
Special purpose instances
• Dedicated instances for
reporting
Safety
• Additional redundancy for
the dataset
19 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Other Requirements
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
20
MySQL InnoDB Cluster Read Replicas
21 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas
Fully integrated solution for Read Scale-out
Read Scale-out
• Add any amount of async read replicas to a
Cluster
• Replicate/Failover from
• PRIMARY
• SECONDARIES
• LIST of candidates
Fully supported on
• InnoDB Cluster
• InnoDB ClusterSet
22 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas
23
• MySQL Shell
• Familiar interface and great usability
• Support for CLONE
• Add/remove Read Replicas online
• Configure Read Replicas and Router behavior
• MySQL Router
• No application changes needed if the topology
changes
• Chose where to send traffic
• MySQL Server Replication
• Automatic connection failover
• Automatic list of potential sources populated by
Group Replication
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas
• Asynchronous replication connection failover ensures automatic failover of the replica’s source
• The list is automatic populated by Group Replication
• Group membership info is fetched to keep the list up-to-date
• The priority can be configured:
• Prefer to replicate from the PRIMARY
• Prefer replication from one of the SECONDARIES
• Have a LIST of possible candidates
24 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Under the Hood
Follow the Source
• R/O traffic is routed to the Cluster’s SECONDARY members, by default
• But it can be configured, at any moment and dynamically:
• secondaries: Use only SECONDARY members
• read_replicas: Use only Read Replicas
• all: Use Read Replicas and SECONDARY members
25 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Under the Hood
Router’s Destination Pool
• Read Replicas do not belong to the group membership info of Group Replication
• To avoid connection failures to unreachable/unavailable members, Router implements a built-in
quarantine mechanism.
• Quarantine is configurable:
• Threshold: how many failed connections attempts are accepted until a server is put in quarantine
• How frequently should the quarantine servers be checked for health
• By default, both are set to 1.
26 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Under the Hood
Router’s Health Checking and Quarantine
• Add a Read Replica:
<Cluster>.addReplicaInstance(instance[, options])
• Configure Router’s destination pool:
<Cluster>.setRoutingOptions([router], “read_only_targets”, <value>)
• Change Read Replica source/failover candidates, or hide it:
<Cluster>.setInstanceOption([instance], “replicationSources”, <value>)
<Cluster>.setInstanceOption([instance], “tag: _hidden”, <value>)
27 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Usability
AdminAPI
• Rejoin or update current Read Replica’s source :
<Cluster>.rejoinInstance(instance[, options])
• Remove a Read Replica:
<Cluster>.removeInstance(instance[, options])
• Monitor / Consult
<Cluster>.status() / <Cluster>.describe()
<Cluster>.routingOptions()
28 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Usability
AdminAPI
• Requires MySQL Router & Shell version 8.1.0 or higher
• Requires MySQL Server version 8.0.23 or higher
• Target instance must not have any unmanaged replication channels configured
29 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
MySQL InnoDB Cluster Read Replicas: Requirements
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
30
Live Demo
Environment
3 Regions
rome:
• 6 instances
• rome:30001, rome:30002, rome:30003, rome:30004, rome:30005, rome:30006
brussels:
• 6 instances
• brussels:30011, brussels:30012, brussels:30013, brussels:30014, brussels: 30015, brussels:30016
lisbon:
• 6 instances
• lisbon:30021, lisbon:30022, lisbon:30023, lisbon:30024, lisbon:30025, lisbon:30026
31 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Demo
Commands used in demo available on
https://github.com/miguelaraujo/Read-Replicas-Demo
32
Demo
InnoDB Cluster
• Add a read replica (default)
• Add a read replica and configure the sources
• Configure Router’s destination pool
• Hide a read replica
• Change failover candidates online
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
InnoDB ClusterSet
• Add read replicas to PRIMARY and REPLICA Clusters
• Configure global and individual Router’s destination pool
• Observe Router’s behavior on Switchover / Failover
33 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Adding a Read Replica
• Familiar interface: .addInstance() vs .addReplicaInstance()
• Automatic provisioning available: Clone or Incremental
• By default, the read replica will always replicate from the PRIMARY member of the Cluster
• replicationSources allows selecting the source:
• PRIMARY
• SECONDARY
• LIST
// Add a new Read Replica to the Cluster
mysqlsh-js> cluster.addReplicaInstance("lisbon:30024")
(...)
<Cluster>.addReplicaInstance(instance[, options])
34 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Configuring Router’s destination pool
• Familiar interface: .setRoutingOption()
• Can be changed per Router, Cluster, or ClusterSet
• Supports the following behaviors:
• secondaries
• read_replicas
• all
// Use all instances as possible destination
mysqlsh-js> cluster.setRoutingOption("read_only_targets", "all")
(...)
<Cluster>.setRoutingOptions([router], option, value)
35 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Hiding a Read Replica
• Familiar interface: .setInstanceOption()
• Can be used to hide Read Replicas or Secondary members
// Hide a Read Replica from Router’s available destinations
mysqlsh-js> cluster.setInstanceOption("lisbon:30024", "tag:_hidden", true)
(...)
<Cluster>.setInstanceOption([instance], option, value)
36 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
Changing failover candidates
• Familiar interface: .setInstanceOption() and .rejoinInstance()
• Can be changed at any time
• .rejoinInstance() can be used to apply the changes immediately instead of only at failover time
// Change Read Replica failover candidates to use SECONDARIES
mysqlsh-js> cluster.setInstanceOption("lisbon:30024", "replicationSources",
"secondary")
// Apply the changes now
mysqlsh-js> cluster.rejoinInstance("lisbon:30024")
(...)
<Cluster>.setInstanceOption([instance], option, value)
37
Demo
InnoDB Cluster
• Add a read replica (default)
• Add a read replica and configure the sources
• Configure Router’s destination pool
• Hide a read replica
• Change failover candidates online
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
InnoDB ClusterSet
• Add read replicas to PRIMARY and REPLICA Clusters
• Configure global and individual Router’s destination pool
• Observe Router’s behavior on Switchover / Failover
Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
38
Thank you!
Questions? Join our Slack channel
bit.ly/mysql-slack
39 Copyright © 2023, Oracle and/or its affiliates. All rights reserved.
39
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf

Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf

  • 1.
    Deep Dive intoMySQL InnoDB Cluster Read Scale-out Capabilities MySQL Webinar Series Miguel Araújo Senior Principal Software Engineer MySQL, Oracle October 26, 2023
  • 2.
    The following isintended 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. Safe Harbor Statement Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 2
  • 3.
    1. Business requirements 2.High Availability & Disaster Recovery Architectures 3. What architecture fits my requirements? 4. MySQL InnoDB Cluster Read Replicas 5. Live Demo Agenda Copyright © 2023, Oracle and/or its affiliates. All rights reserved. 3
  • 4.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 4 It Disasters & Outages
  • 5.
    Primary Causes 5 Copyright© 2023, Oracle and/or its affiliates. All rights reserved. IT Disasters & Outages On-site power failure is the biggest cause of significant outages
  • 6.
    Costs are Rising 6Copyright © 2023, Oracle and/or its affiliates. All rights reserved. IT Disasters & Outages Over half had experienced an outage costing more than $100,000
  • 7.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 7 Business Requirements
  • 8.
    Concepts – RTO& RPO • RTO: Recovery Time Objective • How long does it take to recover from a single failure • RPO: Recovery Point Objective • How much data can be lost when a failure occurs Types of Failures • High Availability: • Single Server Failure, Network Partition • Disaster Recovery: • Full Region / Network failure • Human Error: • Little Bobby Tables 8 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. Business Requirements
  • 9.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 9 High Availability & Disaster Recovery Architectures
  • 10.
    Manual • Setting upReplication topology was usually done manually, taking many steps Including user management, restoring backups, configuring replication... • MySQL only offered the technical pieces, leaving it up to the user to setup an (always customized) architecture • Even required other software ... bringing lots of work for DBA's and experts, who spent their time automating and integrating their customized architecture 10 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. Past
  • 11.
    11 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. MySQL Solutions One Product: MySQL • All components developed and integrated together • MySQL Server • Async Replication • Group Replication • MySQL Shell • MySQL Router • Full stack testing Easy to use! • One client: MySQL Shell • Powerful interface to automate and integrate all components • Integrated orchestration and provisioning • InnoDB Clone • Configures the topologies in a standarized best practice, preventing mistakes • Transparent Access to Database Architecture: MySQL Router • Load balancing • Application connection failover • Stateless
  • 12.
    'classic', 'asynchronous' Replicationbased Solution, fully integrated • MySQL Shell • MySQL Router • MySQL Server 12 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB ReplicaSet RPO != 0 RTO = minutes or more (manual failover)
  • 13.
    High Availability solutionbased on Group Replication, fully integrated • MySQL Shell • MySQL Router • MySQL Server • Group Replication providing: • Automatic Failover / Fault Tolerance • Automatic membership changes • Network partition handling • Consistency • … 13 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster RPO = 0 RTO = seconds (automatic failover)
  • 14.
    Disaster Tolerance Solutionfor InnoDB Clusters deployments in alternate locations, fully integrated • High Availability (Failure within a Region) • RPO = 0 • RTO = seconds (automatic failover) • Disaster Recovery (Region Failure) • RPO != 0 • RTO = minutes or more (manual failover) • No write performance impact • Easy to use: MySQL Shell • Full integration of MySQL Router 14 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB ClusterSet
  • 15.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 15 What architecture fits my requirements?
  • 16.
    Single Region MySQL InnoDBCluster • RPO = 0 • RTO = Seconds MySQL InnoDB ReplicaSet • RPO != 0 • RTO = Minutes or more (Manual failover) 16 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. High Availability Best write performance Manual Failover 🔴 🟢 Automatic failover 🟢
  • 17.
    Multi Region 17 Copyright© 2023, Oracle and/or its affiliates. All rights reserved. High Availability MySQL InnoDB Cluster: Deployed over multiple regions Multi-Region Multi-Primary 3 DC Requires very stable WAN Write performance affected by latency between DCs • RPO = 0 • RTO = Seconds 🟢 🔴 🔴 🔴
  • 18.
    Multi Region 18 Copyright© 2023, Oracle and/or its affiliates. All rights reserved. Disaster Recovery MySQL InnoDB ClusterSet RPO = 0 & RTO = seconds within Region (HA) Write performance (no sync to other region required) Higher RTO: Manual failover RPO != 0 when region fails • RPO != 0 • RTO = Minutes or more (Manual Failover) 🔴 🔴 🟢 🟢
  • 19.
    Scaling issues • Highloads on the Cluster members • Primary or Secondaries • Read intensive workloads Special purpose instances • Dedicated instances for reporting Safety • Additional redundancy for the dataset 19 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. Other Requirements
  • 20.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 20 MySQL InnoDB Cluster Read Replicas
  • 21.
    21 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas Fully integrated solution for Read Scale-out
  • 22.
    Read Scale-out • Addany amount of async read replicas to a Cluster • Replicate/Failover from • PRIMARY • SECONDARIES • LIST of candidates Fully supported on • InnoDB Cluster • InnoDB ClusterSet 22 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas
  • 23.
    23 • MySQL Shell •Familiar interface and great usability • Support for CLONE • Add/remove Read Replicas online • Configure Read Replicas and Router behavior • MySQL Router • No application changes needed if the topology changes • Chose where to send traffic • MySQL Server Replication • Automatic connection failover • Automatic list of potential sources populated by Group Replication Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas
  • 24.
    • Asynchronous replicationconnection failover ensures automatic failover of the replica’s source • The list is automatic populated by Group Replication • Group membership info is fetched to keep the list up-to-date • The priority can be configured: • Prefer to replicate from the PRIMARY • Prefer replication from one of the SECONDARIES • Have a LIST of possible candidates 24 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Under the Hood Follow the Source
  • 25.
    • R/O trafficis routed to the Cluster’s SECONDARY members, by default • But it can be configured, at any moment and dynamically: • secondaries: Use only SECONDARY members • read_replicas: Use only Read Replicas • all: Use Read Replicas and SECONDARY members 25 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Under the Hood Router’s Destination Pool
  • 26.
    • Read Replicasdo not belong to the group membership info of Group Replication • To avoid connection failures to unreachable/unavailable members, Router implements a built-in quarantine mechanism. • Quarantine is configurable: • Threshold: how many failed connections attempts are accepted until a server is put in quarantine • How frequently should the quarantine servers be checked for health • By default, both are set to 1. 26 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Under the Hood Router’s Health Checking and Quarantine
  • 27.
    • Add aRead Replica: <Cluster>.addReplicaInstance(instance[, options]) • Configure Router’s destination pool: <Cluster>.setRoutingOptions([router], “read_only_targets”, <value>) • Change Read Replica source/failover candidates, or hide it: <Cluster>.setInstanceOption([instance], “replicationSources”, <value>) <Cluster>.setInstanceOption([instance], “tag: _hidden”, <value>) 27 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Usability AdminAPI
  • 28.
    • Rejoin orupdate current Read Replica’s source : <Cluster>.rejoinInstance(instance[, options]) • Remove a Read Replica: <Cluster>.removeInstance(instance[, options]) • Monitor / Consult <Cluster>.status() / <Cluster>.describe() <Cluster>.routingOptions() 28 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Usability AdminAPI
  • 29.
    • Requires MySQLRouter & Shell version 8.1.0 or higher • Requires MySQL Server version 8.0.23 or higher • Target instance must not have any unmanaged replication channels configured 29 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. MySQL InnoDB Cluster Read Replicas: Requirements
  • 30.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 30 Live Demo
  • 31.
    Environment 3 Regions rome: • 6instances • rome:30001, rome:30002, rome:30003, rome:30004, rome:30005, rome:30006 brussels: • 6 instances • brussels:30011, brussels:30012, brussels:30013, brussels:30014, brussels: 30015, brussels:30016 lisbon: • 6 instances • lisbon:30021, lisbon:30022, lisbon:30023, lisbon:30024, lisbon:30025, lisbon:30026 31 Copyright © 2023, Oracle and/or its affiliates. All rights reserved. Demo Commands used in demo available on https://github.com/miguelaraujo/Read-Replicas-Demo
  • 32.
    32 Demo InnoDB Cluster • Adda read replica (default) • Add a read replica and configure the sources • Configure Router’s destination pool • Hide a read replica • Change failover candidates online Copyright © 2023, Oracle and/or its affiliates. All rights reserved. InnoDB ClusterSet • Add read replicas to PRIMARY and REPLICA Clusters • Configure global and individual Router’s destination pool • Observe Router’s behavior on Switchover / Failover
  • 33.
    33 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. Adding a Read Replica • Familiar interface: .addInstance() vs .addReplicaInstance() • Automatic provisioning available: Clone or Incremental • By default, the read replica will always replicate from the PRIMARY member of the Cluster • replicationSources allows selecting the source: • PRIMARY • SECONDARY • LIST // Add a new Read Replica to the Cluster mysqlsh-js> cluster.addReplicaInstance("lisbon:30024") (...) <Cluster>.addReplicaInstance(instance[, options])
  • 34.
    34 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. Configuring Router’s destination pool • Familiar interface: .setRoutingOption() • Can be changed per Router, Cluster, or ClusterSet • Supports the following behaviors: • secondaries • read_replicas • all // Use all instances as possible destination mysqlsh-js> cluster.setRoutingOption("read_only_targets", "all") (...) <Cluster>.setRoutingOptions([router], option, value)
  • 35.
    35 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. Hiding a Read Replica • Familiar interface: .setInstanceOption() • Can be used to hide Read Replicas or Secondary members // Hide a Read Replica from Router’s available destinations mysqlsh-js> cluster.setInstanceOption("lisbon:30024", "tag:_hidden", true) (...) <Cluster>.setInstanceOption([instance], option, value)
  • 36.
    36 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. Changing failover candidates • Familiar interface: .setInstanceOption() and .rejoinInstance() • Can be changed at any time • .rejoinInstance() can be used to apply the changes immediately instead of only at failover time // Change Read Replica failover candidates to use SECONDARIES mysqlsh-js> cluster.setInstanceOption("lisbon:30024", "replicationSources", "secondary") // Apply the changes now mysqlsh-js> cluster.rejoinInstance("lisbon:30024") (...) <Cluster>.setInstanceOption([instance], option, value)
  • 37.
    37 Demo InnoDB Cluster • Adda read replica (default) • Add a read replica and configure the sources • Configure Router’s destination pool • Hide a read replica • Change failover candidates online Copyright © 2023, Oracle and/or its affiliates. All rights reserved. InnoDB ClusterSet • Add read replicas to PRIMARY and REPLICA Clusters • Configure global and individual Router’s destination pool • Observe Router’s behavior on Switchover / Failover
  • 38.
    Copyright © 2023,Oracle and/or its affiliates. All rights reserved. 38 Thank you! Questions? Join our Slack channel bit.ly/mysql-slack
  • 39.
    39 Copyright ©2023, Oracle and/or its affiliates. All rights reserved. 39