数据库架构的技术方案演变史
SQL Server2008在数据的高安全、高性能、高可用方面的技术已经比较成熟,这些技术和方案都是随着很多公司的业务和数据访问压力的增加而不断的升级和变迁的,同时经历了方方面面的考验,证明了它们都是成熟可靠的,下面就这方面的技术方案和变迁过程来做一些
SQL Server2008在数据的高安全、高性能、高可用方面的技术已经比较成熟,这些技术和方案都是随着很多公司的业务和数据访问压力的增加而不断的升级和变迁的,同时经历了方方面面的考验,证明了它们都是成熟可靠的,下面就这方面的技术方案和变迁过程来做一些分析。
阶段一:
裸奔时代:
优点:裸奔最大的好处就是简单,成本低。
缺点:一旦服务器出现问题,恢复起来比较麻烦;如果访问压力变大,服务器可能不堪重负。
阶段二:
单库+Mirror+BackUp方案:
说明:Mirror有两种方式,同步和异步;同步方式能保证主库和Mirror端数据的一致性,而且不需要使用企业版,但是对主库的性能影响也比较大;异步方式需要企业版才支持,绝大部分时刻能保证数据的一致性,但是也有丢失小部分的数据可能,不过它主库的影响比较小。
优点:此方案对主库的数据提供了可靠的保护,一旦主库出现问题,从库能在比较短的时间内恢复,尤其是数据库很大时(从备份恢复需要的时间会很长),能尽快的恢复业务使用,而且Mirror端能生成快照,能给实时性要求不高的业务使用。
缺点:Mirror会影响主库的部分性能(异步方式影响比较小),主库出现问题后,前端需要更改访问的IP地址(或者将从服务器的IP地址改成主服务器的IP地址),还需要账号、权限和作业等信息迁移过去。
单库+Replication+ BackUp方案:
优点:Replication端可以提供给前端访问,可以将读操作放到从库,分担主库的部分压力,还能提供数据库的备份功能,不过这种备份很可能数据会有丢失。
缺点:不能提供安全的数据保护功能,对主库有一些性能影响。
阶段三:
单库+Replication+Mirror+BackUp方案:
优点:这种方案是前面两种方案的结合,既能够解决数据保护的问题,也能够提供读写分离的功能。
缺点:主库上既有Mirror又有Replication,这种方式对主库影响会比较大,而且实际证明,Mirror和Replication在同一台机器上部署,在一个出现问题时,会对另一个造成影响。
阶段四:
Cluster(双A)+BackUp方案:
说明:图中矩形部分代表存储,两台服务器做了双A的群集。
优点:Cluster能确保其中的一个服务器出现问题时所有的数据和服务能切换到另外一台机器,切换的时间很短,能尽快的恢复业务访问。
缺点:双A群集一般要求配置比较好,价格比较高;因数据都存放在存储上,所以群集不能保护数据,一旦数据或者存储出现问题,需要从备份中恢复数据;SQLServer的群集不能提供负载均衡的功能。
阶段五:
Cluster(双A)+Mirror+BackUp方案:
说明:双A群集再加两个服务器上库的Mirror保护。
优点:这个方案能对数据提供可靠的保护,无论是服务器故障还是存储故障,都能保证数据的安全,而且数据恢复的时间比较短。
缺点:Mirror会消耗主服务器的部分性能,多了两台Mirror机器,成本会增加,如果存储出现问题,快速恢复的方案是启用Mirror机器,后面可能需要重做群集。
阶段六:
Cluster(双A)+Mirror+BackUp+Replication+单分发方案:
说明:双A 群集,Mirror保护,单分发机器和读写分离方案。
优点:群集和Mirror能充分保护数据的安全,读写分离能提高系统整体的性能。
缺点:成本较高,单分发机存在单点故障,如果分发机器出现问题,将需要重建,此时读和写都将集中到主库,压力会比较大。
Cluster(双A)+Mirror+BackUp+Replication+双分发方案:
?
优点:与单分发机相比,没有单点故障,即使某台分发机出现问题,也能保证读写分离机制继续运行。
缺点:成本增加,维护方面更复杂。
阶段七:
Cluster(双A)+双存储+BackUp+Replication+双分发方案:
优点:双存储方案使得数据能得到有效的保护,而且避开了Mirror和Replication同时在主库运行对主服务器造成的影响,节省主服务器资源,而且恢复比较方便。
缺点:成本增加。
阶段八:
Cluster(双A)+双存储+BackUp+Replication+双分发+SSB异步方案:
此方式的主要优势是将数据流异步处理,缓解瞬时高流量主库的压力,因为此方案比较复杂,暂时不做说明。
阶段九:
拆分业务和数据、采用分布式数据库、使用能负载均衡集群功能的数据库等。
此文档大致描述了随公司的发展、服务器压力的增加,数据库架构方面的变迁阶段,当然我们应该根据公司的具体情况,选择性的采用其中的技术,也可能是直接跳过某些阶段,而上更高效的方案(如果成本能够接受),因此技术和方案的选择应该根据实际情况,灵活应对。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The learning curve of the Go framework architecture depends on familiarity with the Go language and back-end development and the complexity of the chosen framework: a good understanding of the basics of the Go language. It helps to have backend development experience. Frameworks that differ in complexity lead to differences in learning curves.

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

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

Written above & The author’s personal understanding is that image-based 3D reconstruction is a challenging task that involves inferring the 3D shape of an object or scene from a set of input images. Learning-based methods have attracted attention for their ability to directly estimate 3D shapes. This review paper focuses on state-of-the-art 3D reconstruction techniques, including generating novel, unseen views. An overview of recent developments in Gaussian splash methods is provided, including input types, model structures, output representations, and training strategies. Unresolved challenges and future directions are also discussed. Given the rapid progress in this field and the numerous opportunities to enhance 3D reconstruction methods, a thorough examination of the algorithm seems crucial. Therefore, this study provides a comprehensive overview of recent advances in Gaussian scattering. (Swipe your thumb up

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

1. Architecture of Llama3 In this series of articles, we implement llama3 from scratch. The overall architecture of Llama3: Picture the model parameters of Llama3: Let's take a look at the actual values of these parameters in the Llama3 model. Picture [1] Context window (context-window) When instantiating the LlaMa class, the variable max_seq_len defines context-window. There are other parameters in the class, but this parameter is most directly related to the transformer model. The max_seq_len here is 8K. Picture [2] Vocabulary-size and AttentionL

Written above & the author’s personal understanding: Recently, with the development and breakthroughs of deep learning technology, large-scale foundation models (Foundation Models) have achieved significant results in the fields of natural language processing and computer vision. The application of basic models in autonomous driving also has great development prospects, which can improve the understanding and reasoning of scenarios. Through pre-training on rich language and visual data, the basic model can understand and interpret various elements in autonomous driving scenarios and perform reasoning, providing language and action commands for driving decision-making and planning. The base model can be data augmented with an understanding of the driving scenario to provide those rare feasible features in long-tail distributions that are unlikely to be encountered during routine driving and data collection.

The GPT-4o model released by OpenAI is undoubtedly a huge breakthrough, especially in its ability to process multiple input media (text, audio, images) and generate corresponding output. This ability makes human-computer interaction more natural and intuitive, greatly improving the practicality and usability of AI. Several key highlights of GPT-4o include: high scalability, multimedia input and output, further improvements in natural language understanding capabilities, etc. 1. Cross-media input/output: GPT-4o+ can accept any combination of text, audio, and images as input and directly generate output from these media. This breaks the limitation of traditional AI models that only process a single input type, making human-computer interaction more flexible and diverse. This innovation helps power smart assistants
