4-1. MySQL의 복제
큰 데이터 볼륨 및 높은 쓰기 속도가 중요한 웹 응용 프로그램에 대한 MySQL의 확장에 관해, 복제 및 샤딩 (수평 분할)은 일반적으로 솔루션의 일부이다. Inno DB와 MySQL을 사용할 때, 복제를 비동기 또는 반 동기로 구성할 수 있다. 그리고 샤딩은 애플리케이션 계층에서 구현된다. 이 가이드의 다음 섹션(5번섹션)에서 논의될 MySQL 클러스터를 사용하여, 샤딩은 액티브-액티브와 다중 마스터 복제를 지원하는 데이터 베이스 계층에서 자동적으로 처리된다. 따라서 쓰기 처리량과 높은 수준의 가용성을 필요로하는 애플리케이션을 위한 대안 모델을 제공한다.
My SQL의 복제.
많은 응용 프로그램 확장성을 높이기 위한 방법 중 하나는 작업 부하를 분산하기 위해 여러 노드를 통해 데이터베이스를 복제하는 것이다. 10년 이상 복제는 선도적인 웹 요구사항에서 데이터베이스 확장성 및 고가용성의 극단적인 수준의 기초를 제공하며 MySQL의 표준과 통합을 제공해왔다.
복제(하나 또는 그 이상의 slave 인스턴스와 하나의 master 인스턴스로 구성)는 다른 하나의 인스턴스에서 변경 내용을 복사하는 것이 가능하다. 이는, 가용성과 확장성 모두를 높일 수 있고, MY SQL이 분산된 쿼리를 복제 클러스터에 거쳐 스케일 아웃을 가능하게 한다.
우리가 살펴본 바와 같이 MYSQL은 직접 복제성능, 데이터 무결성 및 가용성 등의 기능을 향상시킬 수 있는 새로운 기능을 포함한다.:
ㅇ 글로벌 트랜잭션은 노예 중 하나에 마스터 기능 장애 조치를 할 수 있게 만드는 복제 토폴로지 전체에 걸쳐 일관된 고유한 ID로 각각의 복제 트랜잭션을 구별한다. 또한 멀티 마스터 원형과 n계층 복제 토폴로지를 만든다.
ㅇ 멀티 스레드 슬라이브는 복제 적용을 위해 멀티 실행 스레드를 사용하며 퍼포먼스를 올리고, 슬레이브 서버에서 페러럴을 발생시킨다.
ㅇ 자동으로 오류를 복구하기 위해 자동 복구 slave 활성화한다.
ㅇ 자동 손상을 검출함으로써 슬레이브 데이터베이스의 무결성을 보호하는 체크섬 복제 이벤트 체크섬이 메모리나 디스크, 네트워크 때문에 발생한 것인지, 아니면 데이터베이스 자체가 문제인지 찾아낸다.
다른 핵심 기능은 행 기반 복제, 바이너리 로그 그룹 커밋, 시간 지연 복제와 원격 바이너리 로그 백업, 집합적 성능, 유연성 및 사용 용이성을 향상하는 것을 포함한다.
MySQL의 복제는 다양한 확장 및 HA 요구사항을 지원하는 토폴로지의 범위에 배포 할 수 있다. 이러한 옵션에 대해 자세한 내용 및 MYSQL의 복제를 구성하는 방법은 다음 백서를 참조:
http://www.mysql.com/why-mysql/white-papers/mysql-replication-introduction/
또한, MySQL의 Connect 2013 컨퍼런스에서 오라클은 "멀티 소스 복제"를 통해 사용할 수 있는 초기 액세스 기능을 발표했다. http://labs.mysql.com
멀티 소스 복제는 MYSQL 슬레이브 서버가 동시에 여러 통신 채널을 통해 트랜잭션을 받는 것을 도와준다. 당신은 그 내용을 볼 수 있다: http://on-mysql-replication.blogspot.fi/2013/09/feature-preview-mysql-multi-source-replication.html
by lee ji eun
출처: Mysql 공식 사이트 (http://mysql.com)
4-1. Scaling with MySQL Replication and Sharding
When it comes to scaling MySQL for highly demanding web applications with large data volumes and high write rates, replication and sharding (or horizontal partitioning) are typically part of the solution. When using the MySQL Database with InnoDB, replication can be configured asynchronously or semi-synchronously, and sharding is implemented at the application layer. Using MySQL Cluster, discussed in the next section of this guide, sharding is handled automatically at the database layer with support for active-active, multi-master replication, thereby providing an alternative model for applications requiring the highest levels of write throughput and availability.
MySQL Replication
One of the ways many new applications achieve scalability is via replicating databases across multiple commodity nodes in order to distribute the workload. For over ten years replication has been a standard and integrated component of MySQL, providing the foundation for extreme levels of database scalability and high availability in leading web properties, including some of the world’s most highly trafficked Web sites.
Replication enables MySQL to copy changes from one instance to another (i.e. from the “master” to one or more “slave” instances). This is used to increase both the availability and scalability of a database, enabling MySQL to scale-out beyond the capacity constraints of a single system by distributing queries across the replication cluster.
As we’ve seen, MySQL 5.6 includes a host of new capabilities that directly enhance replication performance, data integrity and availability, including:
Global Transaction Identifiers which tag each replicated transaction with a unique ID which is consistent across the entire replication topology, making it simple to failover the master function to one of the slaves, as well as create multi-master circular (ring) and n-tier (hierarchical) replication topologies
Multi-Threaded Slaves that improve performance by using multiple execution threads to apply replication events in parallel on slave servers
Crash-Safe Slaves which enable slaves to automatically recover from failures
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Replication Event Checksums that protect the integrity of slave databases by automatically detecting corruption whether caused by memory, disk or network failures, or by the database itself
Other key features include optimized row-based replication, binlog group commit, time-delayed replication and remote binlog backup, collectively enhancing performance, flexibility and ease of use.
MySQL replication can be deployed in a range of topologies to support diverse scaling and HA requirements. To learn more about these options and how to configure MySQL replication, refer to the following whitepaper:
http://www.mysql.com/why-mysql/white-papers/mysql-replication-introduction/
Additionally, during the MySQL Connect 2013 conference Oracle previewed “Multi-source replication” as an early access feature available through http://labs.mysql.com. Multi-source replication enables a MySQL slave server to receive transactions from several MySQL servers simultaneously via several communication channels. You can read more about it at: http://on-mysql-replication.blogspot.fi/2013/09/feature-preview-mysql-multi-source-replication.html
With the latest MySQL developments in scaling on multi-core commodity hardware and replication, millions of users can be serviced without requiring any database sharding at all, but let’s now consider MySQL sharding.