48
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 The State of The Dolphin 杜修文 [email protected] Principle Sales Consultant, MySQL Global SC Oracle LLC

MySQL5.6&5.7 Cluster 7.3 Review

  • Upload
    -

  • View
    111

  • Download
    6

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1

The State of The Dolphin 杜修文 [email protected]

Principle Sales Consultant, MySQL Global SCOracle LLC

Page 2: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2

MySQL對 Oracle很重要

完整的方案

毎個層面都是最佳血統

佈署於自己的中心及雲端

MySQL: 網上 ,行動 ,及嵌入應用

Page 3: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3

效能及橫向擴展 高可用 , 自行修復和資料完整性 開通,監看,和資源管理 使開發者更有彈性 安全控管

Page 4: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4

免責聲明

以下資訊用於說明我們產品一般性的方向 . 其目的只限於提供參考 ,不可成為任何合約的內容或附件 . 也不會當成提供任何材料,代碼,或功能的承諾 , 且不可當成 採購決策的依據 . Oracle保有於其中提到的任何

Oracle產品的開發,發行和推出時間決定權利 .

Page 5: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5

MYSQL OVERVIEW

Page 6: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6

MySQL DabasePerformance, Reliability, Ease of Use支援許多開發環境和語言

Efficient multi-高效能的多線程連線處 理

全 DML, DDL解析,成本為基礎的優化器,查詢和其結果集的快取

依表彈性指定儲存引擎,應應用系統的特性選擇儲存引擎

彈性的日誌和實體存儲的選擇

Page 7: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7

MySQL Master MySQL Slave

relaybinlog

mysqld

data

index &binlogs

databinlog

updatesselects

updates

mysqld

I/O Thread

SQL Thread

Replication

MySQL Database複製的內部

Page 8: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8

Writes & Reads Reads Reads

• 寫到一個 master• 用多個 slaves支持讀 , 很容易依需要加上更多• 非常適用於有大量讀寫的應 用

Application

MySQL Replication

Load Balancer

MySQL Database複製帶來的擴展性

Page 9: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9

MYSQL NTERPRISE EDITION

Page 10: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10

• MySQL 視覺化開發 , 監看 , 備份工具 , 和 Oracle Lifetime 支持服務

MySQL Enterprise Monitor

Performance Monitoring/ Alerts

Hot fixes

Service packs

MySQL Workbench

Oracle Lifetime Support

MySQL Enterprise Backup

MySQL 企業版

Query Analyzer

Dev, Monitoring/

Backup Tools

Oracle Lifetime

Support Services

Page 11: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11

MySQL 企業備份•對 InnoDB做線上備份

•全備份,增量備份,部分備份 (可編入 script的介面 )

•壓縮備出的資料

•可選擇指時,完全,部份回復

•狀態,進程,歷史的超資料

•無資料庫容量的限制

•跨平台• Windows, Linux, Unix

•和 Oracle Secure Backup相容確保您的MySQL應用的快速,線上備份,和回復 .

Page 12: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12

A Virtual MySQL Tuning Assistant!

MySQL 企業監控• 提供MySQL環境全面的資訊

• 自動的,以規則為基礎的監看和警示 (可用 SMTP, SNMP)

• 查詢擷取,監看,分析和調優 ,和監看的圖聯篩選查詢指令

• 視覺化監看 『 熱』應用系統和服務

• 以自動發覺主從架搆即時監看複製

• 和MySQL的支持服務整合

Page 13: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13

MySQL查詢分析器•不用 Slow Query Log, SHOW PROCESSLIST集中化監看查詢 ;•透過MySQL Connectors收集查詢•整合的畫面查詢執行次數,時間,和筆數• ” “視覺化 抓且行 和監視圖關聯列示指定時間內的 SQL指令•追蹤到發出 SQL指令的源碼

自日誌執行解析自動化節省時間 。找出無法自行找出的問題。

