Take the 2-minute tour ×
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
2  
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
1  
@AK_ The main requirements are full ACID and very simple database to develop and use. We built a custom version to work as a client-server and the result is simply amazing! People are underrating the SQLite capacity and overrating need for concurrency to small companies. People need to open mind. Follow the recipe is not the only way to go. Now we have a product with no competition in our market. –  bigown Aug 3 '13 at 16:43

6 Answers 6

up vote 12 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
2  
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  
+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
    
locks an entire table Only when You're writing on it not reading many processers can read from the same table ;) –  ucefkh 2 days ago

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

share|improve this answer

SQLabs offers a commercial product called cubeSQL that may suit your needs.

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
2  
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 '13 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.