logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SQLite Ok with transaction/commit or just use MySQL?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
maddogfargo



Joined: 03 Nov 2009
Posts: 49

PostPosted: Wed May 22, 2013 21:05    Post subject: SQLite Ok with transaction/commit or just use MySQL? Reply with quote

I'm debating this for a new project:

Is it OK/safe to share SQLite across several modules, all running locally, with transactions/commits coded in...or should I just use a local MySQL server instead?

Suggestions/recommendations welcome.

My goal is fast, low overhead data storage for multiple modules running on the same local, physical box.
_________________
* illegible scribble *
Back to top
View user's profile Send private message
eeriegeek



Joined: 07 Jan 2008
Posts: 59

PostPosted: Thu May 23, 2013 5:46    Post subject: Reply with quote

That should work as long as you make sure all your instances reference the same .sqlite file. The main issue would probably be that sqlite locks at the db level, so updates from other instances will block until the current transaction is committed (so keep db update transactions small). Reads can run concurrently. You may get frustrated if you need high performance updates as sqlite's transaction rate is actually quite low compared to RDBMSs like Postgres and MySQL (see the FAQ Item #19). There is a pretty good reference to sqlite's niche here: When to Use SQLite.
Back to top
View user's profile Send private message
maddogfargo



Joined: 03 Nov 2009
Posts: 49

PostPosted: Tue May 28, 2013 22:20    Post subject: Reply with quote

Excellent info. Thanks!

I plan to run multiple instances of a module that will be using the database fairly heavily. So it sounds like MySQL might be a better option.

However I will be storing everything for this NWN server on SSD so could be transactions with SQLite will go much faster that with rotational media. Will have to test and see I suppose.
_________________
* illegible scribble *
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group