Câu hỏi phỏng vấn MySQL
Câu hỏi

What is master-slave replication ...

Câu trả lời

Master-slave replication in MySQL is a process that allows data from one MySQL database server (the master) to be copied automatically to one or more MySQL database servers (the slaves). This replication model is primarily used to enhance the scalability of database systems by distributing read access across multiple servers. It can also serve other purposes such as failover support, data backup, and analysis without overloading the master server[2].

The master database is used for all write operations, while read operations can be spread across the slave databases. This setup ensures that if the master database becomes unavailable, one of the slave databases can be promoted to become the new master, thereby minimizing downtime and ensuring data availability[2][3]. Additionally, master-slave replication can improve the performance of read-heavy applications by distributing the read load among multiple servers[3].

Advantages of Master-Slave Replication in MySQL include:

  1. Data Redundancy and Availability: By replicating data from the master to one or more slaves, master-slave replication ensures that there is a backup of the data. This redundancy helps in minimizing downtime and providing uninterrupted data access in case the master server fails[3].

  2. Improved Read Performance: Since read requests can be directed to the slave servers, the master server can focus on handling write operations. This separation of read and write operations can significantly enhance the read performance of the system, especially for applications with high read traffic[3].

  3. Disaster Recovery: In the event of a disaster affecting the master server, a slave server can be promoted to become the new master, facilitating quick data recovery and minimizing the impact of the disaster[3].

  4. Scalability: Master-slave replication allows for the easy addition of slave servers to scale the read capability of the database ...

senior

senior

Gợi ý câu hỏi phỏng vấn

middle

What happens if a parent row which is referenced by child row is being deleted in case of foreign key constraint?

junior

Explain foreign key constraint in MySQL

junior

What is self referencing foreign key? Give an example.

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào