Maria db replication

DataCoder 260 Reputation points
2024-12-10T07:59:32.31+00:00

Hey

I am trying to understand the theoretical aspects of replication in MariaDB. Specifically, I am curious about the following:

  1. What replication methods are supported in MariaDB?
  2. How does MariaDB ensure data consistency during replication, especially in cases of network failures or lag?
  3. Are there any differences between MariaDB's replication mechanism and MySql?

Could someone provide an overview of MariaDB's replication architecture and best practices for ensuring reliability and consistency in a production environment?

Thanks in advance

Azure Database for MariaDB
Azure Database for MariaDB
An Azure managed MariaDB database service for app development and deployment.
58 questions
0 comments No comments
{count} votes

Accepted answer
  1. NIKHILA NETHIKUNTA 4,020 Reputation points Microsoft Vendor
    2024-12-10T11:55:46.81+00:00

    @DataCoder
    Thank you for the question and for using Microsoft Q&A platform.

    In Azure Database for MariaDB, the primary replication method supported is read replicas. This allows you to create read-only copies of your database in the same or different regions, which can help distribute read traffic and improve performance.

    Regarding your second question, MariaDB ensures data consistency during replication by using a technique called "semi-synchronous replication." This means that before a transaction is committed on the master, at least one slave must acknowledge that it has received the transaction. If a network failure or lag occurs, the master will wait for the slave to acknowledge the transaction before committing it. This helps to ensure that the data on the slave is consistent with the data on the master.

    As for your third question, there are some differences between MariaDB's replication mechanism and MySQL's. For example, MariaDB supports multi-source replication, which allows a single slave to replicate from multiple masters. MariaDB also supports parallel replication, which can improve replication performance by allowing multiple transactions to be replicated simultaneously.

    In addition to the above provided documents you can also refer to the below links:
    https://learn.microsoft.com/en-us/previous-versions/azure/mariadb/howto-read-replicas-cli
    https://learn.microsoft.com/vi-vn/previous-versions/azure/mariadb/howto-data-in-replication
    https://mariadb.com/kb/en/mariadb-replication-overview-for-sql-server-users/

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 115.8K Reputation points MVP
    2024-12-10T11:21:54.61+00:00

    Hi @DataCoder ,

    there are 2 replication modes supported for MariaDB:

    Read replicas in Azure Database for MariaDB

    Replicate data into Azure Database for MariaDB

    Please be aware: Azure Database for MariaDB is on the retirement path, and Azure Database for MariaDB is scheduled for retirement by September 19, 2025**.**

    Source: What's happening to Azure Database for MariaDB?


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.