3

It is possible [in any way, even poorly hacked solution] to share in-memory database between many processes? My application has one process that opens the in-memory database and the other are running only SELECT queries on the database.

NOTE: I need solution only for python 2.7, and btw if it matters the module I use for making new processes is multiprocessing.

5
  • So you saying there is no way to do that in SQLite? it might be big headache to move to another db because I have already writtten whole program based on that. Commented May 25, 2016 at 11:08
  • If you've written the program in a sensible way, it should be easy to switch to another SQL-based DB that uses the Python DB API. Commented May 25, 2016 at 11:47
  • Why are you using multiprocessing and not threads? Commented May 25, 2016 at 18:59
  • Because I find out that multiprocessing fit more than threads in my application. Commented May 25, 2016 at 21:57
  • Have you tried this on UNIX. Hope to help you out Commented May 27, 2016 at 12:14

1 Answer 1

4

On Linux you can just use /dev/shm as the file location of your sqlite.

This is a memory mounted drive suitable exactly for that.

Sign up to request clarification or add additional context in comments.

1 Comment

@johnedoe_asking do you solve your problem by using this answer?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.