Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can SQLite support multiple users?

Tags:

sqlite

I am trying to develop a Windows based application with multiple users accessing the same database at the same time. Can SQLite support multiple accesses at one time? Is SQLite stable in this regard? What makes SQLite better or worse than MS SQL CE?

Thanks.

like image 492
inblues Avatar asked Feb 24 '11 08:02

inblues


People also ask

How many users can SQLite support?

SQLite supports an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time.

Can you share SQLite database?

To transfer an SQLite database found on the development computer to an Android device, the database can be added into the apk archive of the application. This operation can be performed when creating the Android archive, in the "Integrating files" screen.

What are the disadvantages of SQLite?

One of the main drawbacks of the SQLite system is its lack of multi-user capabilities which can be found in full-fledged RDBMS systems like MySQL and PostgreSQL. This translates to a lack of granular access control, a friendly user management system, and security capabilities beyond encrypting the database file itself.

Why you should not use SQLite?

High write volumes: SQLite allows only one write operation to take place at any given time, which significantly limits its throughput. If your application requires lots of write operations or multiple concurrent writers, SQLite may not be adequate for your needs.


2 Answers

Yes SQLite can support multiple users at once. It does however lock the whole database when writing, so if you have lots of concurrent writes it is not the database you want (usually the time the database is locked is a few milliseconds - so for most uses this does not matter). But it is very well tested and very stable (and widely used) so you can trust it.

You may read this short document for information when to use SQLite and not: http://www.sqlite.org/whentouse.html

like image 63
Anders Zommarin Avatar answered Oct 04 '22 19:10

Anders Zommarin


If concurrent writes are an issue, you may want to look at Berkeley DB. The SQL API is completely SQLite compatible. In fact, it incorporates the SQLite executor top of Berkeley DB's storage engine, which does support multiple concurrent write operations.

like image 30
dsegleau Avatar answered Oct 04 '22 19:10

dsegleau