0

I am creating a Python application that uses embedded SQLite databases. The programme creates the db files and they are on a shared network drive. At this point there will be no more than 5 computers on the network running the programme.

My initial thought was to ask the user on startup if they are the server or client. If they are the server then they create the database. If they are the client they must find a server instance on the network. The one way I suppose is to send all db commands from client to server and server implements in the database. Will that solve the shared db issue?

Alternatively, is there some way to create a SQLite "server". I presume this would be the quicker option if available?

Note: I can't use a server engine such as MySQL or PostgreSQL at this point but I am implementing using ORM and so when this becomes viable, it should be easy to change over.

bteres
  • 609
  • 4
  • 14

1 Answers1

0

Here's a "SQLite Server", http://sqliteserver.xhost.ro/, but it looks like not in maintain for years.

SQLite supports concurrency itself, multiple processes can read data at one time and only one can write data into it. Also, When some process is writing, it'll lock the whole database file for a few seconds and others have to wait in the mean time according official document.

I guess this is sufficient for 5 processes as yor scenario. Just you need to write codes to handle the waiting.

hago
  • 1,700
  • 2
  • 16
  • 18