On Tue, 2003-06-03 at 22:44, Ross Simpson wrote:
> Thanks for the reply.
> 
> I didn't explain properly :)
> 
> A diagram should help:
> 
>                        |--------|
> |-----|  1  |----|  2  | |--------|
> |stage| --> |prod| --> |-| |--------|
> |-----|     |----|       |-|replicas|
>                            |--------|
> 
> 'stage' is a staging mysql instance, where changes are made all the
> time.  When the data is ready for production, it needs to be pushed to
> 'prod', at which time it will be replicated out to all the slaves.  
> 
> Step 2 is covered by the answer to my previous question.
> 
> Step 1 is really my question.  My need is that somehow a table already
> existing on stage can be copied/replicated/etc over to prod, but _only_
> when requested, and then immediately.
> 

Run a MySQL replication chain from stage to prod to replicas.

On stage, prepare the data on shadow tables 
with different names to those used in prod.

Say, if your real tables are one, two, three, four, five
then create shadow tables one_shadow, two_shadow, three_shadow...

Once the data is ready in the shadow tables, do a rename:

rename table one to one_old, one_shadow to one, 
             two to two_old, two_shadow to two, ...

Replication will apply the rename to all your replicas 
and you should get a fairly snappy switchover.

The only drawback is that you have two copies of your tables,
which might be impractical depending on the amount of data involved.

regards,
Martin


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to