Virtual database in memory

Imagine the following:

I have a table of 57,000 elements that I regularly use in my application to identify things like targeting groups, etc.

Instead of querying the database 300,000 times a day, for a table that hardly ever changes its data, is there a way to store its information in my application and the polling data directly in memory? Or do I need to create some kind of user-defined data type for each row and retest each row to check the results I want?

After doing some googling, the closest thing I could find is the in-memory database

Thank you - theo

+3
source share
4 answers

SQLite maintains tables in memory.

+1
source

For the 57,000 items with which you will request (and want to receive them immediately), I would not recommend using simple caching. For many elements, I would recommend using a distributed memory cache (even if it is only one machine), for example Memcache, Velocity, etc., Or move on to the original idea of ​​using a database in memory.

, - ORM, NHibernate, . NHibernate , Memcache, Velocity . , , , , , .

+1

, , , "" "

0

If you only need to find strings using the same key all the time, simple Dictionary<Key, Value>might well be all you need. For me, 57,000 elements do not really sound so strong if each line does not contain a huge amount of data. However, if you need to search by different columns, most likely it will be a database in memory.

0
source

Source: https://habr.com/ru/post/1733523/


All Articles