Move records to archive server?

2009-10-18 Thread Allen Fowler
Hello,

I have a Python application that is using MySQL to store records of 
transactions  about 3 tables with ~1k records each.

How can I periodically copy the records off the production on to an archive 
server?  I would like to this for two reasons:

1) To run data-mining queries on a copy of the live dataset without the risk of 
overloading the production server.
2) To maintain an addional set of historical tables that contain all the 
records the system has ever had, even after they are dropped from the live 
tables.

How should I go about doing this?

Thank you,
:)



  

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Queue / FIFO in MySQL?

2009-09-07 Thread Allen Fowler
Hello,

I need to create a system where records are generated by a producer process 
and processed by several worker processes.

I was thinking about something like:

Producer:
1) Producer INSERTs new records with state = new  worker = null
2) Producer sleeps and loops back to step #1

Worker(s):
1) Worker UPDATEs all records with worker = pid  state = working where 
state == new
2) Worker SELECTs all records where worker = pid  state = working
3) For each record that is done, worker updates record with state = done
4) Worker loops back to step #1

Note: In this scheme the worker winds up with all new records generated since 
the last worker claimed any. Not sure how else to guarantee atomicity. I would 
prefer only n records per request. Ideas?

I am sure something like this must have been before  Can anyone point me to 
example code, libraries, and/or refinements on the scheme?  (preferably using 
python...)

Thank you,
:)


  

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org