MySQL Features & Implementation

47
MySQL Features By Rakesh Kumar OSSCube , Delhi [email protected]

description

Introduction to MySQL, and its features with an explanation of the various processes that should be followed in order to have an efficient MySQL implementation.

Transcript of MySQL Features & Implementation

Page 1: MySQL Features & Implementation

MySQL Features

By Rakesh KumarOSSCube , [email protected]

Page 2: MySQL Features & Implementation

Introduction

Page 3: MySQL Features & Implementation

What we will discuss in next 1 hour

• General Info.• MySql Enterprise• Other Features of MySQL

> MySQL Network Monitoring and Advisory services> Backup and Recovery> Audit Trail > High Availability> Migration Tool Kit

Page 4: MySQL Features & Implementation

General Info - Overview of MySQL AB

• Founded in 1995• Operations in 24 countries• World’s Most Popular Open Source Database

> Over 10 million installations> 50,000 downloads each day

• Reduces TCO of database management> Reliable, high performance, easy to use

• Bundled by over 100 software & hardware companies• Partners and Telecom Service Integrators

HP, Dell, Novell, Red Hat, Unisys, Accenture, LogicaCMG, T-Systems and IPL

Page 5: MySQL Features & Implementation

Key Features

• Written in C, C++• Multilayered design with Independent

modules• Fully multi-threaded using Kernel Threads• Provides Transactional and Non-transactional

storage engines

Page 6: MySQL Features & Implementation

Key Features Cont…

• In memory heap table support• Server available in client server model, or

embedded DB.• Security and privilege management• Supports connection over SSL• Large database, large tables (default up to

256 TB)

Page 7: MySQL Features & Implementation

Key features contd…

• Connectors for application connectivity• 64 Index per table, 1-16 columns per index• Built-in tools for query analysis and space

analysis• Localization• Many more…

Page 8: MySQL Features & Implementation

What is MySQL Enterprise?

MySQL Enterprise is the leading open source database solution behind today’s modern enterprise applications. It includes:

• The MySQL Enterprise Server – the most reliable, secure, and up-to-date version of the world’s most popular open source database.

• MySQL Network Monitoring and Advisory Services – services to ensure the maximum quality, uptime, and performance of MySQL Enterprise systems.

• Production Support – around-the-clock support for the MySQL Enterprise server, along with consultative services and self-help knowledge aids.

Designed for production use and web businesses / enteprise customers relying on MySQL for key business applications.

Page 9: MySQL Features & Implementation

MySQL Enterprise vs. Community Server

Bug Escalation Privilege

Quarterly Service Pack Program

MatureExperimentalFeature Releases

24x7 Production Support

Extended End-of-Life Policy

Monthly Rapid Update Service Pack Program

Hot Fix Program

Platform / Application / Training Certified

Benefits from testing by worldwide Community

Enterprise Installer and Configuration Manager

Out-of-the-Box Configured for Enterprise use

Legal indemnification

Benchmarked with 2,000+ connections

Extensive internal/external (Coverity, KLOCwork) testing

Online Knowledge Base

Automated Software Update and Alert Service

Monitoring and Advisory Service

Open Source

Page 10: MySQL Features & Implementation

What is the MySQL Community Server?

The MySQL Community Server is the rapidly evolving, leading edge and non-commercially supported version of the MySQL server.

• Leading edge: new and experimental features with every release.• Open source development and innovation. GPL license. • High community participation. Contributions encouraged!• Great for open source developers, technology enthusiasts, and those

wanting to experiment and try out MySQL.• Serves as the foundation & proving ground for MySQL Enterprise.• No formal QA, support, or certifications

Recommended for non-production applications and those wishing to try out MySQL. Supported by the large MySQL open source community.

Page 11: MySQL Features & Implementation

Other Features of MySQL

• MySql Network Monitoring and Advisory services

• Audit Trail

• Backup and Recovery

• High Availability – Replication and Clusters

• Data migration from other RDBMS to MySQL

Page 12: MySQL Features & Implementation

MySQL Network Monitoring and Advisory Service

• Single, consolidated view into entire MySQL environment

• Customizable rules-based monitoring and alerts

• Identifies problems before they occur

• Reduces risk of downtime

• Makes it easierto scale-out without requiring more DBAs

“Virtual MySQL DBA”

Assistant

Page 13: MySQL Features & Implementation

Top Features & BenefitsEnterprise Dashboard

Primary benefits • Provides “at a glance” view into health, security, availability and performance of all MySQL servers.

Why it’s important

• Makes it easy to scale-out on MySQL without adding more DBAs.

• Saves DBA time writing, maintaining and monitoring scripts that collect, compile, and report similar metrics.

• Assists DBAs in determining “where” and “how” to spend their limited time.

Page 14: MySQL Features & Implementation

Security

• Protects MySQL Servers• Uncovers

Security loopholes

Schema

• Helps DBA design better databases• Uncovers

