Friday, October 24, 2008

Did you know Windows (since Windows Server 2000) comes with a transactional database engine already baked into the OS, which you can use in your applications today, no download required?

Microsoft Windows SDK Blog - ESENT (Extensible Storage Engine) API in the Windows SDK

“I’m not sure how many people know that Windows comes with an embeddable, transactional database engine which is available to developers through the Windows SDK. The ESENT database engine can be used whenever an application wants high-performance, low-overhead storage of structured or semi-structured data. This can range from something as simple as a hash table which is too large to store in memory to a complex application with many tables, columns and indexes. ESENT is used by the Active Directory, Windows Desktop Search, Windows Mail and several other Windows services and a slightly modified version of the code is used by Microsoft Exchange to store all its mailbox data. The ESENT API is available through the SDK and can be used on all versions of Windows from Windows Server 2000 on up.

The significant technical features of ESENT include:

  • ACID transactions with savepoints, lazy commits and robust crash recovery.
  • Snapshot isolation.
  • Record-level locking — multi-versioning provides non-blocking reads.
  • Highly concurrent database access.
  • Flexible meta-data (tens of thousands of columns, tables and indexes are possible).
  • Indexing support for integer, floating point, ASCII, Unicode and binary columns.
  • Sophisticated index types including conditional, tuple and multi-valued.
  • Individual columns can be up to 2GB in size. A database can be up to 16TB in size.
  • Can be configured for high performance or low resource usage.
  • No administration required (even the database cache size can adjust itself automatically).
  • No download. Your application uses the esent.dll which comes with the operating system.

Caveats: ESENT should only be used for applications which have simple, predefined queries; applications that want to do ad-hoc queries should investigate a storage solution that provides a query layer. The database file cannot be shared between multiple processes simultaneously.

…”

Nice. Learn something new every day… 

I’ve done a 10 second search for P/Invoke signatures or a .Net wrapper and found this, “Extensible Storage Engine” (VB.Net) and this, “ESENT Managed Interface” both of which seem to be cool resources for .Net coders wanting to use ESENT.

(via Visual Studio Hacks - Visual Studio Links #81)

8 comments:

Anonymous said...

No thanks. It would probably be smarter t simply compile sqlite into your code. Then you get the power of a good database with queries, but lightweight on your application.

Anonymous said...

tried it. it was slow, the documentation is terrible, doesn't scale very well. use something like sqlite

Unknown said...

I would have to agree sqlite rocks!

Jiff
www.online-privacy.cz.tc

Anonymous said...

You are probably better off using SQL Express (http://en.wikipedia.org/wiki/SQL_Server_Express), which is free and works super well.

Anonymous said...

Don't use ESENT, it's old and broken, *really*. From someone who works at a certain software company in the Pacific Northwest.

Anonymous said...

sqlite FTW

using any other lightweight SQL engine, even if it is "baked into the os", is dumb

Anonymous said...

Use sqlite.

Anonymous said...

"it was slow, the documentation is terrible, doesn't scale very well"

"Don't use ESENT, it's old and broken, *really*. From someone who works at a certain software company in the Pacific Northwest."

I think these two comments are probably from people who have confused ESENT with the old Jet Database engine which does have scalability, performance and security problems (http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine). ESENT is fast and scalable (consider the workloads an AD or Exchange server has to deal with). The point about the documentation is correct -- while the APIs are described there are no code samples or demo applications.