SlideShare a Scribd company logo
MariaDB: 新 的 源大兴 开
数据引擎
Colin Charles, Team MariaDB, SkySQL Ab
colin@mariadb.org | http://mariadb.org/
http://bytebot.net/blog/ | @bytebot on Twitter
警察大数据 , 北京 , 中国
2014 年 6 月 11 日
我是谁
• 在 SkySQL Ab 进行 MariaDB 的工作
• 已与 Monty Program Ab 合并 , MariaDB 的创建者
• 原来的 MySQL AB (exit: Sun Microsystems)
• 过去的经历包括了 Fedora Project (FESCO),
OpenOffice.org
全球前 20 名网站
1. Google
2. Facebook
3. YouTube
4. Yahoo!
5. Baidu
6. Wikipedia
7. QQ
8. Taobao
9. Twitter
10. Live
11. LinkedIn
12. Sina
5W1H 是 MariaDB
• 嵌入式可兼容的 MySQL 替代品
• 社区开发 , 功能加强 , 向后兼容 , GPLv2 许可
• 4 年 4 个月稳定连续地发布 : 5.1, 5.2, 5.3, 5.5, 10.0, MariaDB
Galera Cluster 5.5, MariaDB 以及 TokuDB 5.5
• 企业功能开放 : PAM 认证插件 , 线程池 , 审计插件
• 默认红帽企业 Linux, Fedora, openSUSE, 等
为什么 MariaDB?
• MySQL 由 Oracle 所有 ; MariaDB 由 MariaDB 基金会支持
• 提供社区 , 存储引擎供应商,以及更多的运送和分配选择
• 固定的工程师组 - Oracle 拥有 MySQL 品牌 , MariaDB 拥有工
程师的智慧
• 生机勃勃的社区 : 40% SkySQL 组 MariaDB, 60% 社区贡献者
• 由 SkySQL 及其他相关组织提供支持
MariaDB 在中国
• 来自淘宝的贡献 ( 多重资源复制
, 在 I_S 里的内存使用 )
• 来自网易的贡献 (163.com)
• Feedback 插件展现了 MariaDB
的高使用率
MariaDB: 新兴的开源大数据引擎
Virtual Columns
• 一个表中的列的值自动通过预计算的 / 决定性的表达
方式或者表中其他字段的值来计算
• VIRTUAL - 当数据被查询时进行实时计算 ( 同 VIEW
一样 )
• PERSISTENT - 当数据被插入并储存在表中时进行计
算
MariaDB 5.2+
Virtual columns 例子
CREATE TABLE product (
->productname VARCHAR(25),
-> price_eur DOUBLE,
-> xrate DOUBLE,
-> price_cny DOUBLE AS (price_eur*xrate) VIRTUAL);
INSERT INTO product VALUES ('toothpaste', 1.5, 1.39, default);
INSERT into product VALUES ('shaving cream', 3.59, 1.39, default);
Virtual columns 例子 II
select * from product;
+---------------+-----------+-------+-------------------+
| productname | price_eur | xrate | price_cny |
+---------------+-----------+-------+-------------------+
| toothpaste | 1.5 | 1.39 | 2.085 |
| shaving cream | 3.59 | 1.39 | 4.990099999999999 |
+---------------+-----------+-------+-------------------+
2 rows in set (0.00 sec)
PCRE 常规表达方式
• 强大的 REGEXP/RLIKE 操作员
• 新操作员 :
• REGEXP_REPLACE(sub,pattern,replace)
• REGEXP_INSTR(sub,pattern)
• REGEXP_SUBSTR(sub,pattern)
• 与 MariaDB 支持的多字节字符集兼容,包含东亚字符集
MariaDB 10.0+
动态列
• 允许你用表中每一行动态的内容创建 virtual columns 。为每个项储存不
同的属性 ( 像一个网络商店 ).
• 本质上是一个 BLOB 处理功能 : COLUMN_CREATE, COLUMN_ADD,
COLUMN_GET, COLUMN_DELETE, COLUMN_EXISTS,
COLUMN_LIST, COLUMN_CHECK, COLUMN_JSON
• 在 MariaDB 10.0: 名称支持 ( 取代通过数字指向列,为他命名) , 转换
所有的动态列内容到 JSON 数组,与 Cassandra 对接
INSERT INTO tbl SET
dyncol_blob=COLUMN_CREATE("column_name", "value");
MariaDB 5.3+
全文检索
• SphinxSE 是还依赖于 Sphinx daemon 的存储引擎
• 它自己本身不储存任何数据
• 它只是一个内置客户端,允许 MariaDB 和 Sphinx
searchd 交流 , 运行查询 , 获得结果
• 索引 , 搜索都在 Sphinx 上进行
• Mroonga 用于 CJK 语言 10.1
MariaDB 5.2+
询问 Cassandra
• 数据被映射 : 行键 , 静态队列 , 动态队列
• 超级队列是不被支持的
• 没有数据类型的 1-1 直接映射
• 从 SQL 给 Cassandra 写 (SELECT, INSERT,
UPDATE, DELETE)
MariaDB 10.0+
典型使用案例
• 网页点击数据采集,数据流
• 传感器数据
• 通过查找表读取
• 想要一个自动复制的容错表?
连接
• 目标 : ETL 用于 BI 或分析
• 从 CSV, XML, ODBC, MS Access 等导入数据
• WHERE 状态推送到 ODBC 资源
• DROP TABLE 只移除存储的定义,而不是数据本身
• “Virtual” 表不能被索引
MariaDB 10.0+
SPIDER
• 水平分区 , 建立在 PARTITIONs 之上
• 将分区连接到远程服务器
• 对用户来说非常透明,容易展开
• 已启用在索引条件下推支持
MariaDB 10.0+
TokuDB
• 开源 - 分开的 MariaDB 5.5+TokuDB/ 一体化到
10.0.5
• 改进的插入 (10-20x 更快速 ) & 查询速度 , 压缩 ( 直
到 90% 空间减少 ), 复制性能和在线架构的灵活性
• 使用 Fractal Tree Indexes 代替 B-Tree
• 在多重平台上测试 & 创建 TokuDB
MariaDB 10.0+
线程池
• 由 5.1 修改而来 (libevent 基础 ), 对于绑定 CPU
的加载和短时间的查询运行非常有用
• Windows (threadpool), Linux (epoll), Solaris
(event ports), FreeBSD/OSX (kevents)
• 不会最小化有动态池大小的并发交易
• thread_handling=pool-of-threads
• https://mariadb.com/kb/en/thread-pool-in-mariadb-55/
MariaDB 5.5+
非阻塞用户端库
• 开始操作 , 在线程里工作 , 运行操作 , 结果返回
应用案例 : 争对单一服务器的多重查询 ( 是用更多的
CPUs); 争对多重服务器的查询 ( 许多机器上的
SHOW STATUS)
• https://mariadb.com/kb/en/about-non-blocking-operatio
• 快速的 node.js 驱动可用 : mariasql
MariaDB 5.5+
限制行测试
这个优化的目的是为了提供方法以结束 SELECT陈述的
执行,因为它测试了太多的行,以至于使用了太多的
资源。
• SELECT * from t1, t2 LIMIT 10 ROWS
EXAMINED 1000;
• https://mariadb.com/kb/en/limit-rows-examined/
MariaDB 5.5+
SQL 错误日志插件
• 日志上的错误被放在一个日志文档里发送给客户以供
事后的分析。日志文档可以被循环。(推荐)
• MYSQL_AUDIT_PLUGIN
install plugin SQL_ERROR_LOG soname
'sql_errlog.so';
MariaDB 5.5+
审计插件
• 日志服务器活动 - 谁连接到服务器 , 运行过什么查询
, 接触过什么表格 - 循环日志文档或者 syslogd
• 一个 MYSQL_AUDIT_PLUGIN
INSTALL PLUGIN server_audit SONAME
‘server_audit.so’;
MariaDB 10.0+
更好的复制
• 有选择性的跳过复制事件 ( 基于期数或在主机上或在从
属机上 )
• 复制变量的动态控制 ( 不用重启 !)
• 使用基于行的复制 ? 用 SQL 陈述注解二进制日志
• 从属机在二进制日志事件上执行总校验
• 平行复制
MariaDB 5.3+
更好的复制 II
• 在二进制日志中进行集体提交 - 最终 , sync_binlog=1,
innodb_flush_log_at_trx_commit=1 执行
• 通 持 的快照 制 始交易过 续 复 开
• mysqldump —single-transaction —master-data - full non-
blocking backup
• 从属机崩溃安全 ( 数据储存在交易表内部 )
• 多重来源复制 - ( 实时 ) 分析 , 数据分片供应 , 备份等
角色
•捆绑用户到一起 , 用类似的特权 - 依照 SQL 标准
CREATE ROLE audit_bean_counters;
GRANT SELECT ON accounts.* to
audit_bean_counters;
GRANT audit_bean_counters to ceo;
MariaDB 10.0+
MariaDB Galera Cluster
• MariaDB Galera Cluster 是为如今的云基础环境制作
的。它有完整的读 - 写扩展性,以及同步复制功能,
允许多主结构,并保证无延迟或丢失交易。
• 目前基于 5.5
• 10.0 正在测试中 ( 快要准备发布)
被以下公司所信任
• Google
• Wikipedia
• Tumblr
• KakaoTalk
• SK Telecom
• DAPA
• Paybox Services
• ERP5, Wendelin
包扩一个警察部门
(比利时)
MariaDB + Nooku 框架
https://mariadb.com/kb/en/
提问 & 解答
colin@mariadb.org | byte@bytebot.net
http://skysql.com/ | http://mariadb.org/
twitter: @bytebot | url: http://bytebot.net/blog/

