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?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742342832a4425969.html
评论列表(0条)