LiteDB: Embedded .NET NoSQL Database

I was recently in the need for a simple NoSQL database that I could use for an app I was creating for a ASP.NET Core Workshop.

What I was really after was something similar to SQLite.   A single package I could pull into my application that did not require any external service and data stored in a single file.

It didn’t take long to find LiteDB.  After using it for my demo application, I had write a quick post about it.  Just to shed some light for anyone in need.  The project is actually really popular on GitHub, so it seems I might just be late to the party about finding out about it.

LiteDB

LiteDB is serverless database delivered in a single DLL (less than 350kb) fully written in .NET C# managed code (compatible with .NET 3.5, 4.x, NETStandard 1.3 and 2.0).

Install via NuGet or just copy DLL to your bin project folder.

Sample

Similar to MongoDB

One thing to note is how the API is similar to the Mongo DB .NET driver.

You also can store files like you can in GridFS.

Use Cases

I would think the use cases would be similar in terms of need for something like SQLite.  Because it supports .NET Standard, I would think Xamarin apps would be an excellent fit.

Again, my application was a small local application, which was also ideal.

Are you using LiteDB? Using something different? I’d love to hear what your using and your workloads which you’re using it in.  Let me know on Twitter or in the comments.

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.