Database master-Slave Architecture __ Database

Source: Internet
Author: User

This period of time, has been summing up the electronic business system related to the basic technology and architecture, wrote a lot of things. But still found a very important, very basic aspect has not mentioned, that is the database reads and writes separates the master and slave architecture. Perhaps after the development of large and mature companies, the master-slave architecture is outdated and replaced by a more complex database cluster. But as a small electric business company, the database master-slave architecture should be the most basic. Any large system architecture is evolving. Master-Slave architecture is the most basic architecture in database architecture. So after studying the master-slave architecture, we can understand the more complex architecture.

  first of all why to read and write separation.

For a small web site, may be a single database server can meet the requirements, but in some large web sites or applications, a single database server may be difficult to support the large access pressure, upgrade server performance, cost is too high, must be extended horizontally. There is, the library, read, write is to operate a database, the data is much, the database read, write performance will have a great impact. It is also a challenge for data security and system stability.

  the benefits of a database's read-write separation.

1. Separation of Read and write operations to different databases to avoid performance bottlenecks in the main server;

2. The primary server writes, does not affect query application Server query performance, reduce congestion, improve concurrency;

3. Data has a number of disaster recovery copies, improve data security, while the primary server failure, you can immediately switch to other servers, improve system availability;

The basic principle of read-write separation is to have the main database handle transactional add-and-remove operations (INSERT, UPDATE, delete) operations, and select query operations from the database. Database replication is used to synchronize changes caused by transactional operations to other databases. Take SQL as an example, the main library is responsible for writing data and reading data. The Read library is responsible for reading data only. Each time a write library operation, synchronization updates to the Read library. Write library on one, read library can have more than one, using log synchronization to implement the main library and multiple read library data synchronization.

  one: SQL Server read-write separate configuration

SQL Server provides three technologies that can be used to implement data synchronization between master and slave architectures: Log shipping, transactional replication, and the new functionality always on technology in SQL 2012. Their pros and cons, the specific everyone to Baidu Bar, here to provide a log shipping mode of data synchronization, address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.