Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read-only, rather small database - ways to optimise?

Tags:

linux

database

I have a following design. There's a pool of identical worker processes (max 64 of them, on average 15) that uses a shared database for reading only. The database is about 25 MB. Currently, it's implemented as a MySQL database, and all the workers connect to it. This works for now, but I'd like to:

  • eliminate cross-process data transfer - i. e. execute SQL in-process
  • keep the data completely in memory at all time (I mean, 25 MB!)
  • not load said 25 MB separately into each process (i. e. keep it in shared memory somehow)

Since it's all reading, concurrent access issues are nonexistent, and locking is not necessary. Data refreshes happen from time to time, but these are unfrequent and I'm willing to shut down the whole shebang for those.

Access is performed via pretty vanilla SQL SELECTs. No subqueries, no joins. LIKE conditions are the fanciest feature ever used. Indices, however, are very much needed.

Question - can anyone think of a database library that would provide the goals outlined above?

like image 387
Seva Alekseyev Avatar asked May 28 '26 15:05

Seva Alekseyev


1 Answers

You can use SQLite with its in-memory database.

like image 172
Ivo Avatar answered May 31 '26 04:05

Ivo