List:Replication« Previous MessageNext Message »
From:Johan De Meersman Date:September 14 2010 6:12am
Subject:Re: Filtered data replication
View as plain text  
As far as I can remember (what'd I eat this morning again ?) there's no
possibility to stick a where-clause on a replication slave.

You could MAYBE (and depending on your mysql version) partition your
issue_table on the issue_from field, and use replicate-do-table to only
replicate the appropriate partition to the corresponding slave.

IF it works like that, it'll probably only work by using row-based
replication, not statement-based. The latter is however the default
configuration - read up on the doc for the caveats.

That configuration is, however, almost certainly not supported, to the point
that people will give you strange looks when you mention it, and keep their
children away from you.

Also, I have not actually tried this, so do set up a test environment :-)


Another option I thought of, is to partion and replicate, and switch the
useless partitions on each slave to the blackhole engine - but I strongly
suspect that the partitioning engine will throw a fit if you do.

On Tue, Sep 14, 2010 at 5:51 AM, Ritesh Nadhani <riteshn@stripped> wrote:

> Hello
>
> In a new system that we are working on, we have a table:
>
> 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_table
> ===============
> id, issue_from, details
> 1, machine1, "some details"
> 2, machine1, "some details again"
>
> slave2.issue_table
> =================
> 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. Basically, due to security and
> management decision, we would like to keep the data to the slaves
> sharded.
>
> Even a pointer to the right tutorial/document would be helpful.
>
> --
> Ritesh
>
> --
> MySQL Replication Mailing List
> For list archives: http://lists.mysql.com/replication
> To unsubscribe:
> http://lists.mysql.com/replication?unsub=1
>
>


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

Thread
Filtered data replicationRitesh Nadhani14 Sep
  • Re: Filtered data replicationJohan De Meersman14 Sep
    • Re: Filtered data replicationRitesh Nadhani14 Sep
      • Re: Filtered data replicationJohan De Meersman14 Sep
        • Re: Filtered data replicationRitesh Nadhani14 Sep
          • Re: Filtered data replicationJohan De Meersman14 Sep
            • RE: Filtered data replicationAndrew Morgan14 Sep
              • Re: Filtered data replicationRitesh Nadhani14 Sep
              • RE: Filtered data replicationAndrew Morgan14 Sep
                • Re: Filtered data replicationRitesh Nadhani14 Sep