11-10-2009 12:42 AM - edited 11-10-2009 12:45 AM
I am designing a environmental monitoring software: the server vi collects continuous 1 hz serial data in a remote station, transmits the data via TCPIP, to a land office client vi that stores the data in MySQL.
The problem is the network link frequently breaks down for a day or two in the remote station, and I need to find a way to store the remote station data before connection is reestablished.
My design is like this, what is your thoughts : Beside the MySQL database in the land office, add another backup MySQL database in the remote station.
The serial data from the sensor is first stored in the remote station database. The remote station vi instead of sending the serial data directly via tcpip,
stores it first in the remote station MySQL database, then retrieves the data from the MysQL database, and send the retrieved data via tcpip.
When the TCPIP connection is lost, the remote station vi saves the time and date the connection is lost into a variable, and continues to store data
into the remote Mysql database. When the connection is reestablished, the remote station vi checks the time and date variable, retrieves the data from the
remote mysql database, starting from the date and time in the date and time varible, to present, and sends the data via tcpip to land office.
Is the above a standard design for this type of application, or is my design clunky in some way?
Advance thanks.
11-10-2009 01:22 AM
Hello Sunflower,
The approach looks perfectly fine (atleast for me)....
But one question have you managed to send the data to the server once the connection is broken? If yes then i do not any see any probles in this approach...(i usually use FTP to send the data once the connection is lost)
Regards
Guru
CLA
11-10-2009 02:59 AM
There are some options based on SQL (and on that topic my knownledge is very weak). If your remote station saves everything on it's own database, the land station could be configured as slave db (so the remote is the master db). Whenever the connection is open, the slave db will sync with the master db.
Felix