SlideShare une entreprise Scribd logo
1  sur  107
Télécharger pour lire hors ligne
MariaDB 概要
MariaDB Server 10.3 新機能
2019-05-16
後藤 智 (GOTO Satoru)
Customer Solutions Engineer
MariaDB
とは
• MariaDBとは
• MariaDBと他DBの違い
• MariaDB Server 新機能
• MariaDB Server 顧客事例
• MariaDB ColumnStoreとは
• MariaDB ColumnStore 顧客事例
• ClustrixDB とは
Agenda
MariaDB とは
EIB(European Investment Bank)
$27M 出資
Alibaba $27M 出資
Microsoft : Platinum Sponsor
2017 2018
MariaDB最新動向
MammothDB 買収
Alibaba Cloud
ApsaraDB RDS for MariaDB TX
ServiceNow出資 / Clustrix買収
Azure Database for MariaDB : GA
MariaDB releases
Feb 2010 MariaDB 5.1
Nov 2010 MariaDB 5.2
Apr 2012 MariaDB 5.3
Feb 2012 MariaDB 5.5
Mar 2014 MariaDB 10.0
Oct 2015 MariaDB 10.1
May 2017 MariaDB 10.2.6 GA
May 2018 MariaDB 10.3.7 GA
Nov 2018 MariaDB 10.4.0 Alpha
https://downloads.mariadb.org/mariadb/+releases/
https://github.com/MariaDB/server/releases
12 Million Users in
45 Countries Trust Critical
Business Data to MariaDB
Technology & InternetTelecom
Retail & EcommerceTravel
Financial Services Gvmt & Education
Media & Social
DB-Engines Ranking of Relational DBMS - May 2019
8位
Customer and Use Cases
• Multi-terabyte DB
• 80M transactions / month
• 50+ Node Cluster
• Multi-billion rows
• 600 Million reads/second
• 250 servers, 600G + 1.5T archive
• 10M travelers/quarter
• 4M transactions/ month
• ~14TB in MariaDB
production clusters
• Over 150 servers
• 150-200k queries / sec on the MariaDB Cluster
• 6TB and millions of Call Data
Records
• Over 60 TB
• 70 million rows per day
• 4 billion impressions per month
• 3 to 10 TB
• Over billion rows, most tables
100’s of millions of rows
• Over 5 TB in Pay Per click application
MariaDB foundation sponsors
Platinum Gold
MariaDB Platform
Transactional
MariaDB Platform
Analytical
● MariaDB Server
● MariaDB MaxScale
● database connectors
● services
● support
● tools
● MariaDB ColumnStore
● MariaDB MaxScale
● database connectors
● services
● support
● tools
https://mariadb.com/pricing/
MariaDB Platform Subscription
9600 USD / インスタンス
(日本語L1サポート不要の場合)
MariaDB vs. 他データベース
Michael “Monty” Widenius
The Soul of
Open Source
Founder & CTO of MariaDB
MariaDB was created to preserve
openness and community, so that
we can push ahead faster with the
capabilities for tomorrow’s
applications.
”
“
GitHub repository
https://github.com/MariaDB/server
JIRA
https://jira.mariadb.org/projects/MDEV
True Open Source
MariaDB 独自機能/製品
• MariaDB ColumnStore
• MariaDB Server 10.3+ : PL/SQL 互換
• ClustrixDB : 分散スケールアウトデータベース
ただし現状オープンソースではない
MariaDB MySQL EnterpriseDB
(PostgreSQL)
Oracle
INTERSECT/EXCEPT Yes No Yes Yes
User-defined aggregate
functions
Yes No Yes Yes
Oracle 互換性: PL/SQL Yes No Proprietary Yes
Oracle 互換性: SEQUENCE Yes No Proprietary Yes
テンポラル・テーブル Yes No No Yes
データ難読化/マスキング Yes No No Yes
Instant ADD COLUMN Yes Yes No Yes
INVISIBLE Column Yes No No Yes
COMPRESSED Column Yes No No No
用途別 Storage Engine Yes No No No
MariaDB Platform Transactional HA
Primary/Replicas
非同期レプリケーション
+ MaxScale自動failover
1. Primary に障害
2. MaxScale MariaDB Monitor : master_down 検知
3. MaxScale : Slave を新しい Primaryに自動昇格
4. MaxScale : 新PrimaryにWriteクエリをルーティング
*MaxScale is licenced under BSL 1.1
Primary/Replicas + Read/Write split routing
2
MaxScale
MariaDB Galera Cluster
Multi-Master
Synchronous Replication
Galera Cluster + Read/Write split routing
MaxScale : 1ノードを”Master”として選択
Writeクエリは”Master”にのみルーティlング
全ノードがMasterのため,1ノードダウンしても
MaxScaleが他ノードを新たな”Master”として選
定
*MaxScale is licenced under BSL 1.1
MaxScale
MariaDB Server
新機能
10.1 (GA)
Multi-master Sync. Replication
(Galera Cluster)
Data-at-Rest Encryption
Password Validation
Page Compression
Spatial References (GIS)
10.2 (GA) 10.3 (GA)
Window Functions
Common Table Expressions
Check Constraints
JSON & GeoJSON Functions
Flashback (Point in Time Rollback)
Mult-Trigger Support
Delayed Replication
Binary Log Compression
Per User Resource Limits
Virtual Column Indexes
Sequences & PL/SQL
(for migration from Oracle )
System Versioned Table
Hidden Columns
Instant ADD COLUMN
Column compression
Spider / MyRocks : GA
User-defined Aggregate Functions
Intersect & Except
MariaDB Server 新機能
MariaDB Server 新機能
● 用途別ストレージエンジン(Purpose-built storage engine)
● スキーマ関連新機能(Schema evolution)
● テンポラルテーブル(Temporal Table)
● Oracle DBとの互換性(PL/SQL, SEQUENCE etc)
● セキュリティ向上
Purpose-built storage
engines
MyRocks
Purpose-built storage engines
Purpose-built storage: MyRocks
SSD vs. HDD:
• Pros
– 高速
– 少消費電力
• Cons
– 書込回数制限
– 高価
Purpose-built storage: MyRocks
Facebook におけるSSD利用上の課題:
● サーバ数/SSD数が膨大なためストレージ使用効率 要改善
⇒ コスト削減
● InnoDB : ストレージ使用効率に課題
Purpose-built storage: MyRocks
MyRocks introduction and production deployment - 松信 嘉範 様
https://www.slideshare.net/matsunobu/myrocks-introduction-and-production-deployment
M|18 How to use MyRocks with MariaDB - Sergei Petrunia
https://www.slideshare.net/MariaDB/m18-myrocks-in-mariadb
Google
Bigtable
LevelDB
(Google)
MyRocks
(Facebook)
RocksDB
(Facebook)
MyRocks
(MariaDB)
Apache
Hbase
Purpose-built storage: MyRocks
SSD に最適化: 高圧縮率, 書込回数抑制
Writeに特化: 読込は多少遅い
Storage: primary key : 小メタデータ
InnoDB: 13 bytes 非圧縮
MyRocks: 8 bytes + zero filling + prefix key encoding,
compressed
Spider
Purpose-built storage engines
Purpose-built storage engine: Spider
● 透過的シャーディング
● スケーラビィティと並行性
a. パーティショニング (by range / key / hash / list)
b. Pushdown (e.g., condition, index, join and aggregate)
● 高可用性と一貫性
a. Two-phase commit
Database #1
Spider
Table A
Database #3Database #2
InnoDB
Table A (Partition 2)
InnoDB
Table A (Partition 1)
Rows: 1-500,000 Rows: 501,000-1,000,000
Database #1
Spider
Table A
Database #3 Database #4Database #2
InnoDB
Table A (Partition 2)
InnoDB
Table A (Partition 1)
InnoDB
Table A (Partition 3)
Rows: 1-500,000 Rows: 501,000-1,000,000 Rows: 1,000,001-1,500,000
Database #1
Spider
Table A
Database #3 Database #4Database #2
InnoDB
Table A (Partition 2)
InnoDB
Table A (Partition 1)
InnoDB
Table A (Partition 3)
Rows: 1-500,000 Rows: 501,000-1,000,000 Rows: 1,000,001-1,500,000
Database #5
Spider
Table A
Spider : customer use case
Tencent Games
● 数千インスタンス規模で利用
● Spiderの開発に貢献
● MariaDB財団のスポンサー
Microservices
Database #1
InnoDB
(mixed)
Products table
MyRocks
(write-intensive)
Orders table
Order service Product service
Spider
(scalable)
Cart table
Cart service
Database #2
InnoDB
(mixed)
Cart table
Database #3
InnoDB
(mixed)
Cart table
Database #4
InnoDB
(mixed)
Cart table
Purpose-builtstorageengine
Database #2-4
(large, medium-grade SSDs)
Microservices
Database #5-9
(medium, high-end HDDs)
Database #1
(small, high-end SSD)
InnoDB
(mixed)
Orders table (1 year)
MyRocks
(write-intensive)
Order
service
Order history
service
Orders table (30 days)
ColumnStore
(analytical)
Orders table (5 years)
Order analytics
service
Replication
Purpose-builtstorageengine
Column Compression
What’s new in MariaDB Server 10.3
Schema evolution: row compression
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000)
) ENGINE=innodb ROW_FORMAT=COMPRESSED;
InnoDB only, buffer pool: compressed + uncompressed (redundant)
Schema evolution: page compression
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000)
) ENGINE=innodb PAGE_COMPRESSED=1;
InnoDB only, buffer pool: uncompressed
Schema evolution: column compression (New)
CREATE TABLE users(
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000) COMPRESSED
);
storage-engine independent
Invisible(hidden) Columns
What’s new in MariaDB Server 10.3
Schema evolution: invisible columns
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000) COMPRESSED,
secret VARCHAR(20) INVISIBLE
);
SQL Server = HIDDEN (period columns only)
Db2 = IMPLICITLY HIDDEN
Oracle = INVISIBLE
Schema evolution: invisible columns
CREATE TABLE users2 (
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000) COMPRESSED,
secret VARCHAR(20) INVISIBLE NOT NULL DEFAULT 'OOPS'
);
SQL Server = HIDDEN (period columns only)
Db2 = IMPLICITLY HIDDEN
Oracle = INVISIBLE
Invisible Columns : SELECT with *
SELECT * FROM users;
+----+---------+----------------------------------------+
| id | name | bio |
+----+---------+----------------------------------------+
| 1 | Shane | Once deleted a table in production… |
| 2 | William | Was caught listening to Spice Girls… |
| 3 | Aneesh | Was with William listening to… |
+----+---------+----------------------------------------+
secret 列 : 非表示(invisible)
Invisible Columns: 明示的カラム指定
SELECT id, name, secret FROM users;
+----+---------+-------------+
| id | name | secret |
+----+---------+-------------+
| 1 | Shane | Gojira |
| 2 | William | Spice Girls |
| 3 | Aneesh | Maria Carey |
+----+---------+-------------+
明示的にカラム指定すると表示される
INSTANT ADD COLUMN
What’s new in MariaDB Server 10.3
INSTANT ADD COLUMN
● 隠し(hidden)メタデータ・レコードを当該テーブルに追加
● データ・ディクショナリ更新
● INSERTより多少高コスト
● 既存のADD COLUMNと比較し,非常に高速
● Sponsored by
制限事項
● 最後列に追加(append)
● 全文検索 (FTS) インデックスがある場合使用不可
● InnoDBで row compressionを使用している場合使用不可
INSTANT ADD COLUMN の例
CREATE TABLE users(
id INT PRIMARY KEY,
name VARCHAR(50),
bio TEXT(2000) COMPRESSED,
secret VARCHAR(20) INVISIBLE
);
ALTER TABLE users ADD COLUMN email VARCHAR(50),
ALGORITHM=INSTANT;
https://mariadb.com/kb/en/library/instant-add-column-for-innodb/
INSTANT DROP COLUMN in MariaDB Server 10.4
https://jira.mariadb.org/browse/MDEV-15562
テンポラル・テーブル
What’s new in MariaDB Server 10.3
テンポラル・テーブル : ユースケース
• 監査: 時間を遡った追跡が可能
● 過去の任意時点へのリカバリ
● 偶発的なデータ変更/削除や人為的エラー,アプリケ
ーション エラーからの復旧
テンポラル・テーブル
CREATE TABLE cust_notifications (
cid INT,
newsletter BOOLEAN,
product_updates BOOLEAN,
security_alerts BOOLEAN
) WITH SYSTEM VERSIONING;
or
ALTER TABLE cust_notifications ADD SYSTEM VERSIONING;
(System Versioned Tables)
テンポラルテーブルQuery : 全履歴
SELECT *, ROW_START, ROW_END
FROM cust_notifications FOR SYSTEM_TIME ALL;
cid newsletter product_updates security_alerts row_start row_end
1 FALSE FALSE TRUE 2018-03-30 2038-01-19
1 TRUE FALSE TRUE 2018-02-14 2018-03-29
1 FALSE FALSE TRUE 2018-01-01 2018-02-13
1 FALSE FALSE FALSE 2017-01-01 2017-12-31
テンポラルテーブルQuery : 任意日時指定
SELECT * FROM cust_notifications
FOR SYSTEM_TIME AS OF '2017-12-31'
WHERE cid = 1;
cid newsletter product_updates security_alerts
1 FALSE FALSE FALSE
テンポラルテーブルQuery : 任意時間帯指定
SELECT * FROM cust_notifications
FOR SYSTEM_TIME BETWEEN '2018-02-01' AND '2018-03-30'
WHERE cid = 1;
cid newsletter product_updates security_alerts
1 FALSE FALSE TRUE
1 TRUE FALSE TRUE
BETWEEN includes the start and end
テンポラルテーブルQuery : 任意時間帯指定
SELECT * FROM cust_notifications
FOR SYSTEM_TIME FROM '2018-02-01' TO '2018-03-30'
WHERE cid = 1;
cid newsletter product_updates security_alerts
1 TRUE FALSE TRUE
FROM includes the start, but not the end
テンポラルテーブル: partitioning
CREATE TABLE cust_notifications (
cid INT WITHOUT SYSTEM VERSIONING,
status VARCHAR(10),
newsletter BOOLEAN,
product_updates BOOLEAN,
security_alerts BOOLEAN
) WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME INTERVAL 1 YEAR (
PARTITION p_year_one HISTORY,
PARTITION p_year_two HISTORY,
PARTITION p_year_three HISTORY,
PARTITION p_year_current CURRENT
);
テンポラルテーブル: データ変更履歴の削除
DELETE HISTORY FROM cust_notifications;
DELETE HISTORY FROM cust_notifications
BEFORE SYSTEM_TIME '2018-01-01';
ALTER TABLE cust_notifications
DROP PARTITION p_year_three;
Oracle 互換機能
What’s new in MariaDB Server 10.3
MariaDB Server 10.3+ : SEQUENCE
CREATE SEQUENCE seq_customer_id
START WITH 100 INCREMENT BY 10;
SELECT seq_customer_id.NEXTVAL;
CREATE TABLE customers (
id INT DEFAULT seq_customer_id.NEXTVAL
);
PL/SQL 互換性
Data types: VARCHAR2, NUMBER, DATE, RAW, BLOB, CLOB
Variable declarations: %TYPE
Records: %ROW_TYPE
Control statements: IF THEN, CASE WHEN, LOOP/END LOOP, WHILE
Static SQL: CURRVAL, NEXTVAL
Dynamic SQL: EXECUTE IMMEDIATE USING
PL/SQL 互換性
Implicit cursors: SQL%ISOPEN, SQL%FOUND, SQL%NOTFOUND,
SQL%ROWCOUNT
Explicit cursors: CURSOR IS, FETCH INTO, parameters, FOR IN LOOP
Blocks: DECLARE, BEGIN, EXCEPTION, WHEN THEN, END
Stored procedures: CREATE OR REPLACE PROCEDURE IS|AS, OUT, IN OUT
Functions: CREATE OR REPLACE FUNCTION AS|IS
Triggers: CREATE OR REPLACE TRIGGER, BEFORE|AFTER, FOR EACH ROW,
NEW, OLD
Packages: CREATE PACKAGE, CREATE PACKAGE BODY
より高度なセキュリティ
What’s new in MariaDB Server 10.3
https://www.csoonline.com/article/2130877/data-breach/the-biggest-data-breaches-of-the-21st-century.html
MaxScale : データ難読化/マスキング
SELECT name, ssn FROM employees
WHERE id=1;
// full data masking config
"replace": {"column": "ssn"},
"with": {"fill": "XXX-XX-XXXX"}
// partial data masking config
"replace": {"column": "ssn", "match":
"d{5}"},
"with": {"fill": "X"}
// data obfuscation config
"obfuscate": {column": "ssn"}
name ssn
Shane XXX-XX-XXXX
name ssn
Shane XXX-XX-1234
name ssn
Shane dlkdj389ud
https://mariadb.com/ja/resources/blog/maxscale-masking-filter/
Full data masking
Partial data masking
Obfuscation
MariaDB 公式Docker Image
MariaDB 公式 Docker レポジトリ
https://hub.docker.com/u/mariadb
● 新 MariaDB ロゴ
● New images
○ MariaDB Server
○ ColumnStore
○ MaxScale
Docker, Inc. MariaDB Server image
https://hub.docker.com/_/mariadb
● 古い MariaDB ロゴ
● MariaDB Server のみ
● Docker, Inc. がビルド
その他
What’s new in MariaDB Server 10.3
MariaDB Server: その他新機能
Encrypted temporary files
User-defined aggregate functions
Ordered-set aggregate functions (e.g., PERCENTILE_CONT)
INTERSECT/EXCEPT
Table value constructors
DDL/SELECT lock timeout
MariaDB Server
Customer User Cases
PL/SQL互換性: DBS Bank Singapore
M|18 DBS Bank’s Journey with MariaDB
https://www.slideshare.net/MariaDB/m18-dbs-banks-journey-with-mariadb
DBSはシンガポールの銀行で、1968年にシンガポール政府により開発に対する融資機関
として設立された。DBS銀行は東南アジアにおいて資産において最も大きな銀行で、ア
ジアの中でも大規模な銀行の1つである。
Use Case : DBS Bank Singapore
https://www.slideshare.net/MariaDB/m18-dbs-banks-journey-with-mariadb
Use Case : DBS Bank Singapore
Use Case: ServiceNow
https://www.slideshare.net/MariaDB/m18-servicenow-keynote
Use case: ドワンゴ様
● 課題
マイクロサービス化への対応のためデータベース運用効率化と安定的
運用
● 解決策
MariaDB Galera Clusterによる新データベース基盤構築
● 結果
○ ダウンタイム大幅削減により安定した運用を実現
○ データベース基盤集約化、運用コスト削減
Download
https://mariadb.com/downloads
1
Read the Technical overviews
https://mariadb.com/resources/datasheets-guides
2
Knowledge Base
https://mariadb.com/kb
3
Smart Style 様 TECH BLOG
https://www.s-style.co.jp/blog
4
Get Started with MariaDB
Contact us / Social Media
MariaDB Japan LinkedIn Group
https://www.linkedin.com/groups/12169417/
日本語 Blog
https://mariadb.com/ja/resources/blog/
お問い合わせ
https://mariadb.com/ja/contact/
Thank you
Appendix
MariaDB ColumnStore
For Analytics
MariaDB ColumnStoreとは
クラウド/オンプレミス
双方で運用可
オープンソースOLAP
高データ圧縮率
分散データ分析
OLTP ストレージエンジン
とのCross-Engine Join
エンタープライズ
セキュリティ/HA
容易な管理と
スケーラビリティ
並列/分散クエリ
列指向に最適化
高データ圧縮率
高速, 高効率なクエリ
データ分析を
簡単に
低コスト/高性能
DWHに適したスケーラブルな列指向分散データベース
MariaDB ColumnStore Architecture
Columnar Distributed Data Storage
Local Storage | SAN | EBS | GlusterFS | Ceph
BI Tool SQL Client Custom
Big Data App
Application
MariaDB SQL
Front End
Distributed
Query Engine
Data
Storage
User Module (UM)
Performance
Module (PM)
行指向 vs. 列指向
• 行指向(InnoDB etc.)
– 各行シーケンシャルにデータファイ
ルに書込
– クエリ実行時すべての行をスキャン
• 列指向(ColumnStore)
– 各列個別データファイルにストア
– クエリに関連する列のみスキャン
ID Fname Lname State Zip Phone Age Sex
1 Bugs Bunny NY 11217 (718) 938-3235 34 M
2 Yosemite Sam CA 95389 (209) 375-6572 52 M
3 Daffy Duck NY 10013 (212) 227-1810 35 M
4 Elmer Fudd ME 04578 (207) 882-7323 43 M
5 Witch Hazel MA 01970 (978) 744-0991 57 F
ID
1
2
3
4
5
Fname
Bugs
Yosemite
Daffy
Elmer
Witch
Lname
Bunny
Sam
Duck
Fudd
Hazel
State
NY
CA
NY
ME
MA
Zip
11217
95389
10013
04578
01970
Phone
(718) 938-3235
(209) 375-6572
(212) 227-1810
(207) 882-7323
(978) 744-0991
Age
34
52
35
43
57
Sex
M
M
M
M
F
SELECT Fname FROM table1 WHERE State = 'NY'
スケーラビリティ
• MPP architecture
– リニアなスケーラビリティ
• 水平スケールアウト
– PMノード追加によるスケールアウト
– ノード追加作業中もReadクエリ実行可
Shared-Nothing Distributed Data Storage
Compressed by default
User
Module
(UM)
Performance
Module
(PM)
Data Storage
ColumnStore ストレージアーキテクチャ
• 列指向ストレージ
– 各列は個別のファイルにストア
– インデックス定義は不要
– オンラインでスキーマ変更可
• 自動水平partitioning (extent)
– 8,000,000行ごとにパーティショニング
– 各パーティションの最小/最大値をメタデータ
として保持
– 手動パーティション管理は不要
• データ圧縮
– テーブルへの I/O を低減
Column 1
Extent 1 (8 million rows, 8MB~64MB)
Extent 2 (8 million rows)
Extent M (8 million rows)
Column 2 Column 3 ... Column N
Data automatically arranged by
• Column – Acts as Vertical Partitioning
• Extents – Acts as horizontal partition
Vertical
Partition
Horizontal
Partition
...
Vertical
Partition
Vertical
Partition
Vertical
Partition
Horizontal
Partition
Horizontal
Partition
高速データインポート(cpimport)
• 高速な並列バルクロード
– すべてのPMに対して並列ロード
– 複数テーブルに対して同時にロード可
– Readクエリはデータロード中も実行可能
• ストリーミングデータロード(CDC)
Column 1
Extent 1 (8 million rows, 8MB~64MB)
Extent 2 (8 million rows)
Extent M (8 million rows)
Column 2 ... Column N
Horizontal
Partition
...
Horizontal
Partition
Horizontal
Partition
High Water Mark
New Data being loaded
Dataaccessedby
runningqueries
Shared Nothing Distributed Data Storage
SQL
Column
Primitives
User
Module
Performance
Module
UM
PM
高速なクエリ実行
• UM上のMariaDB Front Endでクエリ構文解析
• Storage Engine Plugin がクエリをPMに分散
• PM上で並列/分散しクエリ実行
• GROUP BY / aggregation関数をローカルデータに対
し実行
• PMから中間クエリ結果をUMに返す
Massively parallel, distributed query processing, Shared nothing architecture
Primitives ↓↓↓↓
Intermediate
↑↑Results↑↑
Horizontal
Partition:
8 Million Rows
Extent 2
Horizontal
Partition:
8 Million Rows
Extent 3
Horizontal
Partition:
8 Million Rows
Extent 1
低I/Oストレージアーキテクチャ
• クエリに関連する列にのみアクセス
• クエリのWHERE/JOINに関連しない
ブロックにアクセスしない
Extent 1:
Min State: CA, Max State: NY
Extent 2:
Min State: OR, Max State: WY
Extent 3:
Min State: IA, Max State: TN
SELECT Fname FROM Table 1 WHERE State = ‘NY’
高いクエリ性能
ID
1
2
3
4
...
8M
8M+1
...
16M
16M+1
...
24M
Fname
Bugs
Yosemite
Daffy
Hazel
...
...
Jane
...
Elmer
Lname
Bunny
Sam
Duck
Fudd
...
...
...
State
NY
CA
NY
ME
...
MN
WY
TX
OR
...
VA
TN
IA
NY
...
PA
Zip
11217
95389
10013
04578
...
...
...
Phone
(718) 938-3235
(209) 375-6572
(212) 227-1810
(207) 882-7323
...
...
...
Age
34
52
35
43
...
...
...
Sex
M
M
M
F
...
...
...
Vertical
Partition
Vertical
Partition
Vertical
Partition
Vertical
Partition
Vertical
Partition
…
ELIMINATED PARTITION
• Analytics
– 複雑な join, aggregation(集約), Window関数
– UDF(ユーザ定義関数)
– InnoDB等, 他ストレージエンジンとの
Cross Engine Join
• BI connectivity
– Java, C/C++, ODBC connectorsによる既存BIツ
ールとの連携
– e.g. Tableau (certified)
Analytics
Daily Running Average Revenue for each item
SELECT item_id, server_date, daily_revenue,
AVG(revenue) OVER
(PARTITION BY item_id ORDER BY server_date
RANGE INTERVAL '1' DAY PRECEDING ) running_avg
FROM web_item_sales
Item ID Server_date Revenue
1 02-01-2014 20,000.00
1 02-02-2014 5,001.00
2 02-01-2014 15,000.00
2 02-04-2014 34,029.00
2 02-05-2014 7,138.00
3 02-01-2014 17,250.00
3 02-03-2014 25,010.00
3 02-04-2014 21,034.00
3 02-05-2014 4,120.00
Running Average
20,000.00
12,500.50
15,000.00
34,209.00
20,583.50
17,250.00
250,100.00
12,577.00
20,583.50
セキュリティ/HA
• エンタープライズセキュリティ
–SSL, Roleによりアクセス管理
• 柔軟なプラットフォーム選択
–オンプレミス
–クラウド
• 高可用性(HA)
–自動UM フェールオーバ
–自動PM フェールオーバ
(EBS, GlusterFS等
分散ファイルシステムによる)
Shared-Nothing Distributed Data Storage
Compressed by default
User
Module
(UM)
Performance
Module
(PM)
Data Storage
MariaDB ColumnStore
Customer User Cases
MariaDB ColumnStore Customers
MarTech Technology/Internet/IoTFinance Health Care
Services
Public Sector
IHME - Institute of Health Metrics and Evaluation
● Use Case:
○ Public Health Data Analytics
● Competition:
○ Percona InnoDB, MemSQL
● Why ColumnStore:
○ InnoDB (Percona) reached
performance limit w/ max tuning
for 4 TB data
○ ColumnStore easy to use
● Data Volume: Started with 4.2 TB,
with goal to go to 30TB of data in 5
years
Wrong database/storage engine (MySQL InnoDB) for analytics use case
Application Application Application Application Application
http://www.healthdata.org/results/data-visualizations
日立製作所様
● オンプレミス
● Tableau による定型レポート
● Pentaho Data Integration(PDI)上でGUIによるデータイ
ンポート(1.2以降)
MariaDB ColumnStore まとめ
クラウド/オンプレミス
に対応
オープンソースOLAP
高データ圧縮率
分散データ分析
OLTP ストレージエンジン
とのCross-Engine Join
エンタープライズ
セキュリティ/HA
容易な管理と
スケーラビリティ
並列/分散クエリ
列指向に最適化
高データ圧縮率
高速, 高効率なクエリ
データ分析を
簡単に
低コスト/高性能
ClustrixDB
Scale Out RDBMS
New
ClustrixDBとは
Applications
アプリケーション変更は最小限に
no Sharding
no Replication
アプリケーションからは
MariaDB/MySQL サーバとして扱える
Load Balancer
Applications
MariaDB/MySQL
*ClustrixDB is NOT open sourced, a proprietary software
MariaDB 製品の中での位置づけ
AnalyticalHigh-Scale
Transactional
ClustrixDB
MariaDB
Transactional
MariaDB
Analytical
MariaDB Galera
Cluster
For High Availability on
Mainstream
Workloads
Mainstream
Database Workloads
ClustrixDB: スケールアウト, Fault-tolerant, MySQL互換
ClustrixDB
ACID Compliant
Transactions & Joins
Optimized for OLTP
Built-In Fault Tolerance
Flex-Up and Flex-Down
Minimal DB Admin
Also runs great in
the Data Center
Built to run
in the Cloud
ClustrixDB国内事例
https://www.slideshare.net/rakutentech/dbtechshowcase2013tokyo
MariaDB ClustrixDB 9.1 documentation
http://docs.clustrix.com/

Contenu connexe

Tendances

Riak Search 2.0を使ったデータ集計
Riak Search 2.0を使ったデータ集計Riak Search 2.0を使ったデータ集計
Riak Search 2.0を使ったデータ集計
正志 坪坂
 

Tendances (19)

事例で学ぶApache Cassandra
事例で学ぶApache Cassandra事例で学ぶApache Cassandra
事例で学ぶApache Cassandra
 
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
 
MySQL de NoSQL Fukuoka
MySQL de NoSQL FukuokaMySQL de NoSQL Fukuoka
MySQL de NoSQL Fukuoka
 
Snowflake Elastic Data Warehouse as a Service
Snowflake Elastic Data Warehouse as a ServiceSnowflake Elastic Data Warehouse as a Service
Snowflake Elastic Data Warehouse as a Service
 
サンプルで学ぶCassandraアプリケーションの作り方
サンプルで学ぶCassandraアプリケーションの作り方サンプルで学ぶCassandraアプリケーションの作り方
サンプルで学ぶCassandraアプリケーションの作り方
 
[db tech showcase OSS 2017] A24: マイクロソフトと OSS Database - Azure Database for M...
[db tech showcase OSS 2017] A24: マイクロソフトと OSS Database - Azure Database for M...[db tech showcase OSS 2017] A24: マイクロソフトと OSS Database - Azure Database for M...
[db tech showcase OSS 2017] A24: マイクロソフトと OSS Database - Azure Database for M...
 
ROMA のアーキテクチャと社内事例
ROMA のアーキテクチャと社内事例ROMA のアーキテクチャと社内事例
ROMA のアーキテクチャと社内事例
 
Cassandra Meetup Tokyo, 2016 Spring 2
Cassandra Meetup Tokyo, 2016 Spring 2Cassandra Meetup Tokyo, 2016 Spring 2
Cassandra Meetup Tokyo, 2016 Spring 2
 
RDB開発者のためのApache Cassandra データモデリング入門
RDB開発者のためのApache Cassandra データモデリング入門RDB開発者のためのApache Cassandra データモデリング入門
RDB開発者のためのApache Cassandra データモデリング入門
 
Guide to Cassandra for Production Deployments
Guide to Cassandra for Production DeploymentsGuide to Cassandra for Production Deployments
Guide to Cassandra for Production Deployments
 
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
 
MariaDB ColumnStore ベンチマークしちゃいませんか?
MariaDB ColumnStore ベンチマークしちゃいませんか?MariaDB ColumnStore ベンチマークしちゃいませんか?
MariaDB ColumnStore ベンチマークしちゃいませんか?
 
20220331_DSSA_MigrationToYugabyteDB
20220331_DSSA_MigrationToYugabyteDB20220331_DSSA_MigrationToYugabyteDB
20220331_DSSA_MigrationToYugabyteDB
 
Datastax Enterpriseをはじめよう
Datastax EnterpriseをはじめようDatastax Enterpriseをはじめよう
Datastax Enterpriseをはじめよう
 
Snowflake Architecture and Performance
Snowflake Architecture and PerformanceSnowflake Architecture and Performance
Snowflake Architecture and Performance
 
Cassandra における SSD の活用
Cassandra における SSD の活用Cassandra における SSD の活用
Cassandra における SSD の活用
 
Riak Search 2.0を使ったデータ集計
Riak Search 2.0を使ったデータ集計Riak Search 2.0を使ったデータ集計
Riak Search 2.0を使ったデータ集計
 
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
 
Apache Cassandra最新情報まとめ
Apache Cassandra最新情報まとめApache Cassandra最新情報まとめ
Apache Cassandra最新情報まとめ
 

Similaire à MariaDB 10.3 概要

Fusion-io(ioDrive) benchmarking #sfstudy 01 LT
Fusion-io(ioDrive) benchmarking #sfstudy 01 LTFusion-io(ioDrive) benchmarking #sfstudy 01 LT
Fusion-io(ioDrive) benchmarking #sfstudy 01 LT
Masahito Zembutsu
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14
Masahiro Nagano
 
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DRAmazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
株式会社クライム
 
081108huge_data.ppt
081108huge_data.ppt081108huge_data.ppt
081108huge_data.ppt
Naoya Ito
 
20100930 sig startups
20100930 sig startups20100930 sig startups
20100930 sig startups
Ichiro Fukuda
 

Similaire à MariaDB 10.3 概要 (20)

LINEのMySQL運用について
LINEのMySQL運用についてLINEのMySQL運用について
LINEのMySQL運用について
 
Fusion-io(ioDrive) benchmarking #sfstudy 01 LT
Fusion-io(ioDrive) benchmarking #sfstudy 01 LTFusion-io(ioDrive) benchmarking #sfstudy 01 LT
Fusion-io(ioDrive) benchmarking #sfstudy 01 LT
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14
 
ioMemoryとAtomic Writeによるデータベース高速化
ioMemoryとAtomic Writeによるデータベース高速化ioMemoryとAtomic Writeによるデータベース高速化
ioMemoryとAtomic Writeによるデータベース高速化
 
継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え継続?移行?Oracle SE2 RACのサポート終了に向けた備え
継続?移行?Oracle SE2 RACのサポート終了に向けた備え
 
MySQL Cluster7.3 GAリリース記念セミナー! MySQL & NoSQL 圧倒的な進化を続けるMySQLの最新機能!
MySQL Cluster7.3 GAリリース記念セミナー! MySQL & NoSQL 圧倒的な進化を続けるMySQLの最新機能!MySQL Cluster7.3 GAリリース記念セミナー! MySQL & NoSQL 圧倒的な進化を続けるMySQLの最新機能!
MySQL Cluster7.3 GAリリース記念セミナー! MySQL & NoSQL 圧倒的な進化を続けるMySQLの最新機能!
 
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DRAmazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
Amazon RDS/Azure SQL/Google Cloud SQL 対応DBが多様!異種DBへの移行・連携ならSyniti DR
 
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
[中国地方DB勉強会] 第22回 Webアプリ開発をデータベース側から変革していく - MySQL 8.0新機能
 
LINEのMySQL運用について 修正版
LINEのMySQL運用について 修正版LINEのMySQL運用について 修正版
LINEのMySQL運用について 修正版
 
081108huge_data.ppt
081108huge_data.ppt081108huge_data.ppt
081108huge_data.ppt
 
AWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDSAWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDS
 
[ウェビナー] Build 2018 アップデート ~ データ プラットフォーム/IoT編 ~
[ウェビナー] Build 2018 アップデート ~ データ プラットフォーム/IoT編 ~[ウェビナー] Build 2018 アップデート ~ データ プラットフォーム/IoT編 ~
[ウェビナー] Build 2018 アップデート ~ データ プラットフォーム/IoT編 ~
 
Windows Server 2016 で作るシンプルなハイパーコンバージドインフラ (Microsoft TechSummit 2016)
Windows Server 2016 で作るシンプルなハイパーコンバージドインフラ (Microsoft TechSummit 2016)Windows Server 2016 で作るシンプルなハイパーコンバージドインフラ (Microsoft TechSummit 2016)
Windows Server 2016 で作るシンプルなハイパーコンバージドインフラ (Microsoft TechSummit 2016)
 
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
[OSC 2017 Tokyo/Fall] OSSコンソーシアム DB部会 MySQL 8.0
 
Developers.IO 2019 Effective Datalake
Developers.IO 2019 Effective DatalakeDevelopers.IO 2019 Effective Datalake
Developers.IO 2019 Effective Datalake
 
SQL Server 2019 とともに知る Microsoft Data Platform
SQL Server 2019 とともに知る Microsoft Data PlatformSQL Server 2019 とともに知る Microsoft Data Platform
SQL Server 2019 とともに知る Microsoft Data Platform
 
20100930 sig startups
20100930 sig startups20100930 sig startups
20100930 sig startups
 
Introduction of Oracle Database Architecture(抜粋版) - JPOUG Oracle Database入学式 ...
Introduction of Oracle Database Architecture(抜粋版) - JPOUG Oracle Database入学式 ...Introduction of Oracle Database Architecture(抜粋版) - JPOUG Oracle Database入学式 ...
Introduction of Oracle Database Architecture(抜粋版) - JPOUG Oracle Database入学式 ...
 
DynamoDBのテーブル設計手法.pptx
DynamoDBのテーブル設計手法.pptxDynamoDBのテーブル設計手法.pptx
DynamoDBのテーブル設計手法.pptx
 
Cld002 windows server_2016_で作るシンプ
Cld002 windows server_2016_で作るシンプCld002 windows server_2016_で作るシンプ
Cld002 windows server_2016_で作るシンプ
 

Plus de GOTO Satoru (7)

Kubernetes アプリケーションにオブザーバビリティを
Kubernetes アプリケーションにオブザーバビリティをKubernetes アプリケーションにオブザーバビリティを
Kubernetes アプリケーションにオブザーバビリティを
 
MariaDB Platform vs. Competitors
MariaDB Platform vs. CompetitorsMariaDB Platform vs. Competitors
MariaDB Platform vs. Competitors
 
OpenWorks2019 - Using Pentaho/Tableau with MariaDB ColumnStore
OpenWorks2019 - Using Pentaho/Tableau with MariaDB ColumnStoreOpenWorks2019 - Using Pentaho/Tableau with MariaDB ColumnStore
OpenWorks2019 - Using Pentaho/Tableau with MariaDB ColumnStore
 
MariaDB TX 3.0 新機能 / ロードマップ
MariaDB TX 3.0 新機能 / ロードマップMariaDB TX 3.0 新機能 / ロードマップ
MariaDB TX 3.0 新機能 / ロードマップ
 
MariaDB AX ユースケース / ColumnStore 1.2 新機能
MariaDB AX ユースケース / ColumnStore 1.2 新機能MariaDB AX ユースケース / ColumnStore 1.2 新機能
MariaDB AX ユースケース / ColumnStore 1.2 新機能
 
Introduction of MariaDB 2017 09
Introduction of MariaDB 2017 09Introduction of MariaDB 2017 09
Introduction of MariaDB 2017 09
 
Introduction of MariaDB AX / TX
Introduction of MariaDB AX / TXIntroduction of MariaDB AX / TX
Introduction of MariaDB AX / TX
 

MariaDB 10.3 概要

  • 1. MariaDB 概要 MariaDB Server 10.3 新機能 2019-05-16 後藤 智 (GOTO Satoru) Customer Solutions Engineer
  • 2. MariaDB とは • MariaDBとは • MariaDBと他DBの違い • MariaDB Server 新機能 • MariaDB Server 顧客事例 • MariaDB ColumnStoreとは • MariaDB ColumnStore 顧客事例 • ClustrixDB とは Agenda
  • 4. EIB(European Investment Bank) $27M 出資 Alibaba $27M 出資 Microsoft : Platinum Sponsor 2017 2018 MariaDB最新動向 MammothDB 買収 Alibaba Cloud ApsaraDB RDS for MariaDB TX ServiceNow出資 / Clustrix買収 Azure Database for MariaDB : GA
  • 5. MariaDB releases Feb 2010 MariaDB 5.1 Nov 2010 MariaDB 5.2 Apr 2012 MariaDB 5.3 Feb 2012 MariaDB 5.5 Mar 2014 MariaDB 10.0 Oct 2015 MariaDB 10.1 May 2017 MariaDB 10.2.6 GA May 2018 MariaDB 10.3.7 GA Nov 2018 MariaDB 10.4.0 Alpha https://downloads.mariadb.org/mariadb/+releases/ https://github.com/MariaDB/server/releases
  • 6. 12 Million Users in 45 Countries Trust Critical Business Data to MariaDB Technology & InternetTelecom Retail & EcommerceTravel Financial Services Gvmt & Education Media & Social
  • 7. DB-Engines Ranking of Relational DBMS - May 2019 8位
  • 8. Customer and Use Cases • Multi-terabyte DB • 80M transactions / month • 50+ Node Cluster • Multi-billion rows • 600 Million reads/second • 250 servers, 600G + 1.5T archive • 10M travelers/quarter • 4M transactions/ month • ~14TB in MariaDB production clusters • Over 150 servers • 150-200k queries / sec on the MariaDB Cluster • 6TB and millions of Call Data Records • Over 60 TB • 70 million rows per day • 4 billion impressions per month • 3 to 10 TB • Over billion rows, most tables 100’s of millions of rows • Over 5 TB in Pay Per click application
  • 10.
  • 11. MariaDB Platform Transactional MariaDB Platform Analytical ● MariaDB Server ● MariaDB MaxScale ● database connectors ● services ● support ● tools ● MariaDB ColumnStore ● MariaDB MaxScale ● database connectors ● services ● support ● tools
  • 12. https://mariadb.com/pricing/ MariaDB Platform Subscription 9600 USD / インスタンス (日本語L1サポート不要の場合)
  • 14. Michael “Monty” Widenius The Soul of Open Source Founder & CTO of MariaDB MariaDB was created to preserve openness and community, so that we can push ahead faster with the capabilities for tomorrow’s applications. ” “
  • 16. MariaDB 独自機能/製品 • MariaDB ColumnStore • MariaDB Server 10.3+ : PL/SQL 互換 • ClustrixDB : 分散スケールアウトデータベース ただし現状オープンソースではない
  • 17. MariaDB MySQL EnterpriseDB (PostgreSQL) Oracle INTERSECT/EXCEPT Yes No Yes Yes User-defined aggregate functions Yes No Yes Yes Oracle 互換性: PL/SQL Yes No Proprietary Yes Oracle 互換性: SEQUENCE Yes No Proprietary Yes テンポラル・テーブル Yes No No Yes データ難読化/マスキング Yes No No Yes Instant ADD COLUMN Yes Yes No Yes INVISIBLE Column Yes No No Yes COMPRESSED Column Yes No No No 用途別 Storage Engine Yes No No No
  • 19. Primary/Replicas 非同期レプリケーション + MaxScale自動failover 1. Primary に障害 2. MaxScale MariaDB Monitor : master_down 検知 3. MaxScale : Slave を新しい Primaryに自動昇格 4. MaxScale : 新PrimaryにWriteクエリをルーティング *MaxScale is licenced under BSL 1.1 Primary/Replicas + Read/Write split routing 2 MaxScale
  • 20. MariaDB Galera Cluster Multi-Master Synchronous Replication Galera Cluster + Read/Write split routing MaxScale : 1ノードを”Master”として選択 Writeクエリは”Master”にのみルーティlング 全ノードがMasterのため,1ノードダウンしても MaxScaleが他ノードを新たな”Master”として選 定 *MaxScale is licenced under BSL 1.1 MaxScale
  • 22.
  • 23. 10.1 (GA) Multi-master Sync. Replication (Galera Cluster) Data-at-Rest Encryption Password Validation Page Compression Spatial References (GIS) 10.2 (GA) 10.3 (GA) Window Functions Common Table Expressions Check Constraints JSON & GeoJSON Functions Flashback (Point in Time Rollback) Mult-Trigger Support Delayed Replication Binary Log Compression Per User Resource Limits Virtual Column Indexes Sequences & PL/SQL (for migration from Oracle ) System Versioned Table Hidden Columns Instant ADD COLUMN Column compression Spider / MyRocks : GA User-defined Aggregate Functions Intersect & Except MariaDB Server 新機能
  • 24. MariaDB Server 新機能 ● 用途別ストレージエンジン(Purpose-built storage engine) ● スキーマ関連新機能(Schema evolution) ● テンポラルテーブル(Temporal Table) ● Oracle DBとの互換性(PL/SQL, SEQUENCE etc) ● セキュリティ向上
  • 27. Purpose-built storage: MyRocks SSD vs. HDD: • Pros – 高速 – 少消費電力 • Cons – 書込回数制限 – 高価
  • 28. Purpose-built storage: MyRocks Facebook におけるSSD利用上の課題: ● サーバ数/SSD数が膨大なためストレージ使用効率 要改善 ⇒ コスト削減 ● InnoDB : ストレージ使用効率に課題
  • 29. Purpose-built storage: MyRocks MyRocks introduction and production deployment - 松信 嘉範 様 https://www.slideshare.net/matsunobu/myrocks-introduction-and-production-deployment M|18 How to use MyRocks with MariaDB - Sergei Petrunia https://www.slideshare.net/MariaDB/m18-myrocks-in-mariadb Google Bigtable LevelDB (Google) MyRocks (Facebook) RocksDB (Facebook) MyRocks (MariaDB) Apache Hbase
  • 30. Purpose-built storage: MyRocks SSD に最適化: 高圧縮率, 書込回数抑制 Writeに特化: 読込は多少遅い Storage: primary key : 小メタデータ InnoDB: 13 bytes 非圧縮 MyRocks: 8 bytes + zero filling + prefix key encoding, compressed
  • 32. Purpose-built storage engine: Spider ● 透過的シャーディング ● スケーラビィティと並行性 a. パーティショニング (by range / key / hash / list) b. Pushdown (e.g., condition, index, join and aggregate) ● 高可用性と一貫性 a. Two-phase commit
  • 33. Database #1 Spider Table A Database #3Database #2 InnoDB Table A (Partition 2) InnoDB Table A (Partition 1) Rows: 1-500,000 Rows: 501,000-1,000,000
  • 34. Database #1 Spider Table A Database #3 Database #4Database #2 InnoDB Table A (Partition 2) InnoDB Table A (Partition 1) InnoDB Table A (Partition 3) Rows: 1-500,000 Rows: 501,000-1,000,000 Rows: 1,000,001-1,500,000
  • 35. Database #1 Spider Table A Database #3 Database #4Database #2 InnoDB Table A (Partition 2) InnoDB Table A (Partition 1) InnoDB Table A (Partition 3) Rows: 1-500,000 Rows: 501,000-1,000,000 Rows: 1,000,001-1,500,000 Database #5 Spider Table A
  • 36. Spider : customer use case Tencent Games ● 数千インスタンス規模で利用 ● Spiderの開発に貢献 ● MariaDB財団のスポンサー
  • 37. Microservices Database #1 InnoDB (mixed) Products table MyRocks (write-intensive) Orders table Order service Product service Spider (scalable) Cart table Cart service Database #2 InnoDB (mixed) Cart table Database #3 InnoDB (mixed) Cart table Database #4 InnoDB (mixed) Cart table Purpose-builtstorageengine
  • 38. Database #2-4 (large, medium-grade SSDs) Microservices Database #5-9 (medium, high-end HDDs) Database #1 (small, high-end SSD) InnoDB (mixed) Orders table (1 year) MyRocks (write-intensive) Order service Order history service Orders table (30 days) ColumnStore (analytical) Orders table (5 years) Order analytics service Replication Purpose-builtstorageengine
  • 39. Column Compression What’s new in MariaDB Server 10.3
  • 40. Schema evolution: row compression CREATE TABLE users ( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) ) ENGINE=innodb ROW_FORMAT=COMPRESSED; InnoDB only, buffer pool: compressed + uncompressed (redundant)
  • 41. Schema evolution: page compression CREATE TABLE users ( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) ) ENGINE=innodb PAGE_COMPRESSED=1; InnoDB only, buffer pool: uncompressed
  • 42. Schema evolution: column compression (New) CREATE TABLE users( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) COMPRESSED ); storage-engine independent
  • 43. Invisible(hidden) Columns What’s new in MariaDB Server 10.3
  • 44. Schema evolution: invisible columns CREATE TABLE users ( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) COMPRESSED, secret VARCHAR(20) INVISIBLE ); SQL Server = HIDDEN (period columns only) Db2 = IMPLICITLY HIDDEN Oracle = INVISIBLE
  • 45. Schema evolution: invisible columns CREATE TABLE users2 ( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) COMPRESSED, secret VARCHAR(20) INVISIBLE NOT NULL DEFAULT 'OOPS' ); SQL Server = HIDDEN (period columns only) Db2 = IMPLICITLY HIDDEN Oracle = INVISIBLE
  • 46. Invisible Columns : SELECT with * SELECT * FROM users; +----+---------+----------------------------------------+ | id | name | bio | +----+---------+----------------------------------------+ | 1 | Shane | Once deleted a table in production… | | 2 | William | Was caught listening to Spice Girls… | | 3 | Aneesh | Was with William listening to… | +----+---------+----------------------------------------+ secret 列 : 非表示(invisible)
  • 47. Invisible Columns: 明示的カラム指定 SELECT id, name, secret FROM users; +----+---------+-------------+ | id | name | secret | +----+---------+-------------+ | 1 | Shane | Gojira | | 2 | William | Spice Girls | | 3 | Aneesh | Maria Carey | +----+---------+-------------+ 明示的にカラム指定すると表示される
  • 48. INSTANT ADD COLUMN What’s new in MariaDB Server 10.3
  • 49. INSTANT ADD COLUMN ● 隠し(hidden)メタデータ・レコードを当該テーブルに追加 ● データ・ディクショナリ更新 ● INSERTより多少高コスト ● 既存のADD COLUMNと比較し,非常に高速 ● Sponsored by 制限事項 ● 最後列に追加(append) ● 全文検索 (FTS) インデックスがある場合使用不可 ● InnoDBで row compressionを使用している場合使用不可
  • 50. INSTANT ADD COLUMN の例 CREATE TABLE users( id INT PRIMARY KEY, name VARCHAR(50), bio TEXT(2000) COMPRESSED, secret VARCHAR(20) INVISIBLE ); ALTER TABLE users ADD COLUMN email VARCHAR(50), ALGORITHM=INSTANT; https://mariadb.com/kb/en/library/instant-add-column-for-innodb/
  • 51. INSTANT DROP COLUMN in MariaDB Server 10.4 https://jira.mariadb.org/browse/MDEV-15562
  • 53. テンポラル・テーブル : ユースケース • 監査: 時間を遡った追跡が可能 ● 過去の任意時点へのリカバリ ● 偶発的なデータ変更/削除や人為的エラー,アプリケ ーション エラーからの復旧
  • 54. テンポラル・テーブル CREATE TABLE cust_notifications ( cid INT, newsletter BOOLEAN, product_updates BOOLEAN, security_alerts BOOLEAN ) WITH SYSTEM VERSIONING; or ALTER TABLE cust_notifications ADD SYSTEM VERSIONING; (System Versioned Tables)
  • 55. テンポラルテーブルQuery : 全履歴 SELECT *, ROW_START, ROW_END FROM cust_notifications FOR SYSTEM_TIME ALL; cid newsletter product_updates security_alerts row_start row_end 1 FALSE FALSE TRUE 2018-03-30 2038-01-19 1 TRUE FALSE TRUE 2018-02-14 2018-03-29 1 FALSE FALSE TRUE 2018-01-01 2018-02-13 1 FALSE FALSE FALSE 2017-01-01 2017-12-31
  • 56. テンポラルテーブルQuery : 任意日時指定 SELECT * FROM cust_notifications FOR SYSTEM_TIME AS OF '2017-12-31' WHERE cid = 1; cid newsletter product_updates security_alerts 1 FALSE FALSE FALSE
  • 57. テンポラルテーブルQuery : 任意時間帯指定 SELECT * FROM cust_notifications FOR SYSTEM_TIME BETWEEN '2018-02-01' AND '2018-03-30' WHERE cid = 1; cid newsletter product_updates security_alerts 1 FALSE FALSE TRUE 1 TRUE FALSE TRUE BETWEEN includes the start and end
  • 58. テンポラルテーブルQuery : 任意時間帯指定 SELECT * FROM cust_notifications FOR SYSTEM_TIME FROM '2018-02-01' TO '2018-03-30' WHERE cid = 1; cid newsletter product_updates security_alerts 1 TRUE FALSE TRUE FROM includes the start, but not the end
  • 59. テンポラルテーブル: partitioning CREATE TABLE cust_notifications ( cid INT WITHOUT SYSTEM VERSIONING, status VARCHAR(10), newsletter BOOLEAN, product_updates BOOLEAN, security_alerts BOOLEAN ) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 YEAR ( PARTITION p_year_one HISTORY, PARTITION p_year_two HISTORY, PARTITION p_year_three HISTORY, PARTITION p_year_current CURRENT );
  • 60. テンポラルテーブル: データ変更履歴の削除 DELETE HISTORY FROM cust_notifications; DELETE HISTORY FROM cust_notifications BEFORE SYSTEM_TIME '2018-01-01'; ALTER TABLE cust_notifications DROP PARTITION p_year_three;
  • 61. Oracle 互換機能 What’s new in MariaDB Server 10.3
  • 62. MariaDB Server 10.3+ : SEQUENCE CREATE SEQUENCE seq_customer_id START WITH 100 INCREMENT BY 10; SELECT seq_customer_id.NEXTVAL; CREATE TABLE customers ( id INT DEFAULT seq_customer_id.NEXTVAL );
  • 63. PL/SQL 互換性 Data types: VARCHAR2, NUMBER, DATE, RAW, BLOB, CLOB Variable declarations: %TYPE Records: %ROW_TYPE Control statements: IF THEN, CASE WHEN, LOOP/END LOOP, WHILE Static SQL: CURRVAL, NEXTVAL Dynamic SQL: EXECUTE IMMEDIATE USING
  • 64. PL/SQL 互換性 Implicit cursors: SQL%ISOPEN, SQL%FOUND, SQL%NOTFOUND, SQL%ROWCOUNT Explicit cursors: CURSOR IS, FETCH INTO, parameters, FOR IN LOOP Blocks: DECLARE, BEGIN, EXCEPTION, WHEN THEN, END Stored procedures: CREATE OR REPLACE PROCEDURE IS|AS, OUT, IN OUT Functions: CREATE OR REPLACE FUNCTION AS|IS Triggers: CREATE OR REPLACE TRIGGER, BEFORE|AFTER, FOR EACH ROW, NEW, OLD Packages: CREATE PACKAGE, CREATE PACKAGE BODY
  • 67. MaxScale : データ難読化/マスキング SELECT name, ssn FROM employees WHERE id=1; // full data masking config "replace": {"column": "ssn"}, "with": {"fill": "XXX-XX-XXXX"} // partial data masking config "replace": {"column": "ssn", "match": "d{5}"}, "with": {"fill": "X"} // data obfuscation config "obfuscate": {column": "ssn"} name ssn Shane XXX-XX-XXXX name ssn Shane XXX-XX-1234 name ssn Shane dlkdj389ud https://mariadb.com/ja/resources/blog/maxscale-masking-filter/ Full data masking Partial data masking Obfuscation
  • 69. MariaDB 公式 Docker レポジトリ https://hub.docker.com/u/mariadb ● 新 MariaDB ロゴ ● New images ○ MariaDB Server ○ ColumnStore ○ MaxScale
  • 70. Docker, Inc. MariaDB Server image https://hub.docker.com/_/mariadb ● 古い MariaDB ロゴ ● MariaDB Server のみ ● Docker, Inc. がビルド
  • 71. その他 What’s new in MariaDB Server 10.3
  • 72. MariaDB Server: その他新機能 Encrypted temporary files User-defined aggregate functions Ordered-set aggregate functions (e.g., PERCENTILE_CONT) INTERSECT/EXCEPT Table value constructors DDL/SELECT lock timeout
  • 74. PL/SQL互換性: DBS Bank Singapore M|18 DBS Bank’s Journey with MariaDB https://www.slideshare.net/MariaDB/m18-dbs-banks-journey-with-mariadb DBSはシンガポールの銀行で、1968年にシンガポール政府により開発に対する融資機関 として設立された。DBS銀行は東南アジアにおいて資産において最も大きな銀行で、ア ジアの中でも大規模な銀行の1つである。
  • 75. Use Case : DBS Bank Singapore https://www.slideshare.net/MariaDB/m18-dbs-banks-journey-with-mariadb
  • 76. Use Case : DBS Bank Singapore
  • 78. Use case: ドワンゴ様 ● 課題 マイクロサービス化への対応のためデータベース運用効率化と安定的 運用 ● 解決策 MariaDB Galera Clusterによる新データベース基盤構築 ● 結果 ○ ダウンタイム大幅削減により安定した運用を実現 ○ データベース基盤集約化、運用コスト削減
  • 79. Download https://mariadb.com/downloads 1 Read the Technical overviews https://mariadb.com/resources/datasheets-guides 2 Knowledge Base https://mariadb.com/kb 3 Smart Style 様 TECH BLOG https://www.s-style.co.jp/blog 4 Get Started with MariaDB
  • 80. Contact us / Social Media
  • 81. MariaDB Japan LinkedIn Group https://www.linkedin.com/groups/12169417/
  • 87. MariaDB ColumnStoreとは クラウド/オンプレミス 双方で運用可 オープンソースOLAP 高データ圧縮率 分散データ分析 OLTP ストレージエンジン とのCross-Engine Join エンタープライズ セキュリティ/HA 容易な管理と スケーラビリティ 並列/分散クエリ 列指向に最適化 高データ圧縮率 高速, 高効率なクエリ データ分析を 簡単に 低コスト/高性能 DWHに適したスケーラブルな列指向分散データベース
  • 88. MariaDB ColumnStore Architecture Columnar Distributed Data Storage Local Storage | SAN | EBS | GlusterFS | Ceph BI Tool SQL Client Custom Big Data App Application MariaDB SQL Front End Distributed Query Engine Data Storage User Module (UM) Performance Module (PM)
  • 89. 行指向 vs. 列指向 • 行指向(InnoDB etc.) – 各行シーケンシャルにデータファイ ルに書込 – クエリ実行時すべての行をスキャン • 列指向(ColumnStore) – 各列個別データファイルにストア – クエリに関連する列のみスキャン ID Fname Lname State Zip Phone Age Sex 1 Bugs Bunny NY 11217 (718) 938-3235 34 M 2 Yosemite Sam CA 95389 (209) 375-6572 52 M 3 Daffy Duck NY 10013 (212) 227-1810 35 M 4 Elmer Fudd ME 04578 (207) 882-7323 43 M 5 Witch Hazel MA 01970 (978) 744-0991 57 F ID 1 2 3 4 5 Fname Bugs Yosemite Daffy Elmer Witch Lname Bunny Sam Duck Fudd Hazel State NY CA NY ME MA Zip 11217 95389 10013 04578 01970 Phone (718) 938-3235 (209) 375-6572 (212) 227-1810 (207) 882-7323 (978) 744-0991 Age 34 52 35 43 57 Sex M M M M F SELECT Fname FROM table1 WHERE State = 'NY'
  • 90. スケーラビリティ • MPP architecture – リニアなスケーラビリティ • 水平スケールアウト – PMノード追加によるスケールアウト – ノード追加作業中もReadクエリ実行可 Shared-Nothing Distributed Data Storage Compressed by default User Module (UM) Performance Module (PM) Data Storage
  • 91. ColumnStore ストレージアーキテクチャ • 列指向ストレージ – 各列は個別のファイルにストア – インデックス定義は不要 – オンラインでスキーマ変更可 • 自動水平partitioning (extent) – 8,000,000行ごとにパーティショニング – 各パーティションの最小/最大値をメタデータ として保持 – 手動パーティション管理は不要 • データ圧縮 – テーブルへの I/O を低減 Column 1 Extent 1 (8 million rows, 8MB~64MB) Extent 2 (8 million rows) Extent M (8 million rows) Column 2 Column 3 ... Column N Data automatically arranged by • Column – Acts as Vertical Partitioning • Extents – Acts as horizontal partition Vertical Partition Horizontal Partition ... Vertical Partition Vertical Partition Vertical Partition Horizontal Partition Horizontal Partition
  • 92. 高速データインポート(cpimport) • 高速な並列バルクロード – すべてのPMに対して並列ロード – 複数テーブルに対して同時にロード可 – Readクエリはデータロード中も実行可能 • ストリーミングデータロード(CDC) Column 1 Extent 1 (8 million rows, 8MB~64MB) Extent 2 (8 million rows) Extent M (8 million rows) Column 2 ... Column N Horizontal Partition ... Horizontal Partition Horizontal Partition High Water Mark New Data being loaded Dataaccessedby runningqueries
  • 93. Shared Nothing Distributed Data Storage SQL Column Primitives User Module Performance Module UM PM 高速なクエリ実行 • UM上のMariaDB Front Endでクエリ構文解析 • Storage Engine Plugin がクエリをPMに分散 • PM上で並列/分散しクエリ実行 • GROUP BY / aggregation関数をローカルデータに対 し実行 • PMから中間クエリ結果をUMに返す Massively parallel, distributed query processing, Shared nothing architecture Primitives ↓↓↓↓ Intermediate ↑↑Results↑↑
  • 94. Horizontal Partition: 8 Million Rows Extent 2 Horizontal Partition: 8 Million Rows Extent 3 Horizontal Partition: 8 Million Rows Extent 1 低I/Oストレージアーキテクチャ • クエリに関連する列にのみアクセス • クエリのWHERE/JOINに関連しない ブロックにアクセスしない Extent 1: Min State: CA, Max State: NY Extent 2: Min State: OR, Max State: WY Extent 3: Min State: IA, Max State: TN SELECT Fname FROM Table 1 WHERE State = ‘NY’ 高いクエリ性能 ID 1 2 3 4 ... 8M 8M+1 ... 16M 16M+1 ... 24M Fname Bugs Yosemite Daffy Hazel ... ... Jane ... Elmer Lname Bunny Sam Duck Fudd ... ... ... State NY CA NY ME ... MN WY TX OR ... VA TN IA NY ... PA Zip 11217 95389 10013 04578 ... ... ... Phone (718) 938-3235 (209) 375-6572 (212) 227-1810 (207) 882-7323 ... ... ... Age 34 52 35 43 ... ... ... Sex M M M F ... ... ... Vertical Partition Vertical Partition Vertical Partition Vertical Partition Vertical Partition … ELIMINATED PARTITION
  • 95. • Analytics – 複雑な join, aggregation(集約), Window関数 – UDF(ユーザ定義関数) – InnoDB等, 他ストレージエンジンとの Cross Engine Join • BI connectivity – Java, C/C++, ODBC connectorsによる既存BIツ ールとの連携 – e.g. Tableau (certified) Analytics Daily Running Average Revenue for each item SELECT item_id, server_date, daily_revenue, AVG(revenue) OVER (PARTITION BY item_id ORDER BY server_date RANGE INTERVAL '1' DAY PRECEDING ) running_avg FROM web_item_sales Item ID Server_date Revenue 1 02-01-2014 20,000.00 1 02-02-2014 5,001.00 2 02-01-2014 15,000.00 2 02-04-2014 34,029.00 2 02-05-2014 7,138.00 3 02-01-2014 17,250.00 3 02-03-2014 25,010.00 3 02-04-2014 21,034.00 3 02-05-2014 4,120.00 Running Average 20,000.00 12,500.50 15,000.00 34,209.00 20,583.50 17,250.00 250,100.00 12,577.00 20,583.50
  • 96. セキュリティ/HA • エンタープライズセキュリティ –SSL, Roleによりアクセス管理 • 柔軟なプラットフォーム選択 –オンプレミス –クラウド • 高可用性(HA) –自動UM フェールオーバ –自動PM フェールオーバ (EBS, GlusterFS等 分散ファイルシステムによる) Shared-Nothing Distributed Data Storage Compressed by default User Module (UM) Performance Module (PM) Data Storage
  • 98. MariaDB ColumnStore Customers MarTech Technology/Internet/IoTFinance Health Care Services Public Sector
  • 99. IHME - Institute of Health Metrics and Evaluation ● Use Case: ○ Public Health Data Analytics ● Competition: ○ Percona InnoDB, MemSQL ● Why ColumnStore: ○ InnoDB (Percona) reached performance limit w/ max tuning for 4 TB data ○ ColumnStore easy to use ● Data Volume: Started with 4.2 TB, with goal to go to 30TB of data in 5 years Wrong database/storage engine (MySQL InnoDB) for analytics use case Application Application Application Application Application http://www.healthdata.org/results/data-visualizations
  • 100. 日立製作所様 ● オンプレミス ● Tableau による定型レポート ● Pentaho Data Integration(PDI)上でGUIによるデータイ ンポート(1.2以降)
  • 101. MariaDB ColumnStore まとめ クラウド/オンプレミス に対応 オープンソースOLAP 高データ圧縮率 分散データ分析 OLTP ストレージエンジン とのCross-Engine Join エンタープライズ セキュリティ/HA 容易な管理と スケーラビリティ 並列/分散クエリ 列指向に最適化 高データ圧縮率 高速, 高効率なクエリ データ分析を 簡単に 低コスト/高性能
  • 103. ClustrixDBとは Applications アプリケーション変更は最小限に no Sharding no Replication アプリケーションからは MariaDB/MySQL サーバとして扱える Load Balancer Applications MariaDB/MySQL *ClustrixDB is NOT open sourced, a proprietary software
  • 105. ClustrixDB: スケールアウト, Fault-tolerant, MySQL互換 ClustrixDB ACID Compliant Transactions & Joins Optimized for OLTP Built-In Fault Tolerance Flex-Up and Flex-Down Minimal DB Admin Also runs great in the Data Center Built to run in the Cloud
  • 107. MariaDB ClustrixDB 9.1 documentation http://docs.clustrix.com/