最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multiprocessing - Multiple access to database - Stack Overflow

programmeradmin0浏览0评论

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:

  1. 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.

  2. 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?

发布评论

评论列表(0)

  1. 暂无评论