Page 14: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14

Example query exec with variable substitution

Trace query exec back to source code

Full exec EXPLAIN

查詢下鑽

Page 15: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15

• PAM (插件式認證模組 )• 使用外部的登入證認機制• 標準的介面 (Unix, LDAP, Kerberos...等 )• 代理型和非代理型用戶

• Windows• 取用原生的Windows服務• 認證己經登入到Windows的用戶 (Windows

Active Directory)• 插件式認證 API

MySQL Enterprise SecurityMySQL External Authentication

MySQL 能和現有的安控和標準作業程序結合 .

Page 16: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16

Connect as

4. 檢查 Tokens, win_joe使用者用Windows的帳號,密碼認證,同時帶出MySQL的權 限

Connect as

1. MyDomain/joe以Windows的帳號,密碼登入環 境

Connected

Authenticate

CREATE USER win_joe IDENTIFIED WITH authentication_windows AS ‘joe';

App

Win OS users, groups, etc

Win OS users, groups, etcWindows AuthWindows Auth

Connect as

2. MyDomain\joe對Windows作業系統認證

Connect as

3. MyDomain/joe登入應用系統,應用系統 以使用者win_joe登入MySQL.

ConnectorConnector

Windows認證例子

Page 17: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17

• MySQL 預設的線程處 –理 效能很好 , 但當同時連線使用者數量增加時可能會對擴充力造成限制

• MySQL 線程池在使用者增加時改善效能 /擴充力• 線程池 API

MySQL企業版擴充力MySQL線程池

當使用者增加時保障系統能持續提供更好的效能

Page 18: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18

有 Thread Pool時的線程處理

內部的用戶

連線執行線程

外部的用戶

Thread Pool線程組 1

Threads 1 - 4096

線程組 2Threads 4097 - 8193

線程組 NThreads 8194 - N

•線程池內含能設定線程數的線程組 (預設為 16),各管理可重復使用的線程數達 4096

•各連線以輪流的方式被指派到線程組•線程可定優先順序,指令在有限併行執行緒非序,載入到伺服器,當在連線數增加時改進擴充力

線程組 1

線程組 2

線程組 N

Page 19: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19

MySQL Enterprise EditionWith Thread Pool

MySQL Community ServerWithout Thread Pool

MySQL企業版

有 Thread Pool擴充力最多能增加 20倍

MySQL 5.5.16Oracle Linux 6.1, Unbreakable Kernel 2.6.322 sockets, 24 cores, 2 X 12-coreIntel(R) Xeon(R) X5670 2.93GHz CPUs72GB DDR3 RAM2 X LSI SCSI Disk (MR9261-8i) (597GB)

Page 20: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20

最近的發佈和最新的發展

Page 21: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21

MySQL 5.6: 發行過的最佳版本 !

Page 22: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22

MySQL 5.6: 擴充性

用戶可完全發揮最新的硬件和操作系統統的能量 當資料量和用戶數增加時有更好的表現

Page 23: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23

MySQL 5.5

MySQL 5.6

MySQL 5.6 SysBench 基準測試

Up to 234% Performance Gain

Page 24: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24

MySQL 5.6: 快速採納

發表的功能為MySQL社群所高度期待高品質 ,和提供許多個新能力很大的效能改善

– Innodb, 優化器 , 併行 /線程 ,鎖定 ,輸出入 ,連線 , …

支持開發者的功能– 查詢 ,分區 , NoSQL, Explain Plans, …更容易 /低成本管理

– 高可用 /複製 – 管理和維護更簡單

– 改良的監看和偵測器 (Performance Schema)

高品質 ,新功能和效能改善

Page 25: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25

MySQL Database 5.7 DMRs有啥新鮮的 ?

Page 26: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26

DMRs: Development Milestone Releases

全整功,能發行候選版的品質

毎年二到四個

讓社群能早點測試,使用及回饋

加速改良速率

