Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jacobson's avatar

Locking table for update - better solutuon

Hi I have a project with a lot of tasks that are being added all day (different hours). I want to create a database table with “tasks” and a process that adds tasks to this table. Unfortunately it can’t be a simple “pop task” because each task has its requirements that has to be fulfilled with a request data.

The problem is that I have to lock a table for update so that the tasks is not taken twice. For example I have 350k tasks daily and 100 clients that asks for jobs throughout the day. I’m wondering if there is something better than just a database table for this kind of task.

0 likes
2 replies
Snapey's avatar

and use auto increment row id

1 like

Please or to participate in this conversation.