搜尋
首頁資料庫mysql教程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存

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

InnoDB1.1

MySQLClusterNDB 7.3, MySQL Cluster NDB7.4

MySQLServer Version

5.6

5.6

InnoDBVersion

InnoDB5.6.23

InnoDB5.6.23

MySQLCluster Version

N/A

NDB7.3.9

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 withMyISAM)

Availablein MySQL Cluster NDB 7.3.

Transactions

Allstandard types

READCOMMITTED

MVCC

Yes

No

DataCompression

Yes

No

(MySQLCluster checkpoint and backup files can be compressed)

LargeRow Support (> 14K)

SupportedforVARBINARY,VARCHAR,BLOB,andTEXTcolumns

SupportedforBLOBandTEXTcolumns only

(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

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

InnoDB

MySQLCluster (NDB)

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 forInnoDB

Preferredapplication requirements forNDB

  • Foreignkeys

    Note

    MySQLCluster NDB 7.3 supports foreign keys.

  • Fulltable scans

  • Verylarge databases, rows, or transactions

  • Transactionsother thanREADCOMMITTED

  • Writescaling

  • 99.999%uptime

  • Onlineaddition of nodes and online schema operations

  • MultipleSQL and NoSQL APIs (seeMySQLCluster APIs: Overview and Concepts)

  • Real-timeperformance

  • Limiteduse ofBLOBcolumns

  • Foreignkeys are supported, although their use may have an impact onperformance at high throughput



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 <strong>MEMORY</strong>Storage 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



陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
图文详解mysql架构原理图文详解mysql架构原理May 17, 2022 pm 05:54 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于架构原理的相关内容,MySQL Server架构自顶向下大致可以分网络连接层、服务层、存储引擎层和系统文件层,下面一起来看一下,希望对大家有帮助。

mysql的msi与zip版本有什么区别mysql的msi与zip版本有什么区别May 16, 2022 pm 04:33 PM

mysql的msi与zip版本的区别:1、zip包含的安装程序是一种主动安装,而msi包含的是被installer所用的安装文件以提交请求的方式安装;2、zip是一种数据压缩和文档存储的文件格式,msi是微软格式的安装包。

mysql怎么去掉第一个字符mysql怎么去掉第一个字符May 19, 2022 am 10:21 AM

方法:1、利用right函数,语法为“update 表名 set 指定字段 = right(指定字段, length(指定字段)-1)...”;2、利用substring函数,语法为“select substring(指定字段,2)..”。

mysql怎么替换换行符mysql怎么替换换行符Apr 18, 2022 pm 03:14 PM

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

mysql怎么将varchar转换为int类型mysql怎么将varchar转换为int类型May 12, 2022 pm 04:51 PM

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

MySQL复制技术之异步复制和半同步复制MySQL复制技术之异步复制和半同步复制Apr 25, 2022 pm 07:21 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

mysql怎么判断是否是数字类型mysql怎么判断是否是数字类型May 16, 2022 am 10:09 AM

在mysql中,可以利用REGEXP运算符判断数据是否是数字类型,语法为“String REGEXP '[^0-9.]'”;该运算符是正则表达式的缩写,若数据字符中含有数字时,返回的结果是true,反之返回的结果是false。

带你把MySQL索引吃透了带你把MySQL索引吃透了Apr 22, 2022 am 11:48 AM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境