34. DRBD DRBD (Distributed Replicated Block Device) is a solution from Linbit supported only on Linux. DRBD creates a virtual block device (which is associated with an underlying physical block device) that can be replicated from the primary server to a secondary server. .
不仅对数据进行了水平切分,还对数据进行了跨节点冗余 MySQL Cluster is designed not to have any single point of failure. In a shared-nothing system, each component is expected to have its own memory and disk, and the use of shared storage mechanisms such as network shares, network file systems, and SANs is not recommended or supported. MySQL Cluster is a synchronous solution that enables multiple MySQL instances to share database information. Unlike replication, data in a cluster can be read from or written to any node within the cluster, and information will be distributed to the other nodes. Advantages Offers multiple read and write nodes for data storage. Provides automatic failover between nodes. Only transaction information for the active node being used is lost in the event of a failure. Data on nodes is instantaneously distributed to the other data nodes. Disadvantages Available on a limited range of platforms. Nodes within a cluster should be connected via a LAN; geographically separate nodes are not supported. However, you can replicate from one cluster to another using MySQL Replication, although the replication in this case is still asynchronous. Recommended uses Applications that need very high availability, such as telecoms and banking. Applications that require an equal or higher number of writes compared to reads. Oracle RAC: share everyThing Mysql cluster: share nothing Oracle RAC relies on a "shared storage" architecture that requires an additional investment in SAN (Storage Area Network) infrastructure
The requirement for a SAN results in: An additional expense for customers since they have to turn to a 3rd party for a networked storage solution. A shared disk can cost $15k-20k in addition to the database license even for a small implementation. * Recovery from a failed node requires access to the shard-disk which increases time to failover to minutes vs. the sub-second failover time of MySQL Cluster. * A single point of failure in the cluster. Heartbeat, 平衡负载,自动路由, VIP Shared Nothing 结构 数据库被分区到集群的每个节点上。每个节点都有一个数据的唯一子集 ( 保存着所有数据的一部分),所有访问这些数据的都要到这个节点。数据并行操作的性能,取决于数据被合理的分区。每个分区被各自的处理器进行管理。 系统可以使用双磁盘子系统,保留一个物理备份,来防止某个节点错误影响系统可用性。不过此时依然会显著的降低整体性能。 “ shared-nothing” , 单打独斗 那么 Oracle RAC 就是通过把所有的数据库资源( databasefile,controlfile,logfile 等)共享出来,放到一个物理的存储介质中,并对其牢固可靠的保存,然后采用高端的连接技术将其与各 Instance 节点进行连接,达到 shared-everything 。 Orace 的 RAC 让磁盘可以被所有的节点链接。数据库文件在所有的节点间逻辑共享。每个实例都可以访问所有的数据。共享磁盘访问可以通过硬件链接或者操作系统层提供一个所有节点上设备的单一视图。如果多个节点同时链接相同的数据块,事务共享磁盘数据库系统使用磁盘 I/O 来同步多个节点的数据访问,比如通过一个写入块的锁来防止其他节点访问同样的数据块。 DB2 不是纯粹的 Shared_Nothing, 它为了可用性,使用了 Shared-Disk 的数据库,它的 Shared-Nothing 指的是在运行期间对数据的所有权,而不是物理上的关系。
MySQL Cluster normally partitions NDBCLUSTER tables automatically Horizontal Data Partitioning Data within NDB tables is automatically partitioned across all of the data nodes in the system. This is done based on a hashing algorithm based on the PRIMARY KEY on the table , and is transparent to the end application . In the 5.1 release, users can define their own partitioning schemes.
replicate asynchronously
Advantages Provides high availability and data integrity across two servers in the event of hardware or system failure. Can ensure data integrity by enforcing write consistency on the primary and secondary nodes. Disadvantages Only provides a method for duplicating data across the nodes. Secondary nodes cannot use the DRBD device while data is being replicated, and so the MySQL on the secondary node cannot be simultaneously active. Can not be used to scale performance, since you can not redirect reads to the secondary node. Recommended uses High availability situations where concurrent access to the data is not required, but instant access to the active data in the event of a system or hardware failure is required