改善品質

Page 27: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27

Now: MySQL 5.7.2 DMR

InnoDB 有更好的交易吞吐量,可用度 Replication 更好的擴充性和可用度 Utilities 以支持開發 /操作自動化 Performance Schema 更好的效能衡量能力 Optimizer 更好的 EXPLAINing 查詢效能

現在由下列網址就可取得 !

MySQL 5.7.2 以 MySQL 5.6為基礎,再改良 :

dev.mysql.com/downloads/mysql/

New!

Page 28: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28

MySQL 5.7.2 Sysbench 基準測試的結果Sysbench Point Select

Intel(R) Xeon(R) CPU X7560 x86_644 sockets x 8 cores-HT (64 CPU threads)2.27GHz, 256G RAMOracle Linux 6.2

比 MySQL 5.6快 95%比 MySQL 5.5快 172%

500,000 QPS

Page 29: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29

MySQL 5.7.2: 毎秒連線數更快處理新的連線

因應 Facebook所提的需求而建將線程初始化和網路初始化的負荷轉給工作線程

• mysql-bench • 25 concurrent client threads • Executing connect/select/disconnect • 100000 iterations each

+32% +64%

Page 30: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30

MySQL 5.7.2: 優化器

問題 – 在連線作業中的命令會用長時間來完成時新的功能 – 執行

– 自另一個連線作業下 EXPLAIN FOR CONNECTION

– 找出造成延遲的根本原因

– 優化命令

對執行中的查詢做 EXPLAIN

EXPLAIN [FORMAT=(JSON|TRADITIONAL)] [EXTENDED] FOR CONNECTION <id>;

Page 31: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31

MySQL 5.7.2: 優化器擴充 JSON EXPLAIN輸出

Page 32: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32

記憶體的使用 查看記憶體的使用

– 加入超過 200個記憶體類型

以下列方式匯整統計記憶體的使用

– 使用的有存的類型 (緩存 , 內部緩沖區 , …)

– 線程 /帳戶 /使用者 /主機間接作用方記憶體的作業。

屬性包括

– 記憶體的使用 (byte), 操作次數 , High/Low 高 /低水位。

存儲程式的偵測器 擴增命令偵測器

– 包括存儲程式 , 加到 5.6的 COM命令和 SQL查詢。

新的偵測工具

– 命令 /sp/cclose, cfetch, copen

– 命令 /排程 /事件

新的物件類型

– EVENT, FUNCTION, PROCEDURE, TRIGGER

新的匯總表

– events_statements_summary_by_program

MySQL 5.7.2 Performance Schema

Page 33: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33

MySQL 5.7.2: InnoDB

改進 InnoDB 線上更改表結搆– 線上改索引名

– 線上改 Varchar

改良 InnoDB的臨時表– 新的臨時表專屬的表空間

– 改良的 CREATE/DROP臨時表的效能

DDL的變更是短暫的 . 消除所有的 IO

優化 InnoDB臨時表的 DML作業– 不用 REDO logging, 不用 Change buffering, 沒有 locking

更好的效能,可用度

Page 34: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34

多線程跨交易複製

多工作線程使用在多交易併行傳到從服務器

– 併行交易必需作用在分開的資料上

– 包括在同一個 database!

維持一致性

增加從服務器的吞吐量

正在進行的項目

– 架搆重設計已經完成

– 正在進行調整 /優化的工作

從資料庫有更高的吞吐量

Page 35: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35

多源複製自多個主庫收集資訊到一個從庫

– 為所有分版提供一個視圖

– 集中備份

和半同步複製及強化的多線程從庫相容

將會依毎個來源控制及篩選 (在labs中有全域性的篩選 )

Application keeps data sets disjoint between sources應用在各來源間保持分開的資料集

Slave

labs.mysql.com

Page 36: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36

MySQL Utilities

新的 , 獨立包裝 : MySQL Utilities 1.3

