Database replication

Now that we have established why we are opting to use a relational database, let us move onto the next question: how can we ensure that our database doesn't become a single point of failure?

Let us first consider what are the consequences if a database fails:

  • We cannot write new data to the database
  • We cannot read from the database

Of the two consequences, the latter is more critical. Consider our blogging application, while being able to write new blog posts is important, the vast majority of the users on our site will be readers. This is the norm for most everyday user-facing applications. Hence, we should try to ensure that we are always able to read data from the database even if we are no longer able to write new data to it.

Database replication and redundancy try to address these issues and, generally, the solutions are included as part of the database or a plugin. In this section, we shall discuss three strategies used for database replication:

  • Master-replica replication
  • Master-master replication
  • Failover cluster replication
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.248.162