Scalability and Reliability Features of MySQL Connector/J



Similar documents
Chapter 10: Scalability

In Memory Accelerator for MongoDB

Database Scalability {Patterns} / Robert Treat

CASE STUDY: Oracle TimesTen In-Memory Database and Shared Disk HA Implementation at Instance level. -ORACLE TIMESTEN 11gR1

Code:1Z Titre: Oracle WebLogic. Version: Demo. Server 12c Essentials.

Tier Architectures. Kathleen Durant CS 3200

A simple object storage system for web applications Dan Pollack AOL

KillTest. 半 年 免 费 更 新 服 务

Enabling Database-as-a-Service (DBaaS) within Enterprises or Cloud Offerings

Scaling DBMail with MySQL

Using DataDirect Connect for JDBC with Oracle Real Application Clusters (RAC)

Clustering with Tomcat. Introduction. O'Reilly Network: Clustering with Tomcat. by Shyam Kumar Doddavula 07/17/2002

<Insert Picture Here> WebLogic High Availability Infrastructure WebLogic Server 11gR1 Labs

Liferay Performance Tuning

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

agileworkflow Manual 1. agileworkflow 2. The repository 1 of 29 Contents Definition

Creating Web Farms with Linux (Linux High Availability and Scalability)

Architecting For Failure Why Cloud Architecture is Different! Michael Stiefel

Alfresco Enterprise on AWS: Reference Architecture

Module 14: Scalability and High Availability

<Insert Picture Here> Getting Coherence: Introduction to Data Grids South Florida User Group

Cloud Based Application Architectures using Smart Computing

Automatic Service Migration in WebLogic Server An Oracle White Paper July 2008

Glassfish Architecture.

How To Manage An Orgs Server 10G (Operating System)

High Availability Solutions for the MariaDB and MySQL Database

Building a Highly Available and Scalable Web Farm

Building Highly Available Database Applications with Geronimo and Derby

ELIXIR LOAD BALANCER 2

MySQL and Virtualization Guide

Setting Up B2B Data Exchange for High Availability in an Active/Active Configuration

High Availability Solutions for MySQL. Lenz Grimmer DrupalCon 2008, Szeged, Hungary

Overview of Luna High Availability and Load Balancing

Oracle WebLogic Server and Highly Available Oracle Databases. An Oracle White Paper August Integrated Maximum Availability Solutions

IBM WEBSPHERE LOAD BALANCING SUPPORT FOR EMC DOCUMENTUM WDK/WEBTOP IN A CLUSTERED ENVIRONMENT

Using Oracle Real Application Clusters (RAC)

Deployment Topologies

Fax Server Cluster Configuration

Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist

Oracle Database 12c - Global Data Services

Deltek Costpoint Process Execution Modes

Load Balancing & High Availability

Cluster to Cluster Failover Using Double-Take

IBM WebSphere Distributed Caching Products

Deploying the BIG-IP System v10 with Oracle Application Server 10g R2

Web Application Hosting Cloud Architecture

LOAD BALANCING TECHNIQUES FOR RELEASE 11i AND RELEASE 12 E-BUSINESS ENVIRONMENTS

Cloud Computing Disaster Recovery (DR)

MySQL CLUSTER. Scaling write operations, as well as reads, across commodity hardware. Low latency for a real-time user experience

Comparison of the High Availability and Grid Options

Achieving Zero Downtime and Accelerating Performance for WordPress

Best Practices for Using MySQL in the Cloud

CNS-205-1: Citrix NetScaler 10 Essentials and Networking

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services


Portable Scale-Out Benchmarks for MySQL. MySQL User Conference 2008 Robert Hodges CTO Continuent, Inc.

JReport Server Deployment Scenarios

High Availability and Scalability for Online Applications with MySQL

<Insert Picture Here> Oracle In-Memory Database Cache Overview

MySQL és Hadoop mint Big Data platform (SQL + NoSQL = MySQL Cluster?!)

Ecomm Enterprise High Availability Solution. Ecomm Enterprise High Availability Solution (EEHAS) Page 1 of 7

Running a Workflow on a PowerCenter Grid

IBM WebSphere Application Server Network Deployment for Distributed Platforms, Version 8.5. Establishing highly available services for applications

DEPLOYMENT GUIDE CONFIGURING THE BIG-IP LTM SYSTEM WITH FIREPASS CONTROLLERS FOR LOAD BALANCING AND SSL OFFLOAD

How to Scale out SharePoint Server 2007 from a single server farm to a 3 server farm with Microsoft Network Load Balancing on the Web servers.

Are You Ready for the Holiday Rush?

Citrix NetScaler 10 Essentials and Networking

StreamServe Persuasion SP5 StreamStudio

XpoLog Competitive Comparison Sheet

High Availability Database Solutions. for PostgreSQL & Postgres Plus

Cluster to Cluster Failover Using Double-Take

Distributed Database Design

Database Replication with MySQL and PostgreSQL

<Insert Picture Here> Oracle NoSQL Database A Distributed Key-Value Store

Infor Web UI High Availability Deployment

Failover Support. DataDirect Connect for ODBC Drivers. Introduction. Connection Failover

HA for Enterprise Clouds: Oracle Solaris Cluster & OpenStack

Flash Databases: High Performance and High Availability

Web Application Hosting in the AWS Cloud Best Practices

This document summarizes the steps of deploying ActiveVOS on oracle Weblogic Platform.

Oracle Weblogic. Setup, Configuration, Tuning, and Considerations. Presented by: Michael Hogan Sr. Technical Consultant at Enkitec

Java Application Developer Certificate Program Competencies

Cassandra vs MySQL. SQL vs NoSQL database comparison

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

Clustering a Grails Application for Scalability and Availability

Multiple Public IPs (virtual service IPs) are supported either to cover multiple network segments or to increase network performance.

High Availability Using MySQL in the Cloud:

Architectures Haute-Dispo Joffrey MICHAÏE Consultant MySQL

Request Routing, Load-Balancing and Fault- Tolerance Solution - MediaDNS

Disaster Recovery for Oracle Database

LARGE-SCALE DATA STORAGE APPLICATIONS

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

Building Highly Available Database Applications for Apache Derby

Availability Digest. Redundant Load Balancing for High Availability July 2013

How To Use The Listerv Maestro With A Different Database On A Different System (Oracle) On A New Computer (Orora)

Transcription:

<Insert Picture Here> Scalability and Reliability Features of MySQL Connector/J Mark Matthews Principal Software Developer MySQL Enterprise Tools Todd Farmer Senior Manager MySQL Support

Load-balancing/Failover Use Cases Directly (jdbc:mysql:loadbalance:// URL prefix): Clustered (NDB) or Multi-Master Replication deployment where both read and write operations are distributed across all hosts. Indirectly: Replication deployments where read-only load can be distributed to slaves (jdbc:mysql:replication://) Deployments requiring strong server affinity for specific server, failing over only when primary host is unavailable (jdbc:mysql://primary,failover-1,failover-2...)

Quick Load Balancer/Failover History Lesson jdbc:mysql://primary,failover - since 3.0.2 (2002!) (upcoming in 5.1.13, this is a special case of jdbc:mysql://loadbalance under the hood) jdbc:mysql:replication:// - since 3.1.11 (2005) (since 5.1.11, the slaves are a jdbc:mysql:loadbalance:// under the hood) jdbc:mysql:loadbalance:// - since 5.0.5 (2007)

Things to Consider Requires understanding of your application and your production environment

Understanding Your Application How transparent should failure be to end users? How transparent can failure be to your codebase? No framework can determine when it s safe to retry failed operations Easier to add this to existing frameworks than scatter throughout codebase The JDBC driver makes no attempt to make failure transparent It can make recovery transparent

Understanding Your Production Environment Key to making faults transparent to your users Key driver to setting many configuration values The more data you have about your application and your environment the better (and it changes over time!) Using DNS? Make sure you know everywhere it s being cached!

Two Key Data Points

95th Percentile Connection Setup Time

Worst Case Query Time

Drive the following configuration parameters... connecttimeout - safety x 95th %ile connect time sockettimeout - safety x (meanworst query + (3 x stddevworst query)) safety value? What are you comfortable with? Remember, the defaults on most OS s are in minutes

Don t Forget! Set loadbalanceblacklisttimeout to your best case outage window (in milliseconds) (setting it to zero means hosts won t be automatically blacklisted)

Additional Flexibility Coming in 5.1.13...

Controlling load-balance fail-over Standard component Communication exceptions SQLState starting with 08 User-defined SQLState list match User-defined Class list match Custom component Implement LoadBalanceExceptionChecker interface

StandardLoadBalanceExceptionChecker properties LoadBalanceSQLStateFailover Comma-delimited list of SQLState values Will match with trailing wildcard 08 will match 08000 and 08S01 loadbalancesqlexceptionsubclassfailover Comma-delimited list of fully-qualified class/interface names Comparison using Class.isInstance(Exception)

Custom Exception Checker Must implement LoadBalanceExceptionChecker shouldexceptiontriggerfailover(sqlexception ex) method NDBLoadBalanceExceptionChecker example: public class NdbLoadBalanceExceptionChecker extends StandardLoadBalanceExceptionChecker { public boolean shouldexceptiontriggerfailover(sqlexception ex) { return super.shouldexceptiontriggerfailover(ex) checkndbexception(ex); } private boolean checkndbexception(sqlexception ex){ // Have to parse the message since most NDB errors are mapped to the same DEMC, sadly. return (ex.getmessage().startswith("lock wait timeout exceeded") (ex.getmessage().startswith("got temporary error") && ex.getmessage().endswith("from NDB"))); } }

Managing load-balanced deployments Monitoring statistics Active/total configured hosts Active/total logical connection counts Active/total physical connection counts Total transaction count Manipulation of hosts Introduce new host to running load-balanced deployment Remove existing host gracefully

Introducing ConnectionGroup Logical named group of Connections within a single class loader Defined by new loadbalanceconnectiongroup property Must be defined in order to manage load-balanced deployment ConnectionGroups span Connection creation/allocation mechanism

Using ConnectionGroup to manage deployment Obtained via ConnectionGroupManager getconnectiongroup(string groupname) Comparable static methods directly on ConnectionGroupManager can be used with group name Statistics: getactivehostcount() getactivelogicalconnections() gettotallogicalconnections() getactivephysicalconnections() gettotalphysicalconnections() gettotaltransactioncount() Manipulation addhost(string hostport, boolean forexistingconns) removehost(string hostport, boolean killexistingconns)

Live demonstration JMX-based implementation com.mysql.jdbc.jmx.loadbalanceconnectiongroupmanager Requires Java 1.5+ Use -Dcom.sun.management.jmxremote JVM flag

Example - Homegrown horizontal partitioning with parallel query... Did we tell you that the load balancing algorithm is extensible? Use a ThreadLocal to hold the partition key Install your algorithm - loadbalancestrategy=... Select the right host in picknewconnection() For those icky cross-partition queries - StatementInterceptors to the rescue! Parallel Query

Shard Querying Demo

Questions?

Resources http://dev.mysql.com/usingmysql/java/ http://forums.mysql.com/ mark.matthews@oracle.com todd.farmer@oracle.com

Thanks!

The preceding is intended to outline our general product direction. It is intended for information purposes 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 upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle.