I have a MySQL DB which manages users’ accounts data. Each user can only query he’s own data. I have a script that on initial login gets the user data and inserts it to the DB. I scheduled a cron process which updates all users’ data every 4 hours.
Here are my questions regarding it:
(1) - Do I need to implement some kind of lock mechanism on the initial login script? This script can be executed by large number of users simultaneously - but every user has a dedicated place in the DB so it does not affect other DB rows.
(2) - Same question on the cron process, should I handle this scenario: While the cron process updates user i data, user i tries to fetch his data from the DB. I mean does MySQL already support and handles this scenario?
Any help would be appreciated.
Thanks.