This is a migrated thread and some comments may be shown as answers.

SQLite In-Memory Database?

2 Answers 113 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
BKR AG
Top achievements
Rank 1
BKR AG asked on 01 Oct 2015, 08:14 AM

Hi,

i have a project where i load a complete sqlite database with about 1000 entries with telerik dataaccess and the fluent framework. Then i build a radtreeview, a breadcrump and a datagridview from this data. Now the annoying part. Every change needs to be done in the database immediatly. For ease of coding i then do "GetAll" to load my data again from the DB and build my views. The other choice would be to load my trees asynchronously what sounds like a lot of work.

I've made a few tests: first i saved the database on my pretty slow laptop hdd. It takes about 0,5-1 seconds to reload everything after a change has been done. Then i moved the sqlite file to my ssd. The speed is about 20 times as high, while my program is still on the laptop hdd. So i'm ​pretty sure this clumsiness is created because telerik writes every change of my 75kb database synchronously directly on the disk.

So my question is: is it possible to let the file be opened and hold completly in the memory and write a copy of it locally asynchronously? Like this: https://www.sqlite.org/inmemorydb.html

Should be much faster then my local laptop hd.  

 

2 Answers, 1 is accepted

Sort by
0
BKR AG
Top achievements
Rank 1
answered on 01 Oct 2015, 01:59 PM

I found a solution myself. Im doing it with the secondlevel cache:

 

m_backendConfiguration.SecondLevelCache.Enabled = true;
m_backendConfiguration.SecondLevelCache.Strategy = CacheStrategy.All;
m_backendConfiguration.SecondLevelCache.NumberOfObjects = 10000;
m_backendConfiguration.SecondLevelCache.NumberOfObjectsPerQueryResults = 10000;
m_backendConfiguration.SecondLevelCache.NumberOfQueryResults = 10000;

0
Boris Georgiev
Telerik team
answered on 05 Oct 2015, 04:38 PM
Hi Ronald,

You are on the right track. Using the second level cache is the right solution for your scenario. In this set of documentation articles you could find more information about the second level cache and how you can use it.

Feel free to contact us if you have any other questions.

Regards,
Boris Georgiev
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Getting Started
Asked by
BKR AG
Top achievements
Rank 1
Answers by
BKR AG
Top achievements
Rank 1
Boris Georgiev
Telerik team
Share this question
or