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
|
| Transactions |
Allstandard types |
|
| MVCC |
Yes |
No |
| DataCompression |
Yes |
No (MySQLCluster checkpoint and backup files can be compressed) |
| LargeRow Support (> 14K) |
Supportedfor |
Supportedfor
|
| 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. |
| 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 |
|---|