Home Database Mysql Tutorial 五种MySQL数据库可靠性方案的分析和比较_MySQL

五种MySQL数据库可靠性方案的分析和比较_MySQL

Jun 01, 2016 pm 02:00 PM
Advantages and Disadvantages reliability database article

这篇文章主要从基本情况、成本、优缺点和应用场合等方面对5种MySQL的可靠性方案进行了详细的分析和比较,另外,本文对MySQL数据库的开发和管理有一定的借鉴作用。详细内容请大家参考下文:

  1、MySQL Clustering(ndb-cluster stogare)

  简介:

  MySQL公司以存储引擎方式提供的高可靠性方案,是事务安全的,实时复制数据,可用于需要高可靠性及负载均衡的场合。该方案至少需要三个节点服务器才能达到较好的效果。

  成本:

  节点服务器对RAM的需求很大,与数据库大小呈线性比例;

  最好使用千兆以太网络;

  还需要使用Dolphin公司提供的昂贵的SCI卡。

  优点:

  可用于负载均衡场合;

  可用于高可靠性场合;

  高伸缩性;

  真正的数据库冗余;

  容易维护。

  缺点:

  随着数据库的变大,对RAM的需求变得更大,因此成本很高;

  速度:

  几乎比典型的单独服务器(无千兆以太网,无SCI卡,存储引擎相关的限制少)慢10倍。

  应用场合:

  冗余,高可靠性,负载均衡

  2、MySQL / GFS-GNBD/ HA (Active/Passive)

  简介:

  如果多个MySQL服务器使用共享硬盘作为数据存储,此方案如何?

  GFS/GNBD可以提供所需的共享硬盘。

  GFS是事务安全的文件系统。同一时刻你可以让一个MySQL使用共享数据。

  成本:

  最多n台高性能服务器的成本,其中一个激活的,其他作为备份服务器。

  优点:

  高可靠性

  某种程度的冗余

  按照高可靠性进行伸缩

  缺点:

  没有负载均衡

  没有保证的冗余

  无法对写操作进行伸缩

  速度

  单独服务器的2倍。对读操作支持得较好。

  应用场合

  需要高可靠性的、读操作密集型的应用

  3、MySQL / DRBD / HA (Active/Passive)

  简介:

  如果多个MySQL服务器使用共享硬盘作为数据存储,此方案如何?

  DRBD可以提供这样的共享硬盘。DRBD可以被设置成事务安全的。

  同一时刻你可以让一个MySQL使用共享数据。

  成本:

  最多n台高性能服务器的成本,其中一个激活的,而其他则作为备份服务器。

  优点:

  高可靠性;

  一定程度的冗余;

  以高可靠性名义来看是可伸缩的。

  缺点:

  没有负载均衡

  没有保证的冗余

  在写负载方面没有伸缩性

  速度:

  在读写方面相当于单独服务器

  应用场合

  需要高可靠性、读操作密集型的应用

  4、MySQL Write Master / Multiple MySQL Read Slaves (Active/Active)

  简介:

  考虑不同的读、写DB数据库连接的情况。可以使用一台主服务器用于写操作,而采用n台从服务器用于读操作。

  成本:

  最多1台高性能写服务器,n台读服务器的成本

  优点:

  读操作的高可靠性;

  读操作的负载均衡;

  在读操作负载均衡方面是可伸缩的。

  缺点:

  无写操作的高可靠性;

  无写操作的负载均衡;

  在写操作方面无伸缩性;

  速度:

  同单独服务器;在读操作方面支持得较好

  应用场合

  读操作密集型的、需要高可靠性和负载均衡的应用。

  5、Standalone MySQL Servers(Functionally separated) (Active)

  多台功能分离的单独服务器,没有高可靠性、负载均衡能力,明显缺点太多,不予考虑。

  总结:

  MySQL官方网站推荐的HA方案是结合DRBD (本文中的方案3) 和 Replication (本文中的方案4)。假如再加上Linux Heartbeat还可实现Auto-failover功能,在此种情况下,我们会发现,down机时间会大大减少

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the advantages and disadvantages of templating? What are the advantages and disadvantages of templating? May 08, 2024 pm 03:51 PM

Templating: Pros and Cons Templating is a powerful programming technique that allows you to create reusable blocks of code. It offers a range of advantages, but also some disadvantages. Pros: Code Reusability: Templating allows you to create common code that can be reused throughout your application, reducing duplication and maintenance efforts. Consistency: Templating ensures that code snippets are implemented the same way in different locations, improving code consistency and readability. Maintainability: Changes to a template are reflected simultaneously in all code that uses it, simplifying maintenance and updates. Efficiency: Templating saves time and effort because you don't have to write the same code over and over again. Flexibility: Templating allows you to create configurable blocks of code that can be easily adapted to different application needs. shortcoming

What are the advantages and disadvantages of how Java Servlets work? What are the advantages and disadvantages of how Java Servlets work? Apr 16, 2024 pm 03:18 PM

JavaServlet is a Java class used to build dynamic web pages and serves as a bridge between client and server. Working principle: receive requests, initialize Servlet, process requests, generate responses and close Servlet. Pros: Portable, scalable, secure and easy to use. Disadvantages: Overhead, coupling, and state management. Practical case: Create a simple Servlet to display the "Hello, Servlet!" message.

Comparison of the advantages and disadvantages of PHP frameworks: Which one is better? Comparison of the advantages and disadvantages of PHP frameworks: Which one is better? Jun 04, 2024 pm 03:36 PM

The choice of PHP framework depends on project needs and developer skills: Laravel: rich in features and active community, but has a steep learning curve and high performance overhead. CodeIgniter: lightweight and easy to extend, but has limited functionality and less documentation. Symfony: Modular, strong community, but complex, performance issues. ZendFramework: enterprise-grade, stable and reliable, but bulky and expensive to license. Slim: micro-framework, fast, but with limited functionality and a steep learning curve.

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Reasons behind advantages and disadvantages of java framework Reasons behind advantages and disadvantages of java framework Jun 03, 2024 pm 04:50 PM

Java Framework Pros and Cons: Pros: Accelerated development Improved code quality Rich ecosystem Code reuse Cons: Performance overhead Complexity and learning curve Lack of flexibility Maintenance burden

See all articles