转mysql存储引擎memory,ndb,innodb之选择
1
mysql的innodb和cluster的NDB引擎都支持事务,在有共同的特性外,也有不同之处:
以mysql cluster NDB 7.3和MySQL 5.6之InnoDB为例:
ndb7.3基于mysql5.6,包括支持innodb1.1,因此可以在cluster里使用innodb表,但这些表不是集群的。
MySQL Cluster NDB存储引擎用分布式, shared-nothing的架构实现,这使其和innodb有不少不同之处。比如事务、外键、表限制等,具体见下表:
Theseare shown in the following table:
|
Feature |
|
MySQLCluster |
|---|---|---|
|
MySQLServer Version |
5.6 |
5.6 |
|
|
|
|
|
MySQLCluster Version |
N/A |
|
|
StorageLimits |
64TB |
3TB (Practicalupper limit based on 48 data nodes with 64GB RAM each; can beincreased with disk-based data and BLOBs) |
|
ForeignKeys |
Yes |
Priorto MySQL Cluster NDB 7.3: No. (Ignored, as with Availablein MySQL Cluster NDB 7.3. |
|
Transactions |
Allstandard types |
|
|
MVCC |
Yes |
No |
|
DataCompression |
Yes |
No (MySQLCluster checkpoint and backup files can be compressed) |
|
LargeRow Support (> 14K) |
Supportedfor (Usingthese types to store very large amounts of data can lower MySQLCluster performance) |
|
|
ReplicationSupport |
Asynchronousand semisynchronous replication using MySQL Replication |
Automaticsynchronous replication within a MySQL Cluster. Asynchronousreplication between MySQL Clusters, using MySQL Replication |
|
Scaleoutfor Read Operations |
Yes(MySQL Replication) |
Yes(Automatic partitioning in MySQL Cluster; MySQL Replication) |
|
Scaleoutfor Write Operations |
Requiresapplication-level partitioning (sharding) |
Yes(Automatic partitioning in MySQL Cluster is transparent toapplications) |
|
HighAvailability (HA) |
Requiresadditional software |
Yes(Designed for 99.999% uptime) |
|
NodeFailure Recovery and Failover |
Requiresadditional software |
Automatic (Keyelement in MySQL Cluster architecture) |
|
Timefor Node Failure Recovery |
30seconds or longer |
Typically< 1 second |
|
Real-TimePerformance |
No |
Yes |
|
In-MemoryTables |
No |
Yes (Somedata can optionally be stored on disk; both in-memory and diskdata storage are durable) |
|
NoSQLAccess to Storage Engine |
Nativememcached interface in development (see the MySQL Dev ZonearticleMySQLCluster 7.2 (DMR2): NoSQL, Key/Value, Memcached) |
Yes MultipleAPIs, including Memcached, Node.js/JavaScript, Java, JPA, C++,and HTTP/REST |
|
Concurrentand Parallel Writes |
Notsupported |
Upto 48 writers, optimized for concurrent writes |
|
ConflictDetection and Resolution (Multiple Replication Masters) |
No |
Yes |
|
HashIndexes |
No |
Yes |
|
OnlineAddition of Nodes |
Read-onlyreplicas using MySQL Replication |
Yes(all node types) |
|
OnlineUpgrades |
No |
Yes |
|
OnlineSchema Modifications |
Yes,as part of MySQL 5.6. |
Yes. |
数据驱动型应用负载于innodb和NDB存储引擎之主要不同:
|
Workload |
MySQLCluster ( |
|
|---|---|---|
|
High-VolumeOLTP Applications |
Yes |
Yes |
|
DSSApplications (data marts, analytics) |
Yes |
Limited(Join operations across OLTP datasets not exceeding 3TB in size) |
|
CustomApplications |
Yes |
Yes |
|
PackagedApplications |
Yes |
Limited(should be mostly primary key access). MySQLCluster NDB 7.3 supports foreign keys. |
|
In-NetworkTelecoms Applications (HLR, HSS, SDP) |
No |
Yes |
|
SessionManagement and Caching |
Yes |
Yes |
|
E-CommerceApplications |
Yes |
Yes |
|
UserProfile Management, AAA Protocol |
Yes |
Yes |
这两种存储引擎适合的应用场景
|
Preferredapplication requirements for |
Preferredapplication requirements for |
|---|---|
|
|
2
如何选择memory存储引擎或mysql cluster:
When to Use MEMORY or MySQL Cluster.
Developers looking to deploy applications that use the MEMORY storage engine for important, highly available, or frequently updated data should consider whether MySQL Cluster is a better choice. A typical use case for the MEMORY engine involves these
characteristics:
• Operations involving transient, non-critical data such as session management or caching. When the MySQL server halts or restarts, the data in MEMORY tables is lost.
• In-memory storage for fast access and low latency. Data volume can fit entirely in memory without causing the operating system to swap out virtual memory pages.
• A read-only or read-mostly data access pattern (limited updates).
MySQL Cluster offers the same features as the MEMORY engine with higher performance levels, and provides additional features not available with MEMORY:
• Row-level locking and multiple-thread operation for low contention between clients.
• Scalability even with statement mixes that include writes.
• Optional disk-backed operation for data durability.
• Shared-nothing architecture and multiple-host operation with no single point of failure, enabling 99.999% availability.
• Automatic data distribution across nodes; application developers need not craft custom sharding or partitioning solutions.
• Support for variable-length data types (including BLOB and TEXT) not supported by MEMORY.
MEMORY存储引擎和MySQL Cluster的更多细节对比参见白皮书《Scaling Web Services with MySQL Cluster: An Alternative to the MySQL Memory Storage Engine》
Table 15.4 MEMORYStorage Engine Features
|
Storagelimits |
RAM |
Transactions |
No |
Lockinggranularity |
Table |
|
MVCC |
No |
Geospatialdata type support |
No |
Geospatialindexing support |
No |
|
B-treeindexes |
Yes |
T-treeindexes |
No |
Hashindexes |
Yes |
|
Full-textsearch indexes |
No |
Clusteredindexes |
No |
Datacaches |
N/A |
|
Indexcaches |
N/A |
Compresseddata |
No |
Encrypteddata[a] |
Yes |
|
Clusterdatabase support |
No |
Replicationsupport[b] |
Yes |
Foreignkey support |
No |
|
Backup/ point-in-time recovery[c] |
Yes |
Querycache support |
Yes |
Updatestatistics for data dictionary |
Yes |
|
[a]Implemented in the server (via encryption functions), ratherthan in the storage engine. [b]Implemented in the server, rather than in the storage engine. [c]Implemented in the server, rather than in the storage engine. |
|||||
3
myisam, memory, ndb, archive, innodb存储引擎功能汇总:
Table 15.1 StorageEngines Feature Summary
|
Feature |
MyISAM |
Memory |
InnoDB |
Archive |
NDB |
|---|---|---|---|---|---|
|
Storagelimits |
256TB |
RAM |
64TB |
None |
384EB |
|
Transactions |
No |
No |
Yes |
No |
Yes |
|
Lockinggranularity |
Table |
Table |
Row |
Table |
Row |
|
MVCC |
No |
No |
Yes |
No |
No |
|
Geospatialdata type support |
Yes |
No |
Yes |
Yes |
Yes |
|
Geospatialindexing support |
Yes |
No |
Yes[a] |
No |
No |
|
B-treeindexes |
Yes |
Yes |
Yes |
No |
No |
|
T-treeindexes |
No |
No |
No |
No |
Yes |
|
Hashindexes |
No |
Yes |
No[b] |
No |
Yes |
|
Full-textsearch indexes |
Yes |
No |
Yes[c] |
No |
No |
|
Clusteredindexes |
No |
No |
Yes |
No |
No |
|
Datacaches |
No |
N/A |
Yes |
No |
Yes |
|
Indexcaches |
Yes |
N/A |
Yes |
No |
Yes |
|
Compresseddata |
Yes[d] |
No |
Yes[e] |
Yes |
No |
|
Encrypteddata[f] |
Yes |
Yes |
Yes |
Yes |
Yes |
|
Clusterdatabase support |
No |
No |
No |
No |
Yes |
|
Replicationsupport[g] |
Yes |
Yes |
Yes |
Yes |
Yes |
|
Foreignkey support |
No |
No |
Yes |
No |
No |
|
Backup/ point-in-time recovery[h] |
Yes |
Yes |
Yes |
Yes |
Yes |
|
Querycache support |
Yes |
Yes |
Yes |
Yes |
Yes |
|
Updatestatistics for data dictionary |
Yes |
Yes |
Yes |
Yes |
Yes |
|
[a]InnoDB support for geospatial indexing is available in MySQL5.7.5 and higher. [b]InnoDB utilizes hash indexes internally for its AdaptiveHash Index feature. [c]InnoDB support for FULLTEXT indexes is available in MySQL5.6.4 and higher. [d]Compressed MyISAM tables are supported only when using thecompressed row format. Tables using the compressed row formatwith MyISAM are read only. [e]Compressed InnoDB tables require the InnoDB Barracuda fileformat. [f]Implemented in the server (via encryption functions), ratherthan in the storage engine. [g]Implemented in the server, rather than in the storageengine. [h]Implemented in the server, rather than in the storageengine. |
|||||
要选mysql cluster要根据ndb存储引擎的特征和应用场景做详细测试,安装简测见我的博文《centos65安装简测mysql cluster 7.3.7》http://blog.csdn.net/beiigang/article/details/43485585
参考
http://dev.mysql.com/doc/refman/5.6/en/mysql-cluster.html
-----------------
转载请著明出处:
blog.csdn.net/beiigang
转mysql存储引擎memory,ndb,innodb之选择的更多相关文章
- MySQL存储引擎 - Myisam和Innodb
Mysql有两种存储引擎:InnoDB与Myisam,下表是两种引擎的简单对比 MyISAM InnoDB 构成上的区别: 每个MyISAM在磁盘上存储成三个文件.第一个 文件的名字以表的名字开始 ...
- MySQL存储引擎MyISAM与InnoDB
一. MySQL存储引擎MyISAM与InnoDB如何选择 MySQL有多种存储引擎,每种存储引擎有各自的优缺点,可以择优选择使用:MyISAM.InnoDB.MERGE.MEMORY(HEAP).B ...
- MySQL存储引擎MyISAM和InnoDB,索引结构优缺点
MySQL存储引擎MyISAM和InnoDB底层索引结构 深入理解MySQL索引底层数据结构与算法 (各种索引结构优缺点) Myisam和Innodb索引实现的不同(存储结构) 存储引擎作用于什么对象 ...
- MySQL 存储引擎(MyISAM、InnoDB、NDBCluster)
前言 MySQL 的存储引擎可能是所有关系型数据库产品中最具有特色的了,不仅可以同时使用多种存储引擎,而且每种存储引擎和MySQL之间使用插件方式这种非常松的耦合关系. 由于各存储引擎功能特性差异较大 ...
- MySQL存储引擎MyISAM与InnoDB的优劣
使用MySQL当然会接触到MySQL的存储引擎,在新建数据库和新建数据表的时候都会看到. MySQL默认的存储引擎是MyISAM,其他常用的就是InnoDB了. 至于到底用哪种存储引擎比较好?这个问题 ...
- MySQL存储引擎MyISAM与InnoDB区别总结整理
在MySQL的 可重复读隔离级别 中,是解决了幻读的读问题的. 1. MySQL默认存储引擎的变迁 在MySQL 5.5之前的版本中,默认的搜索引擎是MyISAM,从MySQL 5.5之后的版本中,默 ...
- 170309、MySQL存储引擎MyISAM与InnoDB区别总结整理
1.MySQL默认存储引擎的变迁 在MySQL 5.1之前的版本中,默认的搜索引擎是MyISAM,从MySQL 5.5之后的版本中,默认的搜索引擎变更为InnoDB. 2.MyISAM与InnoDB存 ...
- MySQL存储引擎 -- MyISAM 与 InnoDB 实现
一.MyISAM索引实现MyISAM引擎使用B树作为索引结构,叶节点的data域存放的是数据记录的地址. MyISAM主键索引这里设表一共有三列,假设我们以Col1为主键,Col2为辅助索引.则下图是 ...
- MySQL存储引擎 -- MyISAM 与 InnoDB 理论对比
MySQL常用的两种存储引擎一个是MyISAM,另一个是InnoDB.两种存储引擎各有各的特点. 1. 区别:(1)事务处理:MyISAM是非事务安全型的.-----而非事务型的系统,一般也称为数据仓 ...
随机推荐
- 转: maven进阶:一个多模块项目
一个多模块项目通过一个父POM 引用一个或多个子模块来定义.父项目,通过以下配置,将子项目关联. <packaging>pom</packaging> <modules& ...
- 【BZOJ-3172】单词 AC自动机
3172: [Tjoi2013]单词 Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 2567 Solved: 1200[Submit][Status ...
- 破解受保护的excel中的密码
今天朋友给我发了一张excel表,她说不能删除数据,让我帮忙弄弄,我当时就觉得这张表应该是受到保护了,就在视图选项中准备撤销保护,但是却需要密码,后来在网上查找了 下资料,发现有个方法可以将密码破解出 ...
- Latex 笔记
A source file is made up of text, formulas, and instructions (commands) to $\LaTeX.$ Commands start ...
- UvaLive 5026 Building Roads
传送门 Time Limit: 3000MS Description There is a magic planet in the space. There is a magical country ...
- Looper
/** * Class used to run a message loop for a thread. Threads by default do * not have a message loop ...
- Win7下JDK环境变量的设置
JDK并不像Microsoft阵营vs那样智能,安装好后所有的东西都给你配置好了,我们还没需要手动配置很多东西 首先说为什么要配置JDK的环境变量在任何路径下识别java命令和java类 配置分为2个 ...
- include(thinkphp常用内置标签)
变量输出使用普通标签就足够了,但是要完成其他的控制.循环和判断功能,就需要借助模板引擎的标签库功能了,系统内置标签库的所有标签无需引入标签库即可直接使用. XML标签有两种,包括闭合标签和开放标签,一 ...
- git基础知识总结
1,clone git clone https://github.com/KoMiles/helloword helloword 2,pull git pull 3,commit git commit ...
- 我的电脑右下角的日期也不见了只剩下时间,Win7系统,请问是什么原因啊?
A:今天是2013/10/10,日期变为八位,宽度就不够了,把任务栏拉宽就好了 Q:win7 任务栏时间区可以拉宽吗?使之显示日期等 A:你的任务栏锁定了的,右键单击任务栏-锁定任务栏前面的勾去掉,鼠 ...