Dec 18, 2014 at 10:32 PM
Hello All,

I use foxpro for back-end data and logic for very long time now. Combined with Ajax, Javascript and CSS ... its so easy and so fast.
I have to be up and running 24/7's critical. I have so many users online all day long.

But now, I'm facing new challenge. How can I made a FAIL OVER system with foxpro ?

FAIL OVER system is a second computer with the same programs and same data . If the main system crash... the second computer take over in a minute .

I have history files as big as 1.5 gigabytes, for a total of 400 gigabytes of data changing each secound ... so copy over is out of question.

Anybody have experience with this ?

All suggestion are welcome

Dec 19, 2014 at 6:58 PM
  1. Create a folder in your server (let call it "syncq")
  2. Whenever you add, update or deletes a record in your main database, convert that row to JSON and save it as a text file in syncq folder with an unique name
  3. Insert a new row in a sync table like this:
    INSERT INTO syncQueue (stamp, operation, data, status) VALUES (DATETIME(), "ADD / UPD / DROP", cJSONData, "PENDING")
  4. Create a process that check the queue every 15s or so and reads any rows with status PENDING and perform the operation in the fail over database, marking the row as PROCESSED