Ramblings of General Geekery

MongoDB for Lucene and ASP.NET

My latest home project (yet to be announced) is using MongoDB for storage, which led me to write a couple of libraries you may be interested in if you use that kind of database. Keep reading for the details.

MongoDB directory for Lucene

MongoDB.Lucene is what you would expected given the name: a MongoDB backend for Lucene indexes.

It’s a simple port of the standard FSDirectory using Mongo’s GridFS storage. I’m sure there’s a lot of room for improvement (performance, storage efficiency, lock reliability), but it’s working well enough for small applications.

It’s available as a NuGet package.

MongoDB providers for ASP.NET

MongoDB.Web is a set of providers for ASP.NET:

  • Membership provider
  • Role provider
  • Profile provider (not fully-featured yet)

It also contains a TraceListener that stores log events in a MongoDB collection.

This one’s got a funny story behind it. I wrote it quickly to get going with the rest of my project, and came back to it later thinking I could clean it up and publish it on the NuGet Gallery… but I got a package ID already exists error because of this similar package also called MongoDB.Web. I guess I should have checked first…

Why did I keep my own version then? Well:

  • My providers use a bit less storage in the database.
  • Provider initialization (like getting the right connection string) has more options (useful when you want to run on AppHarbor for instance, where they have pretty limited configuration customization).

The other version is however fully-featured, and probably better tested.