My sql 5.6&MySQL Cluster 7.3
Upcoming SlideShare
Loading in...5
×
 

My sql 5.6&MySQL Cluster 7.3

on

  • 791 views

Slides from the MySQL Tech tour Russia

Slides from the MySQL Tech tour Russia

Statistics

Views

Total Views
791
Views on SlideShare
787
Embed Views
4

Actions

Likes
2
Downloads
47
Comments
0

1 Embed 4

http://www.linkedin.com 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

My sql 5.6&MySQL Cluster 7.3 My sql 5.6&MySQL Cluster 7.3 Presentation Transcript

  • <I n s e r t Pi c t u r e H e r e > M y SQL 5 .6 & M y SQL Cl u s t e r 7 .3 Ov e r v i e w Oleksii(Alexey) Porytskyi Senior Principal Consultant oleksii.porytskyi@oracle.com 1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • Safe Harbor 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. 2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Agenda – MySQL 5.6 New Features • InnoDB • Performance • Full-Text Search • NoSQL • Optimizer • MySQL Improvements • Replication • Security 3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 SysBench Benchmarks MySQL 5.6 MySQL 5.5 Oracle Linux 6 Intel(R) Xeon(R) E7540 x86_64 MySQL leveraging: - 48 of 96 available CPU threads - 2 GHz, 512GB RAM Up to 151% Performance Gain Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 SysBench Benchmarks MySQL 5.6 MySQL 5.5 Up to 234% Performance Gain Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle Linux 6 Intel(R) Xeon(R) E7540 x86_64 MySQL leveraging: - 48 of 96 available CPU threads - 2 GHz, 512GB RAM
  • InnoDB 6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Performance - Online DDL • DDL - SQL statements for changing database • Automatically commit transactions • Historically expensive • 5.6 enhances optimized CREATE DROP INDEX statements • The ALTER TABLE INDEX and process is much faster 7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Performance - Buffer Pool Pre-loading • Load buffer pool at startup • Load buffer pool on command (now) • Dump buffer pool at shutdown • Dump buffer pool now buffer pool 1 (list of pages from pool) 2 3 shutdown - list of pages dumped Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1,2,3... 1 2 buffer pool start-up - list of pages reloaded 8
  • Performance - SSD Improvements • 4k and 8k page sizes • InnoDB Compression • Portable .ibd (InnoDB data) files • Separate tablespaces for the InnoDB UNDO log 9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Performance – Redo / Undo Logs • Redo Logs: • Increased from 4GB to 512GB (1TB total) • Improves performance of: • write-heavy workloads • long-running transactions • Undo Logs: • Moves InnoDB UNDO out of system tablespace • Good candidate to move to SSD • I/O and memory optimization Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 10
  • Fulltext Search • Fulltext search now in InnoDB • Used with CHAR, VARCHAR or TEXT mysql> SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE); +----+-----------------------+-------------------------------------+ | id | title | body | +----+-----------------------+-------------------------------------+ | 1 | MySQL Tutorial | DBMS stands for DataBase ... | | 3 | How To Use MySQL Well | After you went through a ... | | 5 | Optimizing MySQL | In this tutorial we will show ... | | 8 | 1001 MySQL Tricks | 1. Never run mysqld as root. 2. ... | +----+-----------------------+-------------------------------------+ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 11
  • NoSQL • memcached as a daemon plugin of mysqld • InnoDB handles memory caching • ADD, SET, INCR stored to disk 12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Optimizer Improvements • Subquery Optimizations • Index Condition Pushdown • File Sort Optimization • SELECT col1, ... FROM t1 ... • ORDER BY name LIMIT 10; • Batched Key Access (BKA) and Multi-Range Read (MRR) • Persistent Optimizer Stats 13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL Improvements 14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Other MySQL Improvements • Remote Binlog Backup • Server UUID’s • Fractional seconds for TIME, DATETIME, and TIMESTAMP mysql> SELECT MICROSECOND('2010-12-10 14:12:09.219473'); +-------------------------------------------+ | MICROSECOND('2010-12-10 14:12:09.019473') | +-------------------------------------------+ | 219473 | +-------------------------------------------+ 15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL Partition Import/Export • Exchange table partition/sub-partition with nonpartitioned table • Rows in non-partitioned table must be in the range of partition/sub-partition • Foreign keys not supported • Triggers are not invoked 16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Replication 17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Replication I • Global Transaction ID’s (GTID’s) • GTID Utilities • Self-Healing Replication Clusters • Multi-Threaded Slaves • Binary Log Group Commit • Time-delayed replication slaves 18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Replication II • Informational Log Events • Optimized Row-Based Replication • Crash Safe Slaves and Binlog • Data Integrity - Replication Event Checksums • New MySQL Replication Utilities • mysqlfailover • mysqlrpladmin 19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Security 20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL Enterprise Audit • Policy-based auditing • Logging of connections, logins, query activity • User defined policies, filtering and log rotation • Dynamically enabled/disabled: no server restart • XML-based audit stream • Version MySQL 5.5.28 and higher • Adds regulatory compliance to MySQL applications. • HIPAA, Sarbanes-Oxley, PCI, etc. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 21
  • MySQL Enterprise Audit Flow 1. DBA Enables on Server1 3. Joe’s connection, login and query logged 2. User Joe Connects and Queries Server1 22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 Security Improvements I •Storing authentication credentials in .mylogin.cnf # mysql_config_editor set --login-path=local --host=localhost --user=localuser --password $ ls -la /var/root/.mylogin.cnf -rw------- 1 root wheel 136 Aug 8 15:15 .mylogin.cnf $ file .*cnf .mylogin.cnf: data Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 23
  • MySQL 5.6 Security Improvements II •Stronger encryption for user account passwords (SHA-256) [mysqld] default-authentication-plugin=sha256_password 24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 Security Improvements III •User password expired column (5.6.6) mysql> select host, user, password_expired from user where user = "WebUser" and host = ‘localhost’; +-------------+---------+------------------+ | host | user | password_expired | +-------------+---------+------------------+ | localhost | test | Y | +-------------+---------+------------------+ root@MacBook-Tony:~$ mysql --host=localhost -utest -p Enter password: mysql> select 1; ERROR 1820 (HY000): You must SET PASSWORD before executing this statement 25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 Security Improvements IV •Provision for establishing password security policy validate_password.so plugin [mysqld] plugin-load=validate_password.so validate-password=FORCE_PLUS_PERMANENT validate_password_policy_number = 2 mysql> INSTALL PLUGIN validate_password SONAME 'validate_password.so'; mysql> SHOW VARIABLES LIKE 'validate_password%'; +--------------------------------------+---------------+ | Variable_name | Value | +--------------------------------------+---------------+ | validate_password_dictionary_file | pass_dict.txt | | validate_password_length | 8 | | validate_password_mixed_case_count | 1 | | validate_password_number_count | 1 | | validate_password_policy_number | STRONG | file is located in your data directory | validate_password_special_char_count | 1 | +--------------------------------------+---------------+ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. (validate_password_policy_number = 2 must be set to a value of 2) 26
  • MySQL 5.6 Security Improvements V •SQL function VALIDATE_PASSWORD_STRENGTH() Return Value mysql> select VALIDATE_PASSWORD_STRENGTH ('test'); Password Test +-------------------------------------+ Length < 4 | VALIDATE_PASSWORD_STRENGTH ('test') | Length ≥ 4 and < 25 validate_password_length +-------------------------------------+ | 0 Satisfies policy 1 (WEAK) 25 | +-------------------------------------+ mysql> select VALIDATE_PASSWORD_STRENGTH ('Wh4tAr3Y0u!'); +--------------------------------------------+ 50 Satisfies policy 2 (MEDIUM) 75 Satisfies policy 3 (STRONG) 100 | VALIDATE_PASSWORD_STRENGTH ('Wh4tar3Y0u!') | +--------------------------------------------+ | 100 | +--------------------------------------------+ 27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL 5.6 Security Improvements VI •Non-usable passwords file echo “ilovepizza2!” > pass_dict.txt mysql> CREATE USER 'test3'@'192.168.1.2' IDENTIFIED BY 'ilovepizza2!’; ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  •  Foreign Key Support  Connection Thread Scalability  NoSQL JavaScript for node.js 29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved | Oracle reserves the right to change the content and timing of all future releases  MySQL 5.6  Auto-Installer
  • MySQL Cluster 7.3 Foreign Keys Cluster 7.3: Foreign Keys MySQL • Brings MySQL Cluster to a broader range of workloads • • Adds powerful functionality while reducing complexity • • • • 30 Packaged apps, custom projects App logic & data model Enabled by default Enforced for SQL & NoSQL APIs On-line add and drop Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL Cluster 7.3 Foreign Keys Cluster 7.3: Foreign Keys MySQL • Implementation goal: compatibility with InnoDB • Easy migration of solutions already working with InnoDB • Natively implemented in the storage engine • Created in SQL • Enforced in SQL & NoSQL • C++, ClusterJ, memcached, node.js http://www.clusterdb.com/mysql-cluster/foreign-keys-in-mysql-cluster/ 31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Foreign Keys-Example Foreign Keys - Example mysql> CREATE TABLE towns (town VARCHAR(30) NOT NULL PRIMARY KEY, county VARCHAR(30) INDEX county_county_index (county), CONSTRAINT county_town FOREIGN KEY (county) REFERENCES counties(county) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE=ndb; … mysql> DELETE FROM counties WHERE county=’Berkshire'; ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (Unknown error code) mysql> SHOW WARNINGS; +---------+-----+-------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+-----+-------------------------------------------------------------------------------------------+ | Warning | 1296 | Got error 256 'Foreign key constraint violated: Referenced row exists' from NDB | | Error | 1451 | Cannot delete or update a parent row: a foreign key constraint fails (Unknown error code) | +---------+-----+-------------------------------------------------------------------------------------------+ 32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • Storage Engine Compability Storage Engine Compatibility I n n o DB M y I SA M M y SQL Cl u s t e r ✔ ✖ ✔ CA SCA DE ✔ N/A ✔ U PDA T E ✔ N/A No PK UPDATE DEL ET E ✔ N/A ✔ REST RI CT ✔ N/A ✔ Same as RESTRICT N/A Deferred Check ✔ N/A ✔ Fo r e i g n K e y s N O A CT I ON SET N U L L 34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MySQL Cluster 7.3: NoSQL Access to data M y SQL Cl u s t e r Da t a N o de s 35
  • MySQL Cluster 7.3 – Node.js MySQL Cluster 7.3: NoSQL API • Native JavaScript access to MySQL Cluster • End-to-End JavaScript: browser to the app & DB • Storing and retrieving JavaScript objects directly in MySQL Cluster • • • 36 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Eliminate SQL transformation • Implemented as a module for node.js Integrates Cluster API library within the web app Optionally routes through MySQL Server
  • InnoDB vs NDB Considerations vs NDB Considerations InnoDB I n n o DB N DB /Cl u s t e r Fo r e i g n K e y s ✔ ✔ M a x Ro w Si ze 64K 14K Range, List, Key, Hash Key only A u t o -s h a r d i n g X ✔ Min num of servers 1 3 memcache NDBAPI (C/C++) memcache node.js (JavaScript) ClusterJ (Java) mod_ndb (Apache module) T a b l e Pa r t i t i o n i n g N o SQL A c c e s s 37 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • MSQL Cluster 7.3:MySQL 5.6 Support MySQL 5.6 Support MySQL Cluster 7.3 – Select storage engine per table Local InnoDB Tables Local InnoDB Tables – InnoDB  Large Rows, DSS Queries, FTS – NDB/Cluster  Auto-sharding, real-time, HA Uses latest MySQL 5.6 Server MySQL Cluster NDB Storage Engine – Enhanced Optimizer – Replication Checksums – Time-Delayed Replication 38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved | Oracle reserves the right to change the content and timing of all future releases
  • MySQL Cluster 7.3 – Connection Thread Scalability Increases throughput of MySQL Cluster Data Nodes each connection to the data layer Increases cluster scalability – Each connection Wi t h Co n n e c t i o n T h r e a d Sc a l a b i l i t y consumes one of 256 node ids Up to 8x higher MySQL Cluster Data Nodes 39 Copyright © 2013, Oracle and/or its affiliates. All rights reserved | Oracle reserves the right to change the content and timing of all future releases performance per connection – SQL & NoSQL interfaces
  • MySQL Cluster 7.3 Auto-Installer • • • • Fast configuration Auto-discovery Workload optimized Repeatable best practices • MySQL Cluster 7.2 & 7.3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Auto-Discover Deploy 40 Specify Workload Define Topology
  • Questions? 41 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.