If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Collecting & storing data prior to interacting with MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-25-12, 21:19
Robertst1 Robertst1 is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Collecting & storing data prior to interacting with MySQL

Looking for recommendations regarding the following situation:

We are developing an attendance system for an institution using PHP and MySQL. Due to limitations in the institution's LAN, we are required to collect and store the attendance data (barcode, name, entry time, etc.) at each location where attendance is taken.

Each remote location has one or more computers with barcode readers attached. Users scan their barcode twice a day. We need to store the daily attendance results at each location for transmittal overnight to the MySQL database located at the institution's data center at 2 AM.

When the remote computers interface with the db to upload fresh attendance data, they also need to download any changes in the user table (new users, new usernames, etc.)

What do you recommend for the most efficient temporary storage of and access to the attendance data: MySQL on each remote computer or a flat db on each computer, Excel, csv file, or . . . ?

Thank you for your response and don't hesitate to ask for more clarification if needed.
Reply With Quote
  #2 (permalink)  
Old 01-26-12, 04:45
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
if you don't need to access the data between data capture and uploading the just write it to flat files. whether you choose to do that as terse minimalist csv or human readable is up to you. a potential advantage of writing it in a human readable format is that it coudl easily become part of a formal legalistic document set if the attendance is going to be used for disciplinary purposes. if you make the directory where you write the files to be read only for approved users with only one user allowed to create files (the applications capturing the data), no users allowed to edit or delete files with te exception say of sys admin or a named useraccount then you have the beginnings of a good audit trail.

if a file goes missing in the update its still sitting on whatever device the data capture was recorded in.

heck if you wanted to you could write two flat files, one with minmialist 'terse' just the data, one formatted.

as to your batch processes that dependzs on what computers you are running the data capture on. I'd do it as a timed process (windows scheduler or cron) that pumped the data up the line well before the 02:00 deadline into a single directory that your applciationt hat stuffs the data into MySQL knows about. file naming would be important (probably could do that by creatign the file name out of the computer name, date or date and time if you coudl have multiple files from on device in any one day.

can't see why you'd need to transfer user ids back to the data capture computers, unless you feel the need to validate a card swipe. personally I'd jsut record the barcode, make certain its the right type for the application and validate on trying to pump ther data into the MySQL db. bear in mind the barcode itself should have enough validation around it to ensure the correct value is scanned.

as to how your MySQL process runs thats up to you. but I fit were me I'd accept all data into a holding table in the db. then draw valid data from the holding table into the system proper leaving the unvaildated data in that holding tank for manual processing, or split the incoming data into valid (straight to system), and invalid straight to holding table. build in some form of audit trail withint he db so that you know what happened to a specific record so it can be traced back to a specific batch.. that means not deleting data. again if this data is used for legalistic purposes you need to think about the security implications

Im nto certain Id want to use barcodes if this is legailstic as barcodes are easy to fake. the fact that someone wafted a barcode in front of a scanner doesn't neccessarily prove that they have attended (it could be cloned card, it could be someone impersonating the individual. RFID chips are trickier to fake.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-26-12, 07:19
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
Have a look at using replication server. If you have local copies of the MySQL databases then replication server will look after synchronization for you.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #4 (permalink)  
Old 01-26-12, 07:27
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
do you really want to suggest using a replication server model for datacapture of attendance records?

assuming that the OP is referring to a real world application as opposed to a piece of academic coursework........
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 01-26-12, 07:41
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
Yes I would suggest using replication as this is exactly what it is designed to do, to synchronize data between databases. You can of course run jobs that extract records and synchronize the data through a set of jobs but replication handles all of this for you.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #6 (permalink)  
Old 01-26-12, 16:18
Robertst1 Robertst1 is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Thanks to responders

thank you for your recommendations
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On