Skip to main content

Free embedded databases for C# (.Net) performance overview

I have tested several open-source embedded DB engines for .Net to find which one is the best for my purposes.
My choice for testing was:
Test application I wrote does following actions (and measure consumed time):
  1. Prepare DB: Recreate DB & tables (3 tables, 2 non-PK indexes)
  2. Create DB: Insert ~500 records to the DB
  3. Read All: sequentially read 400 records from the only table (no joins)
  4. Read Random: read random 400 records from the only table (no joins)
  5. Read / Write All: sequentially read & update 400 records from the only table (no joins)
  6. Read / Write Random: read & update random 400 records from the only table (no joins)
Results you may see here. FireBird is ~30 times slower on read operations than SQLite but 10-20 times faster on write operations. Overall time wins FireBird. It is 7 times faster.
As for SQLite .Net adapters System.Data.DQLite is faster then sqlite-net for ~ 1.4 times.
Final DB size: 912KB for FireBird, 40KB for SQLite.
I like sqlite-net framework style but current version is slow and does not support blobs & nullable types. I hope it will improve.

If you think I should test something else please comment.

Comments