I want to log login attempts. If you do 3 failed logins with the same username the account is disabled for 5 minutes.
Now I got followoing table to log the data in MySQL.
TStamp as timestamp
User as char(15)
IP_Address as char(16)
Session as char(32)
I was thinking to use timestamp as primary as this logfile is not very important. If 2 users do a failed login at the same second I simply would catch the mysql error and don't write the 2nd login attempt.
Somehow I am not satisfied with this as it is a kind off faulty programming.
An auto increment ID key has to be reseted somehow as it might get big fast in an environment with many short living log entries.