Re: [nodejs] Using sqlite3 in a Node.js cluster

464 views
Skip to first unread message

Matt

unread,
Apr 21, 2013, 5:16:19 PM4/21/13
to nod...@googlegroups.com
Yes SQLite supports this - it uses locking within the library itself using the filesystem, so is perfectly safe to read/write from multiple processes using cluster.


On Sun, Apr 21, 2013 at 12:30 PM, Brian Levine <blevi...@gmail.com> wrote:
Hi all,

I'm looking for a light-weight datastore for our server application.  Most of the data in our app is stored in a graph using neo4j.  But some of the "administrative" data lends itself more to a simple row or column-based store.  So I was thinking of using sqlite3 for this. However, it wasn't obvious to me how/whether a single sqlite db could be accessed from multiple Node.js processes running in a cluster.  Anyone out there have an experience doing this?

Thanks.

-brian

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

P. Douglas Reeder

unread,
Apr 22, 2013, 11:23:04 AM4/22/13
to nod...@googlegroups.com
Note that the SQLite files should not be stored on a network file system. (Apparently fcntl() locking is broken in many NFS implementations).

Also, one process writing will lock out any other process reading.

Matt

unread,
Apr 22, 2013, 2:01:02 PM4/22/13
to nod...@googlegroups.com
On Mon, Apr 22, 2013 at 11:23 AM, P. Douglas Reeder <reed...@gmail.com> wrote:
Note that the SQLite files should not be stored on a network file system. (Apparently fcntl() locking is broken in many NFS implementations).

I actually had reasonably good experience of doing this with NetApp's NFS implementation, but it's always going to be a flaky proposition, and in the end we re-wrote that part to use a proper database.
 
Also, one process writing will lock out any other process reading.

Apparently this is being fixed in SQLite4. 

Brian Levine

unread,
Apr 23, 2013, 10:51:09 AM4/23/13
to nod...@googlegroups.com
Thank all for your quick responses!

-b
Reply all
Reply to author
Forward
0 new messages