More Related Content

What's hot (20)

PDF
分布式Key Value Store漫谈
Tim Y
 
PDF
Openstack nova
Yong Luo
 
PDF
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
PDF
MySQL优化、新特性和新架构 彭立勋
Lixun Peng
 
PDF
twMVC#38 How we migrate tfs to git(using azure dev ops)
twMVC
 
PPTX
MySQL压力测试经验
Jinrong Ye
 
PPT
Traffic server overview
qianshi
 
PPTX
Redis replication dcshi
dcshi
 
PDF
twMVC#43 YARP
twMVC
 
PDF
twMVC#36讓 Exceptionless 存管你的 Log
twMVC
 
PDF
天涯论坛的技术进化史-Qcon2011
Yiwei Ma
 
PDF
1号店数据库架构
Louis liu
 
PPTX
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
Xuefeng Zhang
 
PDF
Hacking Nginx at Taobao
Joshua Zhu
 
PPTX
MySQL和IO(下)
Feng Yu
 
PPTX
MySQL新技术探索与实践
Lixun Peng
 
PDF
twMVC#32應用 ASP.NET WebAPI2 Odata 建置高互動性 APIS
twMVC
 
PPTX
Azure Taiwan - Keep azure cost down (Azure 成本管控)
Alan Tsai
 
PDF
豆瓣数据架构实践
Xupeng Yun
 
PDF
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC
 
分布式Key Value Store漫谈
Tim Y
 
Openstack nova
Yong Luo
 
twMVC#44 讓我們用 k6 來進行壓測吧
twMVC
 
MySQL优化、新特性和新架构 彭立勋
Lixun Peng
 
twMVC#38 How we migrate tfs to git(using azure dev ops)
twMVC
 
MySQL压力测试经验
Jinrong Ye
 
Traffic server overview
qianshi
 
Redis replication dcshi
dcshi
 
twMVC#43 YARP
twMVC
 
twMVC#36讓 Exceptionless 存管你的 Log
twMVC
 
天涯论坛的技术进化史-Qcon2011
Yiwei Ma
 
1号店数据库架构
Louis liu
 
浅谈电商网站数据访问层(DAL)与 ORM 之适用性
Xuefeng Zhang
 
Hacking Nginx at Taobao
Joshua Zhu
 
MySQL和IO(下)
Feng Yu
 
MySQL新技术探索与实践
Lixun Peng
 
twMVC#32應用 ASP.NET WebAPI2 Odata 建置高互動性 APIS
twMVC
 
Azure Taiwan - Keep azure cost down (Azure 成本管控)
Alan Tsai
 
