MySQL Quick Dive
Upcoming SlideShare
Loading in...5
×
 

MySQL Quick Dive

on

  • 677 views

MySQL Developer Day Conference: MySQL Quick Dive on 8th April 2014

MySQL Developer Day Conference: MySQL Quick Dive on 8th April 2014

Statistics

Views

Total Views
677
Views on SlideShare
677
Embed Views
0

Actions

Likes
0
Downloads
22
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • User() = ‘joe@p1.dataentry’, current_user() = ‘’@’%.dataentry’
  • http://dev.mysql.com/doc/refman/5.6/en/grant.html : for all privileges
  • Semi-synchronous replication means that the master waits on commit until at least one slave confirmed the transaction.Multi-master replication in labs.mysql.comNeed cluster for synchronous
  • HASH/KEY can be linear : faster to calculate the hash, less likely to be evenly distributedNormal hashing is : PartN = MOD(key, Nparts)Linear hash is :
  • IGNORE_SPACESANSI_QUOTESNO_BACKSLASH_ESCAPES
  • IGNORE_SPACESANSI_QUOTESNO_BACKSLASH_ESCAPES
  • Real-time MySQL Performance and Availability MonitoringVisual Dashboad for Better VisibilityVisually Find and Fix Problem QueriesPinpoint SQL code that causing a slowdownVisual Capacity PlanningForecasting using Projections and Trend AnalysisAgentless, Cloud Friendly ArchitectureRemotely Monitor MySQL without agentsStart Monitoring MySQL in 10 minutesEasy to use with zero configuration
  • MySQL Enterprise Edition is also certified with these Oracle products.
  • And we’re working on a number of additional integrations:
  • Consultative : Remote Troubleshooting, Replication Review, Partitioning Review, Schema Review, Query Review, Performance Tuning, Customer Code Review: Client APIs, Install Support

MySQL Quick Dive MySQL Quick Dive Presentation Transcript

  • Quick Dive into MySQL Sudipta – sudipta.sahoo@oracle.com Joshi – madhusudhan.joshi@oracle.com
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2 Safe Harbour Statement The following 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.
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3 Program Agenda  What is MySQL ?  MySQL Server Overview  What‟s New in 5.6  MySQL Enterprise Components  Q & A
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4 What is MySQL ?
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5 “MySQL is the world's most widely used open source relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases”
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.7 What is MySQL ?  Robust ACID compliant RDBMS  Open Source (GPL v2 + proprietary)  Used by some of the largest web properties in the world  Abundantly present in all major Linux distributions and hosting providers  Properly documented and professionally supported by Oracle  Simple to get and easy to use
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.8 Picking the Right Variant
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9 Server and Connectors Security Scalability InnoDB Monitoring, Backup etc Cluster Community    Classic library Standard    Enterprise     Cluster Carrier Grade      MySQL Editions
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10 MySQL Version Numbering Major Version Minor Version Milestone Current 5.6 5.6.17 5.7.4-m14 Incompatible changes   Upgradable   New Features  *  Compatible  Released every approx. 2 years 2 months 2-4 Months
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.11 Installer vs. Archive Distribution ? vs.
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.12 MySQL Concepts
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.13 MySQL Building Blocks Client Apps Connectors: C, JDBC, ODBC, PHP, Python, .NET Server Parser + Optimizer Query Execution Storage Engines InnoDB MyISAM Memory … System Apps “Not Only SQL” Plugin Plugin Plugin Plugin
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.14 Storage Engines  Implement data storage and retrieval at table level  Every table needs one  Some storage engines: – InnoDB (default since 5.5) – fully transactional, ACID compliant – MyISAM (previous default) – non-transactional, file based – INFORMATION_SCHEMA – fully virtual – PERFORMANCE_SCHEMA – volatile generated data – black hole storage engine – data go in, nothing goes out
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.15 Plugins  Extend the server functionality at run time  Interesting plugin types – Authentication – Storage engines – SQL accessible functions – Password validation – INFORMATION_SCHEMA tables
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.16 User Accounts  Two parts : „user name‟@‟host name‟.  Can use wildcards in host names: empty („‟), „%‟ and „_‟.  Host part can be IP addresses/net masks too.  Authentication methods are pluggable.  No passwords are stored in tables, only hashes.  GRANT commands can create users too.
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.17 “Logged in” and “Current” User ID  Joe connects from the data entry department  MySQL finds a record ’’@’%.dataentry’ and authenticates Joe to it  Joe can use all privileges granted to ’’@’%.dataentry’ joe@p1.dataentry Users table ‟‟@%.dataentry user() current_user()
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.18 Granting Privileges  Always granted to a user@host combination  Only DROP USER is guaranteed to clean up properly !  INSERT can be granted on a column subset  Privileges are checked against current_user()
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.19 Privileges in MySQL  Server : USAGE, SHUTDOWN, SUPER, CREATE … – Database : CREATE, DROP, EXECUTE, SELECT, …  Table : INSERT, SELECT, … – Column : INSERT, SELECT, UPDATE – Stored routine : EXECUTE, CREATE ROUTINE, ALTER ROUTINE  User : PROXY
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.20 Replication  One way : master to slave(s) – NEW ! This is changing. Check labs.mysql.com  Asynchronous or Semi-Synchronous  Replication log formats – Statements – Row data – Mixed
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.21 Partitioning  A storage engine  Horizontal partitioning  Partition by – List : BY LIST(<expr>) (PARTITION <name> VALUES IN (3,5,6,9,17) – Range : BY RANGE (<expr>) (PARTITION <name> VALUES LESS THAN (<num>), … – Hash/Key: BY HASH( <expr> ) PARTITIONS (4)
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.22 User Variables  Connection specific  Weak typed  No declaration needed mysql> SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop; mysql> SELECT * FROM shop WHERE price=@min_price OR price=@max_price; +---------+----------+---------+ | article | dealer | price | +---------+----------+---------+ | 0003 | D | 1.25 | | 0004 | D | 19.95 | +---------+----------+---------+
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.23 Basic Operations
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.24 Connecting to the Database  IPv4 and IPv6 are supported  Designated TCP port 3306  Transparent SSL encryption layer supported Protocol Connection Type Operating Systems TCP/IP Local and Remote Any UNIX Socket File Local only UNIX Named Pipe Local only Windows Shared Memory Local only Windows  IPv4 and IPv6 are supported  Designated TCP port 3306  Transparent SSL encryption layer supported
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.25 Executing Queries Using the „mysql‟ Tool  „?‟ Is help  Statements end with a semicolon (or whatever delimiter is set to).  You can set a “current” database : USE or through the command line  Commands come from standard input, if not on a console  Results go to standard output, errors to standard error  Command line editing on the console  Don‟t forget SHOW WARNINGS
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.26 Exploring Databases and Objects  Backward Compatible MySQL Commands – SHOW DATABASES / TABLES / TRIGGERS / PROCEDURE /FUNCTION STATUS – SHOW CREATE TABLE / VIEW / TRIGGER – SHOW PROCEDURE / FUNCTION CODE  INFORMATION_SCHEMA tables – TABLES, TRIGGERS, VIEWS, ROUTINES, COLUMNS etc  ls, dir etc.
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.27 Disk Structure  Databases are file system directories  Tables are just a bunch of files  Can add tables and databases through the file system mid-flight.
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.28 The SQL Dialect(s)  Most common gotchas – AVG() ≠ AVG<space>() – ‟this is a string‟ (single quote) – ”this is a string too” (double quote) – `this is a quoted identifier` (back tick) – b, n, r, t, Z work as in C – || is OR, not CONCAT(), && works as an AND too !
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.29 Unique Commands and Functionality  DROP TABLE/DATABASE … IF EXISTS  Set and read user variables from inside other commands  Case insensitive string comparisons by default
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.30 Mind the Storage Engine  Every table needs a storage engine. And there‟s a default one too ! mysql> create table t1 (a integer) engine='vaporware'; Query OK, 0 rows affected, 2 warnings (0,05 sec) mysql> show create table t1; CREATE TABLE `t1` ( `a` integer(11) DEFAULT NULL ) ENGINE=InnoDB
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.31 MySQL Tries to be Nice. Too Nice.  SELECT 1 FROM DUAL WHERE 1 = ‘1 starting string’ returns a row  Strings are silently truncated when inserted into smaller columns  Out-of-range integer values are auto-adjusted  Syntax known not to work is still accepted : e.g. FOREIGN KEYS and MyISAM
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.32 What‟s new in MySQL 5.6 ?
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.33 MySQL 5.6 : Best Release Ever !  Improved Performance and Scalability – Scales to 48 CPU threads – Up to 230% performance gain over MySQL 5.5  Improved InnoDB – Better Transaction Throughput and availability  Improved Optimizer – Faster query execution and diagnostics for query tunning and debugging
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.34 MySQL 5.6 : Best Release Ever !  Improved Replication – Higher Performance, availability and data integrity  Improved PERFORMANCE_SCHEMA – Better Instrumentation, User/Application level statistics and monitoring  New ! NoSQL Access to InnoDB – Fast, Key/Value access with full ACID compliance, better developer agility  New ! MySQL Hadoop applier – Uses the binary log for real-time push of the data Continued
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.35
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.36
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.37
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.38
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.39
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.40
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.41
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.42
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.43
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.44
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.45 Oracle Premier Lifetime Support Oracle Product Certifications/Integrations MySQL Enterprise High Availability MySQL Enterprise Security MySQL Enterprise Scalability MySQL Enterprise Backup MySQL Enterprise Monitor/Query Analyzer MySQL Workbench MySQL Enterprise Edition Highest Levels of Security, Performance and Availability MySQL Enterprise Audit
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.46 Oracle Premier Lifetime Support DBA Concern…is my data safe ??? …Who can see it ? … What was seen ? … Who can change it ? … What was changed ?
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.47  Out-of-the-box logging of connections, logins, query activity  User defined policies, filtering and log rotation  Dynamically enabled, disabled: no server restart  XML-based audit stream per Oracle audit specification  Easily implemented via MySQL 5.5 Audit API  MySQL 5.5.28 and higher Adds regulatory compliance to MySQL applications. HIPAA, Sarbanes-Oxley, PCI, etc. MySQL Enterprise Audit Policy-based Auditing for MySQL Applications
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.48  PAM (Pluggable Authentication Modules) - Access external authentication methods - Standard interface (Unix, LDAP, Kerberos, others) - proxied and non-proxied users  Windows - Access native Windows services - Authenticate users already logged into Windows (Windows Active Directory)  Pluggable Authentication API Integrates MySQL with existing security infrastructures and SOPs. MySQL Enterprise Security External Authentication
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.49  MySQL default thread-handling – excellent performance, can limit scalability as user connections grow  MySQL Thread Pool improves sustained performance/scale as user connections grow  Thread Pool API Ensures better, sustained performance as user loads continue to grow. MySQL Enterprise Scalability MySQL Thread Pool
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.50 Internal Clients Default Thread Handling Connections /statements assigned to Threads for life  Connections assigned to 1 thread for the life of the connection, same thread used for all statements  No prioritization of threads, statement executions  Many concurrent connections = many concurrent execution threads to consume server memory, limit scalability Connection Execution Threads External Clients Default Thread Handling
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.51 Internal Clients Connection Execution Threads External Clients Thread Pool Thread Group 1 Threads 1 - 4096 Thread Group 2 Threads 4097 - 8193 Thread Group N Threads 8194 - N  Thread Pool contains configurable number of thread groups (default = 16), each manages up to 4096 re-usable threads  Each connection assigned to thread group via round robin  Threads are prioritized, statements queued to limit concurrent executions, load on server, improve scalability as connections grow Thread Group 1 Thread Group 2 Thread Group N With Thread Pool Enabled
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.52 MySQL Enterprise Edition With Thread Pool MySQL Community Server Without Thread Pool 60x Better Scalability with Thread Pool MySQL 5.6.11 Oracle Linux 6.3, Unbreakable Kernel 2.6.32 4 sockets, 24 cores, 48 Threads Intel(R) Xeon® E7540 2GHz CPUs 512GB DDR RAM With Thread Pool Enabled 0 2000 4000 6000 8000 10000 12000 1 4 16 32 64 128 256 512 1024 2048 4096 8192 TransactionsPerSecond Simultaneous Database Connections MySQL 5.6 Sysbench OLTP Read/Write
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.53 MySQL Enterprise Edition With Thread Pool MySQL Community Server Without Thread Pool 18x Better Scalability with Thread Pool MySQL 5.6.11 Oracle Linux 6.3, Unbreakable Kernel 2.6.32 4 sockets, 24 cores, 48 Threads Intel(R) Xeon® E7540 2GHz CPUs 512GB DDR RAM With Thread Pool Enabled 0 2000 4000 6000 8000 10000 12000 14000 16000 1 4 16 32 64 128 256 512 1024 2048 4096 8192 TransactionsPerSecond Simultaneous Database Connections MySQL 5.6 Sysbench OLTP Read Only
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.54 MySQL Enterprise Monitor  Real-time MySQL performance and availability monitoring  Visually find & fix problem queries  Disk monitoring for capacity planning  Cloud friendly architecture (no agents)  Start monitoring MySQL in 10 minutes  Remote agent option provides OS monitoring New!
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.55  Online Backup for InnoDB (scriptable interface)  Full, Incremental, Partial Backups (with compression)  Point in Time, Full, Partial Recovery options  Monitoring and Alerts on Backup Operations  Metadata on status, progress, history  Unlimited Database Size  Windows, Linux, Unix  Certified with Oracle Secure Backup, NetBackup, Tivoli, others MEB Backup Files MySQL Database Files mysqlbackup Ensures quick, online backup and recovery of your on premise and Cloud based MySQL applications. MySQL Enterprise Backup
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.56 MySQL Enterprise Backup 4h 17 mins 5.25 mins 0 50 100 150 200 250 300 mysqldump MySQL Enterprise Backup Minutes Backup: 73 GB Database MySQL Enterprise Backup: 49x Faster than mysqldump 49x More Performance
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.57 MySQL Enterprise Backup MySQL Enterprise Backup: 80x Faster than mysqldump 18h 45 mins 14 mins 0 200 400 600 800 1,000 1,200 mysqldump MySQL Enterprise Backup Minutes Restore: 73 GB Database 80x More Performance
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.58 Database Design  Visual Design, modeling  Forward/Reverse Engineer  Schema validation, Schema doc SQL Development  SQL Editor - Color Syntax Highlighting  Objects - Import/Export, Browse/Edit Database Administration  Status, Configuration, Start/Stop  Users, Security, Sessions  Import/Export Dump Files New! Database Migration Wizard for SQL Server, Sybase, SQLite, SQL Anywhere & PostgreSQL MySQL Workbench
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.59 What Do the Tools Look Like ?
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.60 Other Useful Utilities  GUI – MySQL Workbench – MS Visual Studio  Command line – mysqldump – mysqlbinlog – mysql_config_editor  MySQL Enterprise Tools
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.61  Oracle Linux (w/DRBD Stack)  Oracle VM  Oracle VM Template for MySQL EE  Oracle Solaris Clustering  Oracle GoldenGate  Oracle Secure Backup  Oracle Database Firewall  My Oracle Online Support Oracle Product Integrations/Certifications Available Now
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.62 Oracle Product Integrations/Certifications In Progress  Oracle Fusion MiddleWare - WebCenter Suite - Enterprise Content Management - Oracle Business Intelligence Suite  Oracle Clusterware  Oracle Audit Vault  Oracle Enterprise Manager  And More…
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.63 How to Continue With Your MySQL Studies?
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.64 Training  Training courses – MySQL for Beginners, MySQL for Developers, MySQL for DBAs – Performance Tuning, High Availability, Cluster – MySQL and PHP : Developing Dynamic Web Applications  Certification – Oracle Certified Associate, Professional, Expert  Learning paths http://www.mysql.com/training/
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.65 Support  Oracle Lifetime Support for MySQL – Largest Team of MySQL Experts – Backed by MySQL Developers – Direct Access to MySQL Support Engineers – Forward Compatible Hot Fixes – MySQL Maintenance Releases – Support in 29 Languages – 24/7/365 – Unlimited Incidents – Knowledge Base – MySQL Consultative Support http://www.mysql.com/support Only from Oracle
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.66 Join the MySQL Community  Online manuals  Forums  Mailing lists  Bug tracker  Development articles  Design documents database  Downloads  Blogs MySQL Developer Zone: http://dev.mysql.com
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.67  mysql.com - MySQL Products and Editions - TCO calculator - Customer success stories  dev.mysql.com - Downloads, Documentation - Forums - PlanetMySQL  eDelivery.oracle.com - Download and evaluate all MySQL products Learn More
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.68
  • Copyright © 2014, Oracle and/or its affiliates. All rights reserved.69