Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Are there any techniques or tools to work with SQLite on a medium size/traffic/concurrency DB environment?

share|improve this question
1  
Can you give a reason why this would be a useful thing to have? Otherwise I think it deserves closing as not a real question. SQLite is not a client-server database and is really marketed to the crowd that doesn't need a client-server database. – jcolebrand Jan 5 '11 at 5:57
Note that SQlite only supports concurrent SELECTS. Any UPDATE or INSERT locks the whole database. – Eelke Aug 18 '12 at 5:34
@Eelke although this is not longer true in WAL mode from version 3.7 - there can only be one write at a time, but "readers do not block writers and a writer does not block readers" – Jack Douglas Aug 18 '12 at 10:15
incidentally, Wikipedia currently seems to have this wrong – Jack Douglas Aug 18 '12 at 10:17
You may have complex embedded systems, like the infotainment system, where the you have different components (processes) that work concurrently on the same SQLite DB. – garzanti Mar 19 at 11:56

5 Answers

up vote 6 down vote accepted

SQLite is an embedded database and it is not intended to be used as a client-server. If you really want to you can use SQLitening.

share|improve this answer
1  
Finally a good answer. – bigown Jan 19 '11 at 23:01
here's the new url: sqlitening.com – John Bachir Sep 16 '12 at 6:14

As stated before sqlite is not a client-server application and it is not built for highly concurrent operations.

Nevertheless you can "make it client-server", if you use ssh.

ssh user@host sqlite3 databasefile select * from table

works.

share|improve this answer
+1 for sheer comedy :-) – Gaius Jan 7 '11 at 18:21

No, SQLite doesn't present a network endpoint - it is only accessible via the filesystem. It does support concurrent access from multiple processes on the same machine but at a very coarse-grained level (DML locks an entire table). So you could have a dozen Apache httpd processes all with a SQLite database on the local disk open, all doing SELECTs and it would work just fine. But really, it's the wrong tool for the job - I'd use Postgres in this scenario.

share|improve this answer

You could hack something together using netcat, but I can't imagine it would be a very elegant solution.

share|improve this answer

You can use a service similar to dropbox. There self-hosted solutions. However, SQLite3 was not created for a client-server model. You'd be better of with other solutions which were developed ground-up by client-server model.

share|improve this answer
Dropbox and other file synchronization services ARE NOT a solution to this problem. Dropbox does not contain any logic in regards to merging changes in a database that multiple users are writing to concurrently. The end result will be lost data, work, and time. – jptros May 7 at 17:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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