PHP MySQL and Queues, Table Locking, Reader/Writer Problem

milesmkd

New Member
I have following Scenario:\[code\]PHP(Server, Writer) ----> MySQL Database <------ PHP(Client, Reader/ Writer);\[/code\]
  • PHPS = PHP Server
  • PHPC = PHP Client
How it works?[*]PHPS writes data to temporary database tables (queue_*). [*]PHPC is triggered by a 1 hour cron.[*]PHPC starts, connects to database and caches all records locally (how? no idea, local mysql db? sqlite?) [*]PHPC executes tasks defined in those records one by one
  • if the task is successful it removes it from databases
  • if its unsuccessful it adds that record in database under a reports table.
How do i implement this such that
  • No half written records from PHPS get to PHPC.
  • PHPC can cache all records locally after one query to process them.
Any other ideas that you might have and share are highly appreciated.
 
Back
Top