將常見的開發 /作業工作自動化– 複製 : 配置 , 測試 , 監看和固障移轉 (現在是背景程式 )

– 資料庫比較 : 一致性檢核

– 資料庫管理 : 使用者 , 連線 , 表 , 等

– 審計

Python腳本– 可單獨運行或自MySQL Workbench啟動

– 可自 dev.mysql.com下載

– 能收納客戶化的腳本 ; Python library for extensibility

強大的MySQL開發 /作業管理工具

Page 37: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37

MySQL Utilities - Fabric

透過分庫做橫向擴充

Connectors– Python

– Java

– PHP

應用提供分片的鍵

– Range或 Hash– 有重分庫的工具– 全域更新和表

包括在MySQL Utilities 1.4.0中

支持分版以達橫向擴充的能力

MySQL Fabric

Read-slaves

mappings

SQL

Master group

Read-slaves

Master group

labs.mysql.com

Page 38: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38

MySQL Cluster

Page 39: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39

支持外鍵 連線線程增加擴充性 MySQL 5.6

Auto-Installer Node.js上用 NoSQL的

JavaScript

Page 40: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40

MySQL Cluster 7.3 GA: 外鍵

使MySQL Cluster能有更廣的運用範圍– Packaged apps, 客戶化項目

加上強大的功能的同時降低復雜度

– 應用邏輯和資料模型

默認為開啟

強化 SQL API & NoSQL APIs

線上增加或移除

Page 41: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41

MySQL Cluster 7.3: Node.js NoSQL API自帶的使用MySQL Cluster的 JavaScript

access– 端到端 JavaScript: 瀏灠器到應用和資料庫

– 儲存和擷取在MySQL Cluster中的 JavaScript物件

– 不需 SQL的轉換

實施成 node.js的模組– 集成在網路應用中的 Cluster 程序館

聯結高效能,分散式應用,和高效能分散式資料庫

同時也可傳到MySQL資料庫

V8 JavaScript Engine

MySQL Cluster Node.js Module

MySQL Cluster Data Nodes

Clients

Page 42: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42

MySQL Cluster 7.3: 連線線程的擴充性

增加各連線到資料層的吞吐量 可以用分開互斥元使用各連線而使客戶線程更多

降低配置的復雜度

增加集群的擴充性 各連線使用 256的節點識別分中的一個

每個連線可提升效能達 7.5倍 SQL 和 NoSQL 介面

MySQL Cluster Data Nodes

MySQL Cluster Data Nodes

With Connection Thread Scalability

Page 43: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43

MySQL Cluster 7.3: Auto-Installer

配置更快

自動發掘

優化工作負荷

可重復的最佳實務

可用於MySQL Cluster 7.2 和 7.3

Specify Workload

Auto-Discover

Define TopologyDeploy

Page 44: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44

MySQL Workbench

Page 45: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45

MySQL 資料庫 IDE

數以百萬次下載

新的 ! MySQL Workbench 6.0設計 , 開發 , 管理 , 遷移Windows, Linux, Mac OS X

GA

Page 46: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46

MySQL Workbench 6.0

新的 ! 資料庫檢視器

新的 ! 備份 /回復

新的 ! 審核日誌檢查器

新的 ! 資料遷移 : Microsoft SQL Server, Sybase, PostgreSQL

新的設計和加強

Page 47: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47

結論引領MySQL社群的創新

Oracle在過 去的 12個月內完成的提供 :– GA: MySQL 5.6, MySQL Cluster 7.3, MySQL Workbench 6.0, MySQL

Enterprise Monitor 3.0, MySQL Utilities, MySQL Connectors...and more

– DMRs: MySQL 5.7

– Labs: 多源複製 , Fabric, Hadoop Applier for MySQL

歡迎試用且給我們回饋 !

Page 48: MySQL5.6&5.7 Cluster 7.3 Review

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48

Q & A