tags:

views:

45

answers:

2

If I use Sequel in a ruby app like this:

DB = Sequel.sqlite('testdb.db')

does it make the database shared? Can I acces this same file from a different ruby app AT THE SAME TIME and get the database to perform locking etc?

I'm thinking probably not and i'd have to actually have a separate instance of the database running.

thanks

A: 

This is not up to neither Ruby nor Sequel. It's up to sqlite. Take a look at sqlite FAQ, and see whether it answers your question.

Mladen Jablanović
A: 

Yes, if you use a file backed database, you can access it by multiple processes. They don't even have to be ruby processes. Note that in SQLite, writers block all readers, so multi-process or multi-threaded write performance is not very good.

Jeremy Evans