豆瓣数据架构实践
Xupeng Yun
 
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC
 

Viewers also liked (20)

PPTX
Big Data Security (ChinaNetCloud - Guiyang Conference)
ChinaNetCloud
 
PDF
Qcon2013 罗李 - hadoop在阿里
li luo
 
PPTX
A Discussion of Learning Analytics on Big Data 基于大数据的学习分析研究
CITE
 
PDF
企业PaaS助力数字化转型
Hardway Hou
 
PDF
BDTC2015 新浪微博-姜贵彬-大数据驱动下的微博社会化推荐
Jerry Wen
 
PDF
慧数据,联未来 -- 助力企业客户构建数据服务生态
Hardway Hou
 
PDF
大数据下的大表Join计算和优化
huhai463127310
 
PPTX
Tachyon 2015 08 China
Tachyon Nexus, Inc.
 
PPTX
Yisou intro
Song Hou
 
PPTX
BDTC2015 小米-大数据和小米金融
Jerry Wen
 
PDF
数字阅读推广与大数据
Shanghai Library
 
KEY
Data Journalism Training @ Southern Metropolis Daily, Guangdong, China
Yolanda Ma Jinxin
 
PPT
北大一智-教育大数据
Jim Chen
 
PDF
大数据人才招聘
杰丰 余
 
PDF
Silf2012lw3
Shanghai Library
 
PDF
Introduction to big data
邦宇 叶
 
PDF
Hadoop-分布式数据平台
Jacky Chi
 
PDF
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
Ye (Julia) Li
 
PDF
Bloomfilter
wanglei999
 
PDF
BDTC2015 数美时代-梁堃-sentry 金融实时风控系统
Jerry Wen
 
Big Data Security (ChinaNetCloud - Guiyang Conference)
ChinaNetCloud
 
Qcon2013 罗李 - hadoop在阿里
li luo
 
A Discussion of Learning Analytics on Big Data 基于大数据的学习分析研究
CITE
 
企业PaaS助力数字化转型
Hardway Hou
 
BDTC2015 新浪微博-姜贵彬-大数据驱动下的微博社会化推荐
Jerry Wen
 
慧数据,联未来 -- 助力企业客户构建数据服务生态
Hardway Hou
 
大数据下的大表Join计算和优化
huhai463127310
 
Tachyon 2015 08 China
Tachyon Nexus, Inc.
 
Yisou intro
Song Hou
 
BDTC2015 小米-大数据和小米金融
Jerry Wen
 
数字阅读推广与大数据
Shanghai Library
 
Data Journalism Training @ Southern Metropolis Daily, Guangdong, China
Yolanda Ma Jinxin
 
北大一智-教育大数据
Jim Chen
 
大数据人才招聘
杰丰 余
 
Silf2012lw3
Shanghai Library
 
Introduction to big data
邦宇 叶
 
Hadoop-分布式数据平台
Jacky Chi
 
大数据知识及技术简介(Introduction to basic concepts and techiques of big data in Chinese)
Ye (Julia) Li
 
Bloomfilter
wanglei999
 
BDTC2015 数美时代-梁堃-sentry 金融实时风控系统
Jerry Wen
 
Ad

Similar to MariaDB: 新兴的开源大数据引擎 (17)

PDF
Maria db新特性剖析 京东张金鹏
Cheng Feng
 
PPTX
Maria db新特性剖析 京东张金鹏
Cheng Feng
 
KEY
111030 gztechparty-小路-云时代的mysql
Zoom Quiet
 
PPTX
資料庫大小事
Jason Kuan
 
PPT
欢迎使用SQL Anywhere 11
zc_ncepu
 
DOC
1.基础篇 修改by徐定翔2 去掉批注
gavin shaw
 
PDF
D baa s_in_xiaomi
hdksky
 
PDF
My sql overview 2012 04-25 by scott chen - 30min - tw-1
Ivan Tu
 
