I have a large queue of emails loaded into a MySQL table, since events are happening around my site. At any time, perhaps 1k-2k is waiting for dispatch at any time.
I worked on batch sets of emails and sent them through one employee. Now I want to add X workers to the system with an increase in load.
My question is to prevent employees from picking the same email address. I heard the following options.
- Use SELECT FOR UPDATE to lock a row
- Use a timestamp to inform employees that this was done and when
- Have a parent who tracks children and delegates work.
I see the value in each of them, but also a lot of read / write in db. So what would you do?
Doing this through PHP and MySQL
source
share