ESENT Serialization class library is built above Managed ESENT. It allows you to store your objects in the underlying extensible storage engine database.


  • Serializes and deserializes objects. To mark the object to be your database record type, apply [EseTable] attribute to your record class, and column attributes to the class members.
  • 27 column types, ranging from something as simple as a byte or int32, to enums, multi-valued strings, or arbitrary objects serialized with either XmlSerializer or DataContractSerializer.
  • The library is multithreading-aware. Concurrent database access by several threads is OK.
  • Suitable for building both Windows desktop software, and servers including ASP.NET web applications.
  • The complete absense of database query language improves the web application security: unless you've explicitly written the code to modify a specific column in your table, you can be sure your data is safe. Using this library completely eliminates possibility of SQL injection-class attacks.
  • Table-granular change notification mechanism (practically untested).
  • The recordsets support filtering and sorting by the ESE indexes, which is much more efficient then using LINQ with its O(n)+ complexity.
  • The recordset returns records as the IEnumerable<tRow> (where tRow is your record class that has the [EseTable] attribute applied) suitable for lazy evaluation, making it possible to sequentially process a huge dataset that does not even fit in your RAM.
  • Provides data binding mechanisms for windows forms controls: see the documentation on EditableObjectList generic class. For example, you can build a form with DataGridView displaying the whole ESENT table with just a dozen lines of code (see included WinFormsDemoApp sample).
  • Import/export of the tables to an Excel-friendly format (UCS2-encoded tab-separated values, to be precise).
  • Although no remote database access API is provided, records can be serialized into arrays of bytes for replicating across the LAN. The DB is suitable for building redundant distributed systems. Some optimizations were made specially for inexpensive Amazon EC2 small instances running Windows Server 2003 R2.
  • Just like the Managed ESENT, the DLL is architecture-neutral ("Any CPU").
  • Good documentation.


  • I never tested the library itself. Some parts of the library are untested (binary format import / export), other parts are tested poorly (VirtualMode). The core functionality however was tested OK as a part of various projects where I used the library.
  • Only tested on Vista, Windows 7, Windows Server 2003 and 2008.
  • Only tested with C# language, Visual Studio 2008 and 2010, .NET framework 3.5 SP1 and 4.0.
  • No DB schema upgrade mechanism is currently implemented.
  • My design goal was to simplify the developing of ESENT-based software. I did not want to create an additional level of abstraction, see the law of leaky abstractions for the reason why. To efficiently use the library, you'll have to understand (to some extent) the underlying ESENT technology.
  • Automatically-incremented columns are handy to use, however the values can't be set programmatically. Unfortunately, they can't be used if you need to import data, or replicate changes across LAN.
  • RawRead/RawWrite API is incompatible with multivalued columns.
  • Because I don't yet have my MS Surface for tests, this library most likely won't work on Windows 8 RT.

Last edited Nov 2, 2012 at 3:48 PM by Const_me, version 13