PDF
改善Programmer生活的sql技能
Rack Lin
 
PDF
Mysql HandleSocket技术在SNS Feed存储中的应用
iammutex
 
PDF
Python 数据库技术第三讲
March Liu
 
PPT
第一讲 My sql初步
hjl888666
 
PPTX
開放原始碼 Ch2.4 app - oss - db (ver 1.0)
My own sweet home!
 
PDF
Why use MySQL
Zhaoyang Wang
 
PDF
我们的MySQL
Jinrong Ye
 
PDF
阿里集团MySQL特性(5.5介绍)
Hui Liu
 
PPTX
The Evolution of Data Systems
宇 傅
 
Maria db新特性剖析 京东张金鹏
Cheng Feng
 
Maria db新特性剖析 京东张金鹏
Cheng Feng
 
111030 gztechparty-小路-云时代的mysql
Zoom Quiet
 
資料庫大小事
Jason Kuan
 
欢迎使用SQL Anywhere 11
zc_ncepu
 
1.基础篇 修改by徐定翔2 去掉批注
gavin shaw
 
D baa s_in_xiaomi
hdksky
 
My sql overview 2012 04-25 by scott chen - 30min - tw-1
Ivan Tu
 
改善Programmer生活的sql技能
Rack Lin
 
Mysql HandleSocket技术在SNS Feed存储中的应用
iammutex
 
Python 数据库技术第三讲
March Liu
 
第一讲 My sql初步
hjl888666
 
開放原始碼 Ch2.4 app - oss - db (ver 1.0)
My own sweet home!
 
Why use MySQL
Zhaoyang Wang
 
我们的MySQL
Jinrong Ye
 
阿里集团MySQL特性(5.5介绍)
Hui Liu
 
The Evolution of Data Systems
宇 傅
 
Ad

More from Colin Charles (20)

PDF
Differences between MariaDB 10.3 & MySQL 8.0
Colin Charles
 
PDF
What is MariaDB Server 10.3?
Colin Charles
 
PDF
Databases in the hosted cloud
Colin Charles
 
PDF
MySQL features missing in MariaDB Server
Colin Charles
 
PDF
The MySQL ecosystem - understanding it, not running away from it!
Colin Charles
 
PDF
Databases in the Hosted Cloud
Colin Charles
 
PDF
Best practices for MySQL High Availability Tutorial
Colin Charles
 
PDF
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Colin Charles
 
PDF
Capacity planning for your data stores
Colin Charles
 
PDF
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
PDF
Lessons from {distributed,remote,virtual} communities and companies
Colin Charles
 
PDF
Forking Successfully - or is a branch better?
Colin Charles
 
PDF
MariaDB Server Compatibility with MySQL
Colin Charles
 
PDF
Securing your MySQL / MariaDB Server data
Colin Charles
 
PDF
The MySQL Server Ecosystem in 2016
Colin Charles
 
PDF
The Complete MariaDB Server tutorial
Colin Charles
 
PDF
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
PDF
Lessons from database failures
Colin Charles
 
Differences between MariaDB 10.3 & MySQL 8.0
Colin Charles
 
What is MariaDB Server 10.3?
Colin Charles
 
Databases in the hosted cloud
Colin Charles
 
MySQL features missing in MariaDB Server
Colin Charles
 
The MySQL ecosystem - understanding it, not running away from it!
Colin Charles
 
Databases in the Hosted Cloud
Colin Charles
 
Best practices for MySQL High Availability Tutorial
Colin Charles
 
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Colin Charles
 
Capacity planning for your data stores
Colin Charles
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
Lessons from {distributed,remote,virtual} communities and companies
Colin Charles
 
Forking Successfully - or is a branch better?
Colin Charles
 
MariaDB Server Compatibility with MySQL
Colin Charles
 
Securing your MySQL / MariaDB Server data
Colin Charles
 
The MySQL Server Ecosystem in 2016
Colin Charles
 
The Complete MariaDB Server tutorial
Colin Charles
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Colin Charles
 
Lessons from database failures
Colin Charles
 
Lessons from database failures
Colin Charles
 
Lessons from database failures
Colin Charles
 

MariaDB: 新兴的开源大数据引擎

  • 1. MariaDB: 新 的 源大兴 开 数据引擎 Colin Charles, Team MariaDB, SkySQL Ab [email protected] | http://mariadb.org/ http://bytebot.net/blog/ | @bytebot on Twitter 警察大数据 , 北京 , 中国 2014 年 6 月 11 日
  • 2. 我是谁 • 在 SkySQL Ab 进行 MariaDB 的工作 • 已与 Monty Program Ab 合并 , MariaDB 的创建者 • 原来的 MySQL AB (exit: Sun Microsystems) • 过去的经历包括了 Fedora Project (FESCO), OpenOffice.org
  • 3. 全球前 20 名网站 1. Google 2. Facebook 3. YouTube 4. Yahoo! 5. Baidu 6. Wikipedia 7. QQ 8. Taobao 9. Twitter 10. Live 11. LinkedIn 12. Sina
  • 4. 5W1H 是 MariaDB • 嵌入式可兼容的 MySQL 替代品 • 社区开发 , 功能加强 , 向后兼容 , GPLv2 许可 • 4 年 4 个月稳定连续地发布 : 5.1, 5.2, 5.3, 5.5, 10.0, MariaDB Galera Cluster 5.5, MariaDB 以及 TokuDB 5.5 • 企业功能开放 : PAM 认证插件 , 线程池 , 审计插件 • 默认红帽企业 Linux, Fedora, openSUSE, 等
  • 5. 为什么 MariaDB? • MySQL 由 Oracle 所有 ; MariaDB 由 MariaDB 基金会支持 • 提供社区 , 存储引擎供应商,以及更多的运送和分配选择 • 固定的工程师组 - Oracle 拥有 MySQL 品牌 , MariaDB 拥有工 程师的智慧 • 生机勃勃的社区 : 40% SkySQL 组 MariaDB, 60% 社区贡献者 • 由 SkySQL 及其他相关组织提供支持
  • 6. MariaDB 在中国 • 来自淘宝的贡献 ( 多重资源复制 , 在 I_S 里的内存使用 ) • 来自网易的贡献 (163.com) • Feedback 插件展现了 MariaDB 的高使用率
  • 8. Virtual Columns • 一个表中的列的值自动通过预计算的 / 决定性的表达 方式或者表中其他字段的值来计算 • VIRTUAL - 当数据被查询时进行实时计算 ( 同 VIEW 一样 ) • PERSISTENT - 当数据被插入并储存在表中时进行计 算 MariaDB 5.2+
  • 9. Virtual columns 例子 CREATE TABLE product ( ->productname VARCHAR(25), -> price_eur DOUBLE, -> xrate DOUBLE, -> price_cny DOUBLE AS (price_eur*xrate) VIRTUAL); INSERT INTO product VALUES ('toothpaste', 1.5, 1.39, default); INSERT into product VALUES ('shaving cream', 3.59, 1.39, default);
  • 10. Virtual columns 例子 II select * from product; +---------------+-----------+-------+-------------------+ | productname | price_eur | xrate | price_cny | +---------------+-----------+-------+-------------------+ | toothpaste | 1.5 | 1.39 | 2.085 | | shaving cream | 3.59 | 1.39 | 4.990099999999999 | +---------------+-----------+-------+-------------------+ 2 rows in set (0.00 sec)
  • 11. PCRE 常规表达方式 • 强大的 REGEXP/RLIKE 操作员 • 新操作员 : • REGEXP_REPLACE(sub,pattern,replace) • REGEXP_INSTR(sub,pattern) • REGEXP_SUBSTR(sub,pattern) • 与 MariaDB 支持的多字节字符集兼容,包含东亚字符集 MariaDB 10.0+
  • 12. 动态列 • 允许你用表中每一行动态的内容创建 virtual columns 。为每个项储存不 同的属性 ( 像一个网络商店 ). • 本质上是一个 BLOB 处理功能 : COLUMN_CREATE, COLUMN_ADD, COLUMN_GET, COLUMN_DELETE, COLUMN_EXISTS, COLUMN_LIST, COLUMN_CHECK, COLUMN_JSON • 在 MariaDB 10.0: 名称支持 ( 取代通过数字指向列,为他命名) , 转换 所有的动态列内容到 JSON 数组,与 Cassandra 对接 INSERT INTO tbl SET dyncol_blob=COLUMN_CREATE("column_name", "value"); MariaDB 5.3+
  • 13. 全文检索 • SphinxSE 是还依赖于 Sphinx daemon 的存储引擎 • 它自己本身不储存任何数据 • 它只是一个内置客户端,允许 MariaDB 和 Sphinx searchd 交流 , 运行查询 , 获得结果 • 索引 , 搜索都在 Sphinx 上进行 • Mroonga 用于 CJK 语言 10.1 MariaDB 5.2+
  • 14. 询问 Cassandra • 数据被映射 : 行键 , 静态队列 , 动态队列 • 超级队列是不被支持的 • 没有数据类型的 1-1 直接映射 • 从 SQL 给 Cassandra 写 (SELECT, INSERT, UPDATE, DELETE) MariaDB 10.0+
  • 15. 典型使用案例 • 网页点击数据采集,数据流 • 传感器数据 • 通过查找表读取 • 想要一个自动复制的容错表?
  • 16. 连接 • 目标 : ETL 用于 BI 或分析 • 从 CSV, XML, ODBC, MS Access 等导入数据 • WHERE 状态推送到 ODBC 资源 • DROP TABLE 只移除存储的定义,而不是数据本身 • “Virtual” 表不能被索引 MariaDB 10.0+
  • 17. SPIDER • 水平分区 , 建立在 PARTITIONs 之上 • 将分区连接到远程服务器 • 对用户来说非常透明,容易展开 • 已启用在索引条件下推支持 MariaDB 10.0+
  • 18. TokuDB • 开源 - 分开的 MariaDB 5.5+TokuDB/ 一体化到 10.0.5 • 改进的插入 (10-20x 更快速 ) & 查询速度 , 压缩 ( 直 到 90% 空间减少 ), 复制性能和在线架构的灵活性 • 使用 Fractal Tree Indexes 代替 B-Tree • 在多重平台上测试 & 创建 TokuDB MariaDB 10.0+
  • 19. 线程池 • 由 5.1 修改而来 (libevent 基础 ), 对于绑定 CPU 的加载和短时间的查询运行非常有用 • Windows (threadpool), Linux (epoll), Solaris (event ports), FreeBSD/OSX (kevents) • 不会最小化有动态池大小的并发交易 • thread_handling=pool-of-threads • https://mariadb.com/kb/en/thread-pool-in-mariadb-55/ MariaDB 5.5+
  • 20. 非阻塞用户端库 • 开始操作 , 在线程里工作 , 运行操作 , 结果返回 应用案例 : 争对单一服务器的多重查询 ( 是用更多的 CPUs); 争对多重服务器的查询 ( 许多机器上的 SHOW STATUS) • https://mariadb.com/kb/en/about-non-blocking-operatio • 快速的 node.js 驱动可用 : mariasql MariaDB 5.5+
  • 21. 限制行测试 这个优化的目的是为了提供方法以结束 SELECT陈述的 执行,因为它测试了太多的行,以至于使用了太多的 资源。 • SELECT * from t1, t2 LIMIT 10 ROWS EXAMINED 1000; • https://mariadb.com/kb/en/limit-rows-examined/ MariaDB 5.5+
  • 23. 审计插件 • 日志服务器活动 - 谁连接到服务器 , 运行过什么查询 , 接触过什么表格 - 循环日志文档或者 syslogd • 一个 MYSQL_AUDIT_PLUGIN INSTALL PLUGIN server_audit SONAME ‘server_audit.so’; MariaDB 10.0+
  • 24. 更好的复制 • 有选择性的跳过复制事件 ( 基于期数或在主机上或在从 属机上 ) • 复制变量的动态控制 ( 不用重启 !) • 使用基于行的复制 ? 用 SQL 陈述注解二进制日志 • 从属机在二进制日志事件上执行总校验 • 平行复制 MariaDB 5.3+
  • 25. 更好的复制 II • 在二进制日志中进行集体提交 - 最终 , sync_binlog=1, innodb_flush_log_at_trx_commit=1 执行 • 通 持 的快照 制 始交易过 续 复 开 • mysqldump —single-transaction —master-data - full non- blocking backup • 从属机崩溃安全 ( 数据储存在交易表内部 ) • 多重来源复制 - ( 实时 ) 分析 , 数据分片供应 , 备份等
  • 26. 角色 •捆绑用户到一起 , 用类似的特权 - 依照 SQL 标准 CREATE ROLE audit_bean_counters; GRANT SELECT ON accounts.* to audit_bean_counters; GRANT audit_bean_counters to ceo; MariaDB 10.0+
  • 27. MariaDB Galera Cluster • MariaDB Galera Cluster 是为如今的云基础环境制作 的。它有完整的读 - 写扩展性,以及同步复制功能, 允许多主结构,并保证无延迟或丢失交易。 • 目前基于 5.5 • 10.0 正在测试中 ( 快要准备发布)
  • 28. 被以下公司所信任 • Google • Wikipedia • Tumblr • KakaoTalk • SK Telecom • DAPA • Paybox Services • ERP5, Wendelin
  • 31. 提问 & 解答 [email protected] | [email protected] http://skysql.com/ | http://mariadb.org/ twitter: @bytebot | url: http://bytebot.net/blog/

Editor's Notes

  • #4: Powered by mysql++ Used by Wendelin too
  • #9: Not in 5.6; can assist in migrations from SQL Server/Oracle if its used PERSISTENT is like a materialized view to some extent PERSISTENT columns can be used in secondary indexes
  • #10: When INSERTing, you cannot leave out the virtual column from the list, and you cannot supply a value either - so use default
  • #11: You can now select the price in USD, and that column is computed on the fly, and you never need to know that the official price is fixed. However, you don’t do this in practice - computational logic should stay out of the database, in your app - db just for storage
  • #12: Perl Compatible Regular Expressions recursive patterns, named capture, look-ahead and look-behind assertions, non-capturing groups, non-greedy quantifiers, Unicode character properties, extended syntax for characters and character classes, multi-line matching East asian: big5, gbk, euckr, etc. mysql/previous mariadb is just 8-bit character sets
  • #13: Define & redefine number of columns + data types on a row-by-row basis w/o altering table config. max total length of packed dynamic column blob: 1gb (max_allowed_packet)
  • #14: use case: using myisam? port. use case: sphinx does sort, filtering, slicing of result; so you don’t need to use WHERE, ORDER BY, LIMIT <- sphinx is optimised better for this configuring sphinx is something you have to do, run it on another machine
  • #15: Install it join_cache_level=7 in my.cnf (join_cache_hashed is on in 10) Use cassandra 1.x, not 2.x - data model changes, authentication also (1.2 tested)
  • #17: OLTP not the target here indexing: reading from file system, OS, or another database engine_condition_pushdown = on (off by default)
  • #20: Many active threads are a performance killer, because increasing the number of threads leads to extensive context switching, bad locality for CPU caches, and increased contention for hot locks. Enable thread-pool (on Windows on by default). SHOW GLOBAL VARIABLES LIKE '%thread_pool%'; Limit the resources uses by threads (thread_pool_max_threads) We’re porting thread_pool_high_prio_mode=transactions (default) | statements from Percona Server
  • #21: works with mysql we also changed mytop to show progress reporting when you do an alter table or load data infile
  • #22: The server counts the number of read, inserted, modified, and deleted rows during query execution. This takes into account the use of temporary tables, and sorting for intermediate query operations. Once the counter exceeds the value specified in the LIMIT ROWS EXAMINED clause, query execution is terminated as soon as possible. Results may be incomplete
  • #24: Works for everything except a connection served by the query_cache - since no tables are opened
  • #26: Works with the binlog, possible to obtain the binlog position corresponding to a transactional snapshot of the database without blocking any other queries. - to provision a new slave
  • #27: 10.0.5 - google summer of code