0

I made a application in python and it should read and write simultaneously in multiple instances(multi CMD widows)(multi-threading). each thread is configured independently so it will not change the data that written with other instances. so in action app instance 1 will work with John's data and app instance 2 will work with Jane's data and so On.

the application concept is simple enough but in action when running multiple instances at once, there may be a situation that I get database locked error and the app will stop working.

I want to disable this locking system, because its not necessary in my application, I designed it Independent just for this reason.

can anybody tell me to do it in python? is it possible? where should I place a code or sql command or anything?

1
  • 1
    now that I think about it, is it a good idea to use different databases for each app instance? like 7 databases for 7 instances? Commented Aug 18, 2018 at 11:21

1 Answer 1

-1

Using embedded sqlite is good for developing and testing, and I'm assuming you are using db like this:

db = sqlite3.connect('data/mydb')

In this case you could use several db like mydb1, mydb2 and so on. It would prevent the lockdown but overall it's not the solution.

I would suggest using several tables in single database instance via any RDS service you find appropriate. For example this one

Another solution could be moving from relational database to NoSQL solution. It would completely prevent the lockdown situation and it's highly scalable and affordable when data exchange volumes are relatively low.

2
  • yes i use the approach you mentioned in sqlite. one reason that I choose sqlite is its portableabiliy. can you suggest any no sql db that is not require installing on clients? i just know mongodb and redis and they both need to be installed on client. Commented Aug 18, 2018 at 15:27
  • and the several db is good idea as I mentioned before in my comment but I want to try the best solution Commented Aug 18, 2018 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.