I'm looking for an in-memory database, where I will keep a long list of records.

  • Each record will have a variable number of non-unique (!) attributes (similar to how NoSQL tables are organized).
  • I need to be able to save it from memory to disc and backwards, preferably having everything in a single file.
  • The speed is what matters for me.
  • No parallelism is required: the file will be loaded by the database engine into memory, modified, and then saved to another file.
  • The size of the database will be up to 100Mb and up to 10K records.
  • There will be mostly SELECT queries (heavily relying on indexes), UPDATEs, and INSERTs (no DELETEs)
  • No journaling or ACID transactions are needed.
  • The speed of loading the data into memory and saving it back to the disc doesn't matter at all.

What software would you recommend using?

  • The file will be used only by one application at a time, right? Not by several apps in parallel? What size of data? What kind of queries will you perform? Is JSON deserialization+serialization too slow? Do you need journaling (changes safe even in case of computer crash)?
    – Nicolas Raoul
    Commented May 10 at 3:25
  • 1
    @NicolasRaoul thanks for the comment, I updated the question
    – yegor256
    Commented May 10 at 6:25
  • Is it OK to be slow the first time (when loading the file to memory), then fast afterwards for the SELECTs?
    – Nicolas Raoul
    Commented May 10 at 6:43
  • 1
    @NicolasRaoul I updated the question again
    – yegor256
    Commented May 10 at 8:21
  • 1
    @NicolasRaoul my app is in Ruby, but I can easily make a bridge to C/C++, Rust, or any other compilable low-level language
    – yegor256
    Commented May 10 at 11:44

1 Answer 1


I would take a look at SQLite. I believe it meets all your requirements.

  • 1
    I doesn't seems to meet the first point of variable number of columns.
    – Alejandro
    Commented May 13 at 21:21
  • Wouldn’t a JSON column type support this? Which is similar to NoSQL.
    – Tai
    Commented May 14 at 3:57
  • JSON will work for storage, but won't allow searching by its fields
    – yegor256
    Commented May 16 at 13:55
  • Have you looked at its JSON functions and operators? They allow you to manipulate the JSON data as well as filtering the JSON data by its fields.
    – Tai
    Commented May 16 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.