Categories
Programmer's Mindset

Mysql Master / Slave Thoughts

I have been thinking about a way to have isolated machines that I can almost take on and off line very easily.  Here are my thoughts and would love feedback on my “solution”.

I am almost thinking about “spinning” the traditional model.  I will have my Administrative DB(ADB) in a central place.  ADB will be where I pull all reporting, master updates of product and pricing, all orders, etc….

On each individual web server I will have a slave DB (SDB) that will replicate all data from ADB.  The individual web servers will pull information from SDB for pricing, dynamic web pages, etc…  It will also have its own database (ODB) for writes (order information mainly, maybe other statistics as well).  When an order is placed (instead of trying to reach ADB) it will put the information into ODB.

Now I can have a cron job that will pull the data off each ODB to update ADB for reporting purposes.

Why?

  1. Each web server should be able to run without relying on any other machine.
  2. Once the web server’s SDB is up to date, there should be very little delays in price/product changes.
  3. Scalability, simply launch a new server to be up and running.

Does this make sense?
Web servers write to ODB
Administrative server reads from ODB to update itself which replicates to all the SDB (Every slave/web server becomes a realtime backup of ADB)

Here is a diagram of my thoughts.

DB Proof of Concept
DB Proof of Concept
Reblog this post [with Zemanta]

1 reply on “Mysql Master / Slave Thoughts”

Leave a Reply

Your email address will not be published. Required fields are marked *