Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any considerations before jumping into SQLite?

Tags:

c#

sqlite

I have a WCF application that at present is using XML based file storage to store data that gets used to generate reports. Besides this processing decisions are made based on information stored in these XML files.

I'm now hitting volumes of around 30 000 text files. This is incredibly taxing, and the application at times comes to a grinding halt.

I've always wanted to swop out the XML DAL in favor of an RDBMS, but project managers simply won't allow it. But they would be willing to look at a serverless solution for example SQLLite. I am really tempted to just dive right in and start using it as a replacement DAL (Data Access Layer).

I would need no more than around 20 tables in the whole solution, and I would expect to get no more than around 20 000 - 100 000 transactions a day, however this is extreme, the real volumes would be less than this in most cases.

Update

I am not expecting a great deal of simultaneous connections, when I say transactions, I essentially mean 1 or 2 clients that make calls and execute against the database in order. At times there might be a possibility of external clients making quick calls to the DB. But the bulk of DB connections will be done by my WCF service, which is a back end scheduled task, not serving 100's of people across an organization.

Another good point is that I only need to retain data for 90 days, so the DB shouldn't grow too big.

My main concerns are:

How reliable is SQLLite? What if the DB File gets corrupted, will I loose all processing Data. How easy is the DB to back up? Will it handle my volumes? And lastly how well does the .net provider work (located here: http://sourceforge.net/projects/sqlite-dotnet2/).

If you have any experience with SQLLite, please post your experiences so I can make aan informed decision to switch or not.

Thanks in advance...

like image 323
JL. Avatar asked Feb 18 '10 19:02

JL.


People also ask

Is SQLite good for beginners?

SQLite is used as a temporary dataset to get processed with some data within an application. Beginners use SQLite for learning and training purposes, as it requires no installation and configuration.

What are the most important features of SQLite?

Available as a single ANSI-C source-code file that is easy to compile and hence is easy to add into a larger project. Self-contained: no external dependencies. Cross-platform: Android, *BSD, iOS, Linux, Mac, Solaris, VxWorks, and Windows (Win32, WinCE, WinRT) are supported out of the box. Easy to port to other systems.

How much data is too much for SQLite?

SQLite database files have a maximum size of about 140 TB. On a phone, the size of the storage (a few GB) will limit your database file size, while the memory size will limit how much data you can retrieve from a query. Furthermore, Android cursors have a limit of 1 MB for the results.

When should I use SQLite?

MySQL with its great feature set, community support, and easy setup, is the best allrounder for most web-based applications. PostgreSQL is the way to go for high customizability and specific database requirements, and SQLite is the best option for an application with low DB storage needs or a website with low traffic.


2 Answers

SQLite is as reliable as your OS and hardware.

Its transactional rate is similar to SQL server, and often faster because it's all in process.

The .NET ADO provider works great.

To back up the DB, stop the service and copy the file. If the journal file is present copy it too.

EDIT: SQLite uses UTF-8 by default so with the ADO-NET provider you should be able to avoid losing accents (just so long as you follow the typical XML in string rules).

like image 92
Joshua Avatar answered Oct 14 '22 02:10

Joshua


You could consider Microsoft's Sql Compact Edition.
It's like sqlite, in terms of being a single file embedded database, but has better integration with the .net framework :)
SQLite seems reliable, and even with Microsoft's one, don't expect to receive much support in case of a corrupted database.

like image 20
wintermute Avatar answered Oct 14 '22 01:10

wintermute