I’ve read in Ayendes blog about Esent, which is an embeddable database storage engine (ISAM) which is part of Windows.

There is also a managed API being created at CodePlex. What I did is implemented a backend for SourceGrid using Esent PersistentDictionary. This is similar to windows DataGrid, which takes data from DataSet (or DataTable, or DataView) structure.

However, with DataSet there are two problems.

  • Whole data must be kept in memory. I did home-testing and found that keeping 1 million rows in DataTable increases my app memory consumption from roughlt 50MB to 250MB.
  • Data is not persistent.

Essent backend solved both of these two problems (although sorting is not available with PersistentDictionary out of the box). This image shows the result:

Of course the data is simplistic, first column is just ID, second is one of the 5 random strings. Whole esent DB file takes 674 MB on disk. There is at the moment a small problem with hidden rows implementation, but that can be fixed easily. If hidden rows feature is temporarily disabled, then the data can be viewed immediately, scrolling works just fine.

I plan to make other backends too. Probably the next one will be NHibernate backend, with embedded FireBird as an example. Hope that it will support sorting, and will handle data (at least on local computer) easily. I will try to test SourceGrid against 10 mln rows.

Advertisements