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

Features

  • 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.
  • 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.
  • 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. The client-server sample is provided.
  • Just like the Managed ESENT, the DLL is architecture-neutral ("Any CPU").
  • Good documentation.

Shortcomings

  • 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.
  • 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.

Last edited Dec 7 at 2:57 AM by Const_me, version 14