Choice - Best Stock Broker in India
  • About
  • App
  • Services
    Services
  • Research
  • Partners
  • Contact
  • Log In
  • Open Demat Account
  • Home
  • Blog
  • ...
  • MySQL - Master Slave Replication and It’s Impact
  • ...
    MySQL - Master Slave Replication and It’s Impact

MySQL - Master Slave Replication and It’s Impact

MySQL - Master Slave Replication and It’s Impact
  • Published Date: July 18, 2022
  • Updated Date: January 25, 2025
  • By Team Choice

What is Master Slave Replication ?

The MySQL replication process allows us to maintain multiple copies of MySQL data. So our Data Leakage and Loss issue will get resolved here. All data in the master server is synced to Slave servers in an automated process and we can easily promote Slave to a Master for commit operations.

The main role of replication is to spread read and write workloads across multiple servers for easy scalability and also we can use it for Real time Data backup purpose.

What is Master Slave Replication ?

Why we have implemented Master Slave Replication ?

Previously we had a single master database for LMS/ Onboarding which performs all the operations such as Read, Write , Delete operations and used by all our resources such as Dev team, IT Tech Support and Data analyst team to sync the Data in Zoho and available to our Business Team to read those data in real time and to manage the Analytics.

Due to heavily usage of Those data, and daily basis incremental leads/ on boarded clients in our system, our database usage was getting high (as multiple operations i.e. Read / Write at the same time) and our system goes down each time. It impacts our LMS and Onboarding system due to which our operation team work gets impacted.

Also we were not maintaining the real time database backup for our Both LMS and Onboarding system, so there were chances of Data loss in case of any of our LMS / on boarding server getting crashed.

In order to avoid this, we have initially implemented Master Slave Replication for LMS.

The main purpose to implement Master Slave Replication was :

  • Implement a real time backup process to achieve the Zero Data Leakage & Loss.
  • Slave server will be use to serve the data to Business / Operational / Internal Team (Only read access) which will distribute load on slave server and our master server performance will improvise.

What we have done for implementation ?

By default, replication is asynchronous and slaves do not need to be connected permanently to receive updates from the master. It is primarily used to read access on multiple servers for scalability and also used for fail over. Hence we have implemented this approach.

There are two more approach of Replication:

  • Synchronous

    In fully synchronous replication, when a source commits a transaction i.e when any new operation is triggered on source, all replica's have also committed the transaction before the source returns to the session that performed the transaction. In Fully synchronous replication, there might be chances of fail over from the source to any replica is possible at any time. The drawback of fully synchronous replication is that there might be a lot of delay to complete a transaction and it may impact on master server operations such as Insert / Update / Delete.

  • Semi-synchronous

    Semi-synchronous replication falls between asynchronous and fully synchronous replication. In this replication, the source waits until at least one replica has received and logged the events, and then commits the transaction in case we have multiple replica configurations. The source does not wait for all replicas to acknowledge receipt, and it requires only an acknowledgement from the replicas. Semi-synchronous replication therefore guarantees that if the source crashes, all the transactions that it has committed have been transmitted to at least one replica and this is the plus point of this replication.

Compared to asynchronous replication, semi-synchronous replication provides improved data integrity because there are no chances of data loss even if the source crashes, because when a commit returns successfully, it is known that the data exists in at least two places. Until a semi-synchronous source receives acknowledgment from the required number of replicas, the transaction is on hold and not committed.

But at the initial stage, our main focus was on Real time database backup, hence we have selected the asynchronous approach. We will keep this functionality under observation till the next 5 days. In between if we face any Data integrity related issues, we will plan for a Semi synchronous approach.

Action Plan :

  • Remove On boarding Instances (for e.g. 127.0.0.1 & 127.0.0.2) from LB to stop requests. (Purpose new request should not come to database)
  • Stop MySQL service.
  • Take backup of MySQL. (For rollback purpose)
  • Make necessary for replication in MySQL.
  • Start MySQL service
  • Add instances in LB.
  • Take a hot backup of MySQL. ( Tool Percona xtrabackup )
  • Sync backup date to slave. (for e.g. 127.0.0.3)
  • Initiate replication on slave.
  • Testing of all applications related to onboarding. (by development team)
  • Confirmation from development for BAU.

Roll back plan ( In case of replication failure) :

  • Remove Onboarding Instances (for e.g. 127.0.0.1 & 127.0.0.2) from LB to stop requests.
  • Stop MySQL service of (for e.g. 127.0.0.4).
  • Restore MySQL backup data to (for e.g. 127.0.0.4).
  • Start MySQL service.
  • Add instances in LB.
  • Testing of all applications related to onboarding. (by development team)
  • Confirmation from development for BAU.

What Was The Impact?

Before implementing Master-Slave Replication :

We hadn’t any real time database backup utility for LMS and Onboarding as well.

After implementing Master-Slave Replication :

We can easily use our Slave server to  use to serve the data to Business / Operational / Internal Team (Only read access) which will distribute load on slave server and our master server performance will improvise.

1.0 Master Server
1.1 Slave Server

         
If we compare both Master and Slave Server details, we are getting a same count for both tables in both server.

It means, we have achieved the Real time Database backup syncing using MySQL- Master Slave Replication.

Recommended for you

loading

Alan Scott Industries Ltd Right Issue 2025

loading

Lloyds Engineering Works Ltd Right Issue 2025

loading

Investing in India’s Defence Sector: A Strategic Opportunity Through Mutual Funds

loading

Dearness Allowance Hike Likely in July 2025: Here's What Central Government Employees Can Expect

Choice Financial Services
  • Services

  • Broking & Distribution
  • Wealth Planning
  • Insurance
  • Loans
  • Capital Advisory
  • Management Consultancy
  • Government Advisory
  • Tax Advisory
  • Company

  • Our Team
  • Investors
  • Calculator
  • Careers
  • Contact Us
  • Refer & Earn
  • FAQ’s
  • Resources

  • Fundamental
  • Technical
  • Blog
  • Pricing
  • Downloads
  • News & Media
  • Offer Document
  • Track Record
  • Investor Charter
  • Investor Grievances
  • Online KYC Updation
  • Quick Links

  • Open Demat Account
  • Corporate Demat Account
  • NRI Demat Account
  • Minor Demat Account
  • Lowest Brokerage
  • Investor Charter
  • Investor Awareness
  • Watchout Investors
  • Investor's Advisory
  • Disclaimer
  • CEBPL Policies & Disclosures
  • CFPL Policies & Disclosures
  • Sachet Portal
  • Direct Pay-in

Choice International Limited , Sunil Patodia Tower,
J B Nagar, Andheri(East),
Mumbai 400099.

Monday - Friday : 08:30 am - 7:00 pm
Saturday : 10:00 am - 4:00 pm

+91-88-2424-2424

care@choiceindia.com

Google Play
App StoreApp Store
  • Made with in India
  • Privacy Policy
  • Terms & Conditions

Choiceinternational. CIN - L67190MH1993PLC071117
Choice Equity Broking Private Limited: SEBI Reg No. Broking - INZ000160131 ( BSE - 3299 ) | ( NSE - 13773 ) | ( MSEI - 73200 ) | ( MCX - 40585 ) | ( NCDEX - 01006 ).
Depository Participant SEBI Reg. No. - IN - DP - 84 - 2015 , DP ID CDSL - 12066900 , NSDL ID - IN301895. Research Analyst - INH000000222
Choice Wealth Private Limited: AMFI - Registered Mutual Fund Distributor. Association of Mutual Funds in India Registration Number - ARN - 78908.
Initial Registration: 15th March 2010 Valid Till: 14th March 2027.
Pension Fund Regulatory and Development Authority (PFRDA) - POPSE52022022 | Affiliated with POP HDFC Pension Management Company.
Choice Finserv Private Limited: NBFC Registration Number : N - 13.02216

Choice Insurance Broking Private Limited: IRDAI License No: 167, License Valid Till: 29-05-2025 | Category : Direct ( Life & General )
Registered Office: Choice International Limited, Sunil Patodia Tower, J B Nagar, Andheri East, Mumbai, Maharashtra 400099.
For any Grievances / Queries email at ig@choiceindia.com & care@choiceindia.com | Online Dispute Resolution Link: https://smartodr.in/login

Cautionary Message :

  1. Sharing of trading credentials – login id & passwords including OTP’s:- Keep Your Password/Pin and OTP’s private & confidential to avoid any misuse or unauthorised trades. Please ensure that you do not share it with any one.
  2. Trading in leveraged products like options without proper understanding, which could lead to losses
  3. Writing / selling options or trading in option strategies based on tips, without basic knowledge & understanding of the product and its risks
  4. Dealing in unsolicited tips through Whatsapp, Telegram, YouTube, Facebook, SMS, calls, etc.
  5. Trading in “Options” based on recommendations from unauthorised / unregistered investment advisors and influencers

Disclaimer:
1. *Investments in securities market are subject to market risks, read all the related documents carefully before investing.
2. In addition to client based business, we are also doing proprietary trading.
3. Brokerage will not exceed the SEBI prescribed limit.

Research Disclaimer and Disclosure inter-alia as required under Securities and Exchange Board of India (Research Analysts) Regulations, 2014

Choice Equity Broking Private Limited (“CEBPL”) is a registered Research Analyst Entity (Reg. No. INH000000222 ) (hereinafter be referred as “CEBPL”). (CIN. NO.: U65999MH2010PTC198714).

Reg. Address: Sunil Patodia Tower, J B Nagar, Andheri(East), Mumbai 400099. Tel. No. 022-6707 9999 .

Compliance Officer: Mr.Prashant Salian. Tel. 022-67079999 - Ext-2310
Email- Prashant.salian@choiceindia.com

Grievance officer: Deepika Singhvi Tel.022-67079999- Ext-834.
Email- ig@choiceindia.com

Research Disclaimer: Investment in the securities market is subject to market risks. Read all the related documents carefully before investing. Registration granted by SEBI, and certification from NISM in no way guarantee performance of the intermediary or provide any assurance of returns to investors.

© Choice International Limited. All Rights Reserved.