How to choose a SQLite database and use in memory

I inherited the project from a colleague who left the company. Studying his code, I was embarrassed by something. After receiving a large amount of data from the server, it stores this data in a database in the client, and then continues to work with this data on db. Data is received once at the beginning of the application. That I could not understand so much, why does he not only use data from memory, but should store it on db?

There are many intensive memory operations inside the application, such as viewing large PDF files using Quartz, etc., but is the sqlite size also used as memory usage for the application? I mean, in your opinion, what is the advantage of this?

+5
source share
3 answers

SQLite have a very small boot area (~ 250-400Kb). When SQLite works with databases on disk, because of this, due to lack of memory, it does not even measure the file size (by default, a database can contain about 1 TB of data in it). And, as you said, this is a permanent data warehouse.

If the database is stored in memory, your application consumes

memory = database file size + small overhead

In addition, you will have a number of restrictions with queries that you can execute in the database in memory (I cannot remember the time on the street, but you cannot use transactions and vacuum)

SQLite , , .

+6

SQLite .

+4

, , ( ) , , . , , ( ), - , . , .

, , , , . ( , ), .

, . , , . , .

+1

All Articles