Security loopholes

Administration

• Helps DBA better manage database processes• Suggests

improvements for smoother operations

Performance

• Makes suggestions for improving database speed• Identifies

potential performance bottlenecks

Replication

• Makes suggestions for improving replication design• Identifies

potential replication bottlenecks

Custom

• Allows customer to create their own Advisor collection• Provides for

custom best practice enforcement

MySQL Network Advisors

Each contains a set of Advisor Rules designed to enforce MySQL Best Practices for the specific Advisor category.

Top Features & Benefits

Provide “Virtual MySQL DBA” expertise

Page 15: MySQL Features & Implementation

Value Prop of MySQL EnterpriseVa

lue

to C

usto

mer

Platinum

Gold +• Ensures

Performance and Availability•Guards against

unplanned schema change•Optimizes/Tunes

• Custom Queries •Database

Design• Custom Code

Gold

Silver +•Monitors and

Optimizes Memory Usage• Replication

Monitoring• Ensures proper

Replication configuration• Rapid Problem

Resolution • (Hot Fix builds)

SilverBasic +•Monitors all servers• Proactive

Notifications• Expert Advice•Optimizes MySQL

Configuration settings• Ensures

Recoverability• Tightens Security• Extends Support• Support! Support!

Basic• Enterprise Server• Ensures

Uptime/Reliability• Regular Service Packs• Self-help Support• Production Support

Page 16: MySQL Features & Implementation

MySql Backup

• Dump or Raw Backup• On-line or Off-line• Table Types and Consistency• Storage Requirements• Replication

Page 17: MySQL Features & Implementation

Dump or Raw Backup

• Dumps– Can be performed remotely– Take a lot of space– CPU intensive and slower– Are plain SQL, so easy to use later– Can do selective restore– Works for any table type

• Raw Backups– Faster, there is no translation– Restore “instantly”– Works for ISAM/MyISAM only

Page 18: MySQL Features & Implementation

On-line or Off-line

• On-line– May Impacts running applications (can’t write)– Must deal with data consistency issues– Slower than off-line because of I/O contention

• Off-line– Very simple– Speed is not an issue– Can use normal backup software

Page 19: MySQL Features & Implementation

Storage Requirements

• How long can you store backups?– Consider staggering older backups– Never know when you’ll want old data

• Raw backups take less space– You can keep just the .MYI header– Rebuild indexes later if need be

• All forms of backup can be compressed

Page 20: MySQL Features & Implementation

Replication

• Backup your slave instead of your master– Master won’t be interrupted– Slave can probably be shut down– Or at least you can hold read locks for a long time

and nobody will care

• It may be worth setting up a slave just for doing backups

• Remember to backup the master.info file

Page 21: MySQL Features & Implementation

Tools and Techniques

• mysqldump• mysqlhotcopy• InnoDB on-line backup• Off-line backups• Filesystem snapshots• Roll your own

Page 22: MySQL Features & Implementation

mysqldump

• Comes with MySQL• Dumps local or remote tables/databases• Variety of output formats• Handles locking if you need it• Works best for small and medium

installations

Page 23: MySQL Features & Implementation

mysqlhotcopy

• Comes with MySQL– Written by Tim Bunce of Perl DBI fame

• Raw backups of MyISAM tables• Handles locking• Regular expression support– Match certain databases or tables

• Can truncate indexes to save space

Page 24: MySQL Features & Implementation

mysqlsnapshot

• Separate download– http://jeremy.zawodny.com/mysql/

• Used for setting up replication snapshots• Or backing up a running server• Always backs up everything– Either one big tar file or one per database

• Very quick to restore

Page 25: MySQL Features & Implementation

InnoDB on-line Backup

• Separate download– http://www.innodb.com/

• Costs extra $$$• The only good solution for InnoDB backups

without replication• Only does InnoDB tables

Page 26: MySQL Features & Implementation

Off-line Backups

• Very easy• Hard to screw up• Use any backup tool you like– Just remember to backup all the MySQL stuff– You wouldn’t want compatibility problems after

an upgrade

• Restores can be quick

Page 27: MySQL Features & Implementation

Filesystem Snapshot

• Most “expensive” solution• Need hardware/software support– Veritas, Network Appliance, LVM, EMC, etc.

• Fastest option available• Uses least disk space• Doesn’t guard against all failures

Page 28: MySQL Features & Implementation

MySql Auditing

• Various logs that help in auditing:

• General Query Log• Binary Logs• Error Logs• Slow query log

Page 29: MySQL Features & Implementation

MySQL HA Solutions Overview

• Introduction to MySQL• HA Terms and Concepts• HA Requirements and Considerations• HA Solutions from MySQL• Third-Party HA Solutions for MySQL• Additional HA Resources plus Q & A

Page 30: MySQL Features & Implementation

What is High Availability?

• High Availability (HA) refers to the availability of resources in a computer system despite component failures

• Two major categories> Customized/redundant software and hardware> Software-based solutions leveraging COTS components

• Continuous Availability> Non-stop service> No disruption of service even during a fail over> Very high standard of availability, often unnecessary

Page 31: MySQL Features & Implementation

What is Replication?

• The duplication of data to more then one location• The use of additional hardware or software for…

> Availability> Reliability> Fault tolerance> Performance

• Asynchronous vs. Synchronous> Safeguarding data loss

• MySQL Replication> Statement vs Row-based Replication

• Block-level Replication (DRBD)

Page 32: MySQL Features & Implementation

What is Replication?

• The duplication of data changes to more than one location

updatecustomer

updatecustomer

Asynchronous Replication

Synchronous Replication

Page 33: MySQL Features & Implementation

What is Clustering?

• Clusters are often used for:> Operating systems> Databases> Application servers> Load balancers> Web servers> Just about any “service” that needs to be highly available

• Redundant nodes provide service when components fail• Eliminate single points of failure

> Multiple network connections> Redundant data storage (SAN, RAID)

• Shared-Nothing vs. Shared-Disk

Page 34: MySQL Features & Implementation

MySQL Replication

NoAutomated DB Fail Over

Dozens for Reads# of Nodes

NoWrite Intensive

YesRead Intensive

Scale-OutBuilt-in Load Balancing

Scalability

YesGeographic Redundancy

NoResynchronization of Data

VariesTypical Fail Over Time

NoAutomated IP Fail Over

Availability

SupportRequirements• Asynchronous> Statement> Row-based (5.1)> Mixed (5.1)

• Read vs. Write> Response times> Load balancing> Scale Out

• Administration> Backups> Upgrades> Testing

• Geographic Redundancy

Page 35: MySQL Features & Implementation

MySQL Replication Topologies

Master > Slave

Masters > Slave (Multi-Source)

Master < > Master (Multi-Master)

Master > Slaves

Circular (Multi-Master)

Master > Slave > Slaves

Page 36: MySQL Features & Implementation

Inside MySQL Replication

Writes & Reads

MySQL Master

I/OThread

SQLThread

Writes

relaybinlog

MySQL Slave

mysqld

data

index &binlogs

mysqlddatabinlogReplication

Web/AppServer

Page 37: MySQL Features & Implementation

MySQL Replication - Scale Out

Writes & Reads Reads Reads

• Write to one master• Read from many slaves• Perfect for read intensive apps

Load Balancer

MySQL Replication

Page 38: MySQL Features & Implementation

MySQL Cluster

• In-Memory Database> Disk Data (5.1)

• Shared-nothing storage• Synchronous replication• Fast-automatic data fail over• High performance

> NDB API• No special hardware • Best for primary key lookups• Transactional• Online backup

YesAutomated DB Fail Over

5.0: 64

5.1: 255# of Nodes

YesWrite Intensive

Yes (Look ups)Read Intensive

Scale-OutLoad Balancing

Scalability

Yes(w/ Replication)

Geographic Redundancy

YesResynchronization of Data

< 3 SecsTypical Fail Over Time

NoAutomated IP Fail Over

Availability

SupportRequirements

Page 39: MySQL Features & Implementation

MySQL Cluster Carrier Grade Edition

• An advanced version of MySQL Cluster for the telecom industry• Ideally suited for the telecom industry's top carriers, operators

and equipment manufactures• Used by industry leaders for real-time, scalable data

management

Page 40: MySQL Features & Implementation

4 Data Node MySQL Cluster

Application/SQL Nodes(NDB API and/or MySQL Server)

Data Nodes

ManagementNodes

Clients

NDB Storage Engine

Page 41: MySQL Features & Implementation

Geographic Redundancy

• As of 5.1, support for asynchronous replication between Clusters

• Enables a higher degree of availability and continuity

NDB API

NDB Storage Engine

NDB API

NDB Storage Engine

Asynchronous MySQL Replication

Cluster 1 Cluster 2

Page 42: MySQL Features & Implementation

Data Node Failure & Recovery

• Server 3 failure is detected• Server 4 handles Server 3 requests

Node Group 1 Node Group 2

2 3 41

Page 43: MySQL Features & Implementation

Data Node Failure & Recovery

• Server 3 begins copying data from Server 4• Complete or just changes since failure

Node Group 1 Node Group 2

2 3 41

Page 44: MySQL Features & Implementation

Data Node Failure & Recovery

• Once data is fully restored, Server 3 rejoins the cluster

Node Group 1 Node Group 2

2 3 41

Page 45: MySQL Features & Implementation

MySQL Migration Toolkit

• Wizard Interface. Supports...• Oracle• Microsoft SQL Server• Microsoft Access• Sybase• MySQL

Page 46: MySQL Features & Implementation

Questions...

Page 47: MySQL Features & Implementation

Thank you for your Time and Attention!

For more information visit http://www.osscube.comOr drop-in an email to [email protected]