Master - Slave Replication on specific rows of table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kashifayyaz
    New Member
    • Nov 2013
    • 1

    Master - Slave Replication on specific rows of table

    I am a not an expert in MySQL world and looking for a solution like

    I have a table for example:

    issue_table
    =============
    id, issue_from, details
    1, machine1, "some details"
    2, machine1, "some details again"
    3, machine2, "some details"
    4, machine2, "some details"

    Is it possible to setup a master slave replication where, where I can
    filter what data goes to which slave? In simple terms, after
    replication I would like something like:

    slave1.issue_ta ble
    ===============
    id, issue_from, details
    1, machine1, "some details"
    2, machine1, "some details again"

    slave2.issue_ta ble
    =============== ==
    id, issue_from, details
    3, machine2, "some details"
    4, machine2, "some details"

    Is replication the right tool to do this kind of work? Or there is a
    better design to handle such problems.
    I have read something that it is possible only by partitioning the table in the older versions of MySQL.
    Is there any advancement in latest versions of MySQL ( 5.6 or 5.7 ) for such kind of replication.

    Even a pointer to the right tutorial/document would be helpful.
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2432

    #2
    Replication will replicate all of the data. Master / Slave are basically full copies.

    What you are talking about is more like sharding or partitioning. Where the data is stored across multiple machines. The best way to shard is to do in the application code.


    MySQL offers partitioning built in. Here is more information


    There info there on how to find out if your db supports partitioning
    niheel @ bytes

    Comment

    Working...