I'm building an attendance system. There are about 20 places where people will check in and check out using a MIFARE 1K card. It will use MySQL as the database. The system will display something like "#ID IN: 800AM" the first time the user checks in and "#ID OUT: 400PM" when the user checks out. For this to work, all the databases need to be synchronized with each other all the times.
For an example, if user A went to location #1 to check in but by the time the user wants to return home, the server at location #1 went down, the user needs to go to location #2 or the nearest server to check out. The server at location #2 should display '#ID OUT: 400PM" and not "#ID IN: 400PM" since the user is already checked in.
So, what should I use to ensure this idea will work? My main concern is with the network (other department manages it) which is very unpredictable. It just love to go down anytime it wants to.
LOL, I didn't realize my question was not clear. I just noticed it when it was pointed out, sorry about that.
My real question is, how can I configure my MySQL to be synchronized with each other (20 servers)? MySQL cluster? (I tried reading about it, but I'm not sure if it's the right thing to do.)
My current setup (first phase):
- Local database for each server
- OS: Slackware
- A main server that keeps track of which staff is at which server
- A web based front end for the user to see their history (which connects to the server based on their records)
- No worries about network problems since it is a local database
- A user can only check in and out at the same server. Databases and servers are not connected with each other.
- Have to add the user to each server if the users want to check in at different locations. Which means, if the user wants to go to location A, the user must be checked out from location A first and then check in at location B. The server at location B didn't know that the user has checked in before at A.
By the way, I've already centralized my NTP to a local server. About the network, let's just say, I don't have the authority to make changes so that the network will be better. The network won't effect all 20 servers at once, usually, just a few of them for several times a week.
If there are anything else you would like me to answer, please just ask.