All Projects → mbdavid → Litedb

mbdavid / Litedb

Licence: mit
LiteDB - A .NET NoSQL Document Store in a single data file - https://www.litedb.org

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Litedb

Objectbox Java
ObjectBox is a superfast lightweight database for objects
Stars: ✭ 3,950 (-35.59%)
Mutual labels:  database, nosql
Orientdb
OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries. OrientDB Community Edition is Open Source using a liberal Apache 2 license.
Stars: ✭ 4,394 (-28.35%)
Mutual labels:  database, nosql
Awesome Elasticsearch
A curated list of the most important and useful resources about elasticsearch: articles, videos, blogs, tips and tricks, use cases. All about Elasticsearch!
Stars: ✭ 4,168 (-32.04%)
Mutual labels:  database, nosql
Kache
A simple in memory cache written using go
Stars: ✭ 349 (-94.31%)
Mutual labels:  database, nosql
Nitrite Java
Java embedded nosql document store
Stars: ✭ 538 (-91.23%)
Mutual labels:  database, nosql
Mongo
The MongoDB Database
Stars: ✭ 20,883 (+240.5%)
Mutual labels:  database, nosql
Sleekdb
Pure PHP NoSQL database with no dependency. Flat file, JSON based document database.
Stars: ✭ 450 (-92.66%)
Mutual labels:  database, nosql
Bedquilt Core
A JSON document store on PostgreSQL
Stars: ✭ 256 (-95.83%)
Mutual labels:  database, nosql
Arangojs
The official ArangoDB JavaScript driver.
Stars: ✭ 503 (-91.8%)
Mutual labels:  database, nosql
Csharp Driver
DataStax C# Driver for Apache Cassandra
Stars: ✭ 477 (-92.22%)
Mutual labels:  database, nosql
Bitnami Docker Redis
Bitnami Redis Docker Image
Stars: ✭ 317 (-94.83%)
Mutual labels:  database, nosql
Zeppelin
Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.
Stars: ✭ 5,513 (-10.11%)
Mutual labels:  database, nosql
Concourse
Distributed database warehouse for transactions, search and analytics across time.
Stars: ✭ 310 (-94.95%)
Mutual labels:  database, nosql
Dbreeze
C# .NET MONO NOSQL ( key value store embedded ) ACID multi-paradigm database management system.
Stars: ✭ 383 (-93.76%)
Mutual labels:  database, nosql
Inquiry Deprecated
[DEPRECATED]: Prefer Room by Google, or SQLDelight by Square.
Stars: ✭ 264 (-95.7%)
Mutual labels:  database, nosql
Tinydb
TinyDB is a lightweight document oriented database optimized for your happiness :)
Stars: ✭ 4,713 (-23.15%)
Mutual labels:  database, nosql
Ravendb
ACID Document Database
Stars: ✭ 2,870 (-53.2%)
Mutual labels:  database, nosql
Rxdb
🔄 A client side, offline-first, reactive database for JavaScript Applications
Stars: ✭ 16,670 (+171.81%)
Mutual labels:  database, nosql
Nodejs Firestore
Node.js client for Google Cloud Firestore: a NoSQL document database built for automatic scaling, high performance, and ease of application development.
Stars: ✭ 475 (-92.26%)
Mutual labels:  database, nosql
Corfudb
A cluster consistency platform
Stars: ✭ 539 (-91.21%)
Mutual labels:  database, nosql

LiteDB - A .NET NoSQL Document Store in a single data file

Join the chat at https://gitter.im/mbdavid/LiteDB Build status Build Status


LiteDB is a small, fast and lightweight .NET NoSQL embedded database.

  • Serverless NoSQL Document Store
  • Simple API, similar to MongoDB
  • 100% C# code for .NET 4.5 / NETStandard 1.3/2.0 in a single DLL (less than 450kb)
  • Thread-safe
  • ACID with full transaction support
  • Data recovery after write failure (WAL log file)
  • Datafile encryption using DES (AES) cryptography
  • Map your POCO classes to BsonDocument using attributes or fluent mapper API
  • Store files and stream data (like GridFS in MongoDB)
  • Single data file storage (like SQLite)
  • Index document fields for fast search
  • LINQ support for queries
  • SQL-Like commands to access/transform data
  • LiteDB Studio - Nice UI for data access
  • Open source and free for everyone - including commercial use
  • Install from NuGet: Install-Package LiteDB

New v5

  • New storage engine
  • No locks for read operations (multiple readers)
  • Write locks per collection (multiple writers)
  • Internal/System collections
  • New SQL-Like Syntax
  • New query engine (support projection, sort, filter, query)
  • Partial document load (root level)
  • and much, much more!

Lite.Studio

New UI to manage and visualize your database:

LiteDB.Studio

Documentation

Visit the Wiki for full documentation. For simplified chinese version, check here.

LiteDB Community

Help LiteDB grow its user community by answering this simple survey

How to use LiteDB

A quick example for storing and searching documents:

// Create your POCO class
public class Customer
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }
    public string[] Phones { get; set; }
    public bool IsActive { get; set; }
}

// Open database (or create if doesn't exist)
using(var db = new LiteDatabase(@"MyData.db"))
{
    // Get customer collection
    var col = db.GetCollection<Customer>("customers");

    // Create your new customer instance
    var customer = new Customer
    { 
        Name = "John Doe", 
        Phones = new string[] { "8000-0000", "9000-0000" }, 
        Age = 39,
        IsActive = true
    };

    // Create unique index in Name field
    col.EnsureIndex(x => x.Name, true);

    // Insert new customer document (Id will be auto-incremented)
    col.Insert(customer);

    // Update a document inside a collection
    customer.Name = "Joana Doe";

    col.Update(customer);

    // Use LINQ to query documents (with no index)
    var results = col.Find(x => x.Age > 20);
}

Using fluent mapper and cross document reference for more complex data models

// DbRef to cross references
public class Order
{
    public ObjectId Id { get; set; }
    public DateTime OrderDate { get; set; }
    public Address ShippingAddress { get; set; }
    public Customer Customer { get; set; }
    public List<Product> Products { get; set; }
}        

// Re-use mapper from global instance
var mapper = BsonMapper.Global;

// "Products" and "Customer" are from other collections (not embedded document)
mapper.Entity<Order>()
    .DbRef(x => x.Customer, "customers")   // 1 to 1/0 reference
    .DbRef(x => x.Products, "products")    // 1 to Many reference
    .Field(x => x.ShippingAddress, "addr"); // Embedded sub document
            
using(var db = new LiteDatabase("MyOrderDatafile.db"))
{
    var orders = db.GetCollection<Order>("orders");
        
    // When query Order, includes references
    var query = orders
        .Include(x => x.Customer)
        .Include(x => x.Products) // 1 to many reference
        .Find(x => x.OrderDate <= DateTime.Now);

    // Each instance of Order will load Customer/Products references
    foreach(var order in query)
    {
        var name = order.Customer.Name;
        ...
    }
}

Where to use?

  • Desktop/local small applications
  • Application file format
  • Small web sites/applications
  • One database per account/user data store

Plugins

Changelog

Change details for each release are documented in the release notes.

Code Signing

LiteDB is digitally signed courtesy of SignPath

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].