I start developing a Django web app that ist going to be used by hundreds of user at the same time.
The app consits of a simple database table that lists unique tasks top-down. The first user that request some tasks should get the tasks from the top of the list. The next user that asks for tasks should get the next tasks and so on.
How do I prevent, that users get the same tasks from the table when they ask for datasets at the same time? Is there the possibility of a race condition?
CodePudding user response:
Try select_for_update or F expressions you can find more info here