admin管理员组文章数量:1336127
How to anize safe multiple access to a database when users use isolated programs for migration management? For example, when one user is trying to load their version into the database, how is the program supposed to block other access? I have some ideas:
The first idea is to have a general service to manage access to the database. For example, a simple queue where users can upload their changes. However, this method is challenging and requires creating an additional microservice.
The second idea is to introduce a flag in the database that indicates whether it is busy. However, this approach can introduce vulnerabilities, such as a race condition when multiple users attempt to change the flag simultaneously. Additionally, if a program crashes, the flag may remain set to "busy" indefinitely.
Do you have any ideas for a better method?
本文标签: multiprocessingMultiple access to databaseStack Overflow
版权声明:本文标题:multiprocessing - Multiple access to database - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742342832a2456945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论