Skip to content
CAI
Software that uses CAICheck a score

litedb-org/LiteDB

60.7

Adequate · 23 September 2026

58.6k

lines of production code

C#

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

LiteDB is a lightweight, embedded NoSQL database engine for .NET that manages document storage, indexing, and transactions within a single file. It provides a rich query interface supporting LINQ, SQL-like syntax, and vector similarity search for semantic retrieval. The system includes a command-line shell for interactive management, robust concurrency controls for shared file access, and comprehensive tooling for performance benchmarking and stability testing.

How it got here

24 changes.

This period focused on a comprehensive rewrite of the LiteDB storage engine, introducing a new page-based architecture, dedicated services for concurrency and recovery, and a redesigned expression evaluation system. It also added significant new capabilities, including vector data support with similarity search, a robust command-line shell, and extensive utility improvements for serialization and query optimization.

2018 — v8 engine and API overhaul

21 changes.

This period focused on a comprehensive architectural rewrite of LiteDB, introducing the v8 file format and a modular query pipeline with support for GROUP BY, vector search, and optimized execution. The work also involved redesigning the client-side API with new interfaces, enhancing the BsonMapper for concurrency and performance, and implementing robust disk I/O and encryption handling.

2019–2020 — SQL support and concurrency

20 changes.

This period focused on introducing SQL query parsing and execution infrastructure, including a comprehensive command parser and caching system. It also implemented shared-mode concurrency support via named mutexes to enable safe multi-process access, alongside a new merge-sort engine for complex ordering and backward compatibility for legacy file formats.

2022–2026 — Vector search and fuzzing infrastructure

14 changes.

This period focused on introducing vector similarity search capabilities to LiteDB, including new indexing, querying APIs, and a dedicated demo tool. Simultaneously, the project established a comprehensive fuzzing infrastructure with integrity verification, regression tracking, and legacy framework support to enhance stability. Development also included significant improvements to testing harnesses, CI scripts for code quality enforcement, and automated semantic versioning.

Features

Add command-line argument parsing and text scanning utilities to the shell

The LiteDB shell now includes new utility classes to support command-line interaction: \OptionSet\ parses command-line arguments (supporting flags like \--key=value\ and \--key value\), \StringScanner\ provides a regex-based state machine for parsing text input, and \StringExtensions\ offers helper methods for string validation and trimming. These changes enable the shell to accept and process user commands and parameters more robustly.

LiteDB.Shell/Utils · high confidence

Added BucketHelper for optimized memory bucket sizing

A new internal BucketHelper class has been introduced to manage memory bucket sizing. It calculates and caches the maximum size for 17 distinct buckets, allowing the system to quickly determine the appropriate bucket index for a given buffer size. This optimization supports more efficient memory allocation and reuse within the pooling mechanism.

LiteDB/Utils/Pool · high confidence

Added ConsoleApp1 reproduction tool and data faker for LiteDB engine testing

A new ConsoleApp1 project was added to the repository, containing a Program.cs that reproduces a specific LiteDB engine crash involving transaction monitor access across threads, alongside Tools/Faker.cs and Tools/Faker.Names.cs which provide utilities for generating test data such as names, lorem text, and other attributes.

ConsoleApp1 · high confidence

Added LiteDB.Benchmarks project with BenchmarkDotNet configuration

A new LiteDB.Benchmarks project has been introduced to provide performance measurement capabilities. The project is configured as a BenchmarkDotNet host, featuring an entry point that runs benchmarks with forced garbage collection, memory diagnostics, and reports exported in HTML, Markdown, and GitHub formats.

LiteDB.Benchmarks · high confidence

Added LiteDB.Stress tool for performance testing

Introduced a new LiteDB.Stress project containing a command-line utility designed to execute stress tests against LiteDB databases. The tool accepts a database file path and a duration parameter to run a defined test execution scenario, allowing users to evaluate database performance under load.

LiteDB.Stress · high confidence

Added benchmark models for file metadata with vector support

The LiteDB.Benchmarks project now includes new model classes (FileMetaBase, FileMetaWithExclusion) and a generator (FileMetaGenerator) to support benchmarking file metadata operations. These models include a Vectors property (float array) to enable vector-based benchmarking scenarios, along with standard metadata fields like FileId, Title, and validity dates. The FileMetaWithExclusion class provides a variant that excludes certain properties from BSON serialization, and the generator creates test data with random vector values and parent-child relationships.

LiteDB.Benchmarks/Models · high confidence

Added legacy file reader components for backward compatibility

Introduced new classes in the legacy file reader subsystem to support reading older database formats. This includes AesEncryption for handling AES-encrypted data pages, BsonReader for deserializing BSON data with specific handling for date time sentinels to prevent failures on corrupted data, and ByteReader for low-level binary data extraction.

LiteDB/Engine/FileReader/Legacy · high confidence

Expanded LINQ-to-BsonExpression translation for .NET types

The LINQ query engine now supports a significantly broader range of .NET type methods and properties by introducing a modular resolver architecture (ITypeResolver) with dedicated implementations for BsonValue, Convert, DateTime, Dictionary, Enumerable, Grouping, Guid, ICollection, Math, MemoryExtensions, Nullable, Number, ObjectId, Regex, and String types. Users can now use LINQ expressions involving type conversions (e.g., ToInt32, ToDateTime), DateTime arithmetic and formatting (e.g., AddDays, ToUniversalTime), string operations with explicit comparison modes (e.g., StartsWith with StringComparison), dictionary ContainsKey checks, and various collection aggregations (e.g., First, Last, Where, Select, Count) that were previously unsupported or required manual BsonExpression construction.

LiteDB/Client/Mapper/Linq/TypeResolver · high confidence

Introduce BsonVector type for vector data support

The document model now includes a new BsonVector type, allowing users to store and query high-dimensional vector data (float arrays) alongside standard BSON types. This enables vector-based operations such as similarity search within LiteDB documents.

LiteDB/Document · high confidence

Introduce IBsonDataReader interface and BsonDataReader implementation

Added a new IBsonDataReader interface and its BsonDataReader implementation to provide a standardized way to read BsonValue sequences from collections. This includes extension methods (ToEnumerable, ToArray, ToList, etc.) for convenient LINQ-style consumption of query results, replacing or supplementing previous ad-hoc reading mechanisms.

LiteDB/Document/DataReader · high confidence

Introduce LiteDB Shell interactive command-line interface

Adds a new interactive shell tool for LiteDB that allows users to connect to databases and execute SQL commands or built-in shell commands (like help, exit, etc.) via a console interface. The shell supports pretty-printing of JSON results, command history, multi-line SQL input, and graceful handling of Ctrl+C interrupts and incomplete input at EOF.

LiteDB.Shell/Shell · high confidence

Introduce LiteDB.ReproRunner CLI for managing and executing repro manifests

The LiteDB.ReproRunner CLI tool is introduced, providing commands to list, show, validate, and run repro manifests. The \list\ command discovers repros with optional filtering and JSON output, while \show\ and \validate\ inspect individual or all manifests. The \run\ command executes repro variants, supporting multiple instances, timeouts, and a live UI with configurable refresh rates, and can output machine-readable JSON reports. Execution is coordinated by a build coordinator and executor that handle deterministic directory planning, build artifact management, and outcome evaluation against expected states (reproduce, no repro, etc.).

LiteDB.ReproRunner · high confidence

Introduce shared-mode concurrency support via named mutexes

LiteDB now supports opening the same database file from multiple processes simultaneously. This location implements the core synchronization layer for that capability: SharedEngine coordinates access using a global named mutex (with Windows-specific access control and fallbacks for abandoned owners or long file paths), while SharedDataReader wraps the underlying data reader to manage disposal across shared boundaries. Users can now run concurrent readers/writers against a single file without manual locking, provided the platform supports named mutexes.

LiteDB/Client/Shared · high confidence

Introduction of SQL query parsing and caching infrastructure

This change introduces the core components for parsing and executing SQL-like commands within LiteDB. The new SqlParser class handles command dispatch for operations such as SELECT, INSERT, UPDATE, DELETE, and PRAGMA, while SqlQueryCache provides a thread-safe mechanism to store and retrieve compiled query templates to improve performance. Additionally, SqlQueryTemplate manages the execution of these cached queries, ensuring that query parameters are safely bound and that volatile functions are handled correctly during execution.

LiteDB/Client/SqlParser · high confidence

Introduction of command-line shell with script execution and pretty-printing

The LiteDB.Shell tool now supports interactive command-line usage with specific flags: users can execute commands via --exec, run script files using --run, format JSON output in a readable multiline style with --pretty, and automatically close the shell after the last command with --exit. This provides a programmatic interface for automating LiteDB operations and improving output readability.

LiteDB.Shell · high confidence

New BsonExpression methods for aggregation, data types, dates, math, strings, and vectors

This change introduces a comprehensive set of new expression methods in LiteDB, organized into dedicated files (Aggregate, DataTypes, Date, Math, Misc, String, StringComparison, Vector). Users can now perform aggregation operations (COUNT, MIN, MAX, FIRST, LAST, AVG, SUM, ANY), convert data types (INT32, INT64, DOUBLE, DECIMAL, STRING), manipulate dates (YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, DATEADD, DATEDIFF, TO\_LOCAL, TO\_UTC), apply math functions (ABS, ROUND, POW), process strings (LOWER, UPPER, LTRIM, RTRIM, TRIM, INDEXOF, SUBSTRING, REPLACE, LPAD, RPAD, SPLIT), and compare strings with explicit modes (STRING\_EQUALS, STRING\_STARTSWITH, STRING\_ENDSWITH, STRING\_CONTAINS, STRING\_INDEXOF). Additionally, new utility methods include JSON parsing, document extension (EXTEND), item extraction (ITEMS), concatenation (CONCAT), key/value retrieval (CONTAINSKEY, KEYS, VALUES), ObjectId creation time (OID\_CREATIONTIME), conditional logic (IIF, COALESCE), length calculation (LENGTH), top N selection (TOP), and vector similarity (VECTOR\_SIM).

LiteDB/Document/Expression/Methods · high confidence

New CI scripts for C\# file size enforcement and fuzzing infrastructure

This change introduces several new scripts to the CI pipeline. A pre-commit hook script (\check-csharp-size.py\) and an exceptions list (\csharp-size-exceptions.json\) now enforce maximum line counts for C\# files to prevent code bloat, with specific baselines for existing large files. Additionally, a systematic fuzzing infrastructure is added, including a script to publish fuzz artifacts (\publish-fuzz-artifacts.sh\), a tool to normalize and triage fuzz findings (\summarize-fuzz-artifacts.py\), and corresponding tests for the triage logic. Finally, new compatibility test scripts (\test-v8-differential.py\, \test-vector-compatibility.py\) are added to verify file-format compatibility between current and legacy engine versions.

scripts · high confidence

New LiteDB Shell command interface and core commands

The shell now uses a new \IShellCommand\ interface to manage commands, introducing several new interactive commands: \close\ to disconnect the current database, \ed\ to edit the last command in Notepad, \pretty\ to toggle JSON output formatting, \run\ to execute scripts from a file, \show collections\ to list database collections, and \version\ to display the LiteDB assembly version. The \open\ command has been updated to support connection strings and quoted filenames, while \help\ now dynamically scans assemblies for command metadata.

LiteDB.Shell/Commands · high confidence

New Vector Search demo tool for semantic document retrieval

A new CLI demo application (\LiteDB.Demo.Tools.VectorSearch\) has been added to showcase vector index capabilities. It provides \ingest\ and \search\ commands that use Google Gemini embeddings to index text documents (\.txt\, \.md\) into a LiteDB database and perform semantic searches using cosine similarity. The tool supports authentication via API keys or Google service accounts and includes features like document chunking, incremental updates based on content hashes, and pruning of missing files.

LiteDB.Demo.Tools.VectorSearch · high confidence

New connection string options and parameterized query helpers

The connection string parser now supports new options including \memory profile\ (Balanced, LowMemory, Throughput), \cache size\, \transaction pages\, \durable commits\, \collation\, \reject invalid local time\, and \upgrade\. The \Query\ class introduces a \Parameterized\ static helper for building safe, reusable queries with placeholders (e.g., \Query.Parameterized.EQ\), and \Query.All\ now accepts an optional \order\ argument to sort by \\_id\ or a specific field.

LiteDB/Client/Structures · high confidence

New database client interfaces and repository pattern

This release introduces a new set of client-side interfaces and implementations for LiteDB, including ILiteDatabase, ILiteCollection, ILiteQueryable, and ILiteRepository. These interfaces provide a structured way to interact with the database, supporting features like fluent querying, grouping, and repository-style data access. The LiteDatabase class now implements ILiteDatabase, offering methods for transaction management, file storage, and database maintenance. The LiteRepository class implements ILiteRepository, providing a simplified API for common CRUD operations. Additionally, the LiteQueryable class implements ILiteQueryable, enabling complex queries with filtering, sorting, and grouping capabilities.

LiteDB/Client/Database · high confidence

New engine structures for vector indexes, rebuild options, and memory profiles

The engine now includes new internal structures to support vector search capabilities (VectorIndexMetadata and VectorIndexNode), a RebuildOptions class for database rebuilds with encryption and collation settings, and MemoryProfileDefaults to configure cache sizes and transaction limits. Additional structural changes include the introduction of FileOrigin to distinguish data from log files, Pragma for internal engine variables, and TransactionPages/TransactionState for managing transaction lifecycle and dirty page tracking.

LiteDB/Engine/Structures · high confidence

New query engine with vector search and SQL generation

The query engine has been redesigned to support vector search, returning similarity scores alongside results, and includes a new SQL generation capability via the Query.ToSQL method. The engine now features a comprehensive query optimization pipeline that handles complex boolean ranges, disjunctions, and constraints for more efficient index usage, while also introducing borrowed predicate execution for improved performance in specific filter and projection scenarios.

LiteDB/Engine/Query · high confidence

New query pipeline architecture with GroupBy and optimized execution

The query engine in LiteDB/Engine/Query/Pipeline has been re-architected to support new capabilities and improved performance. A new GroupByPipe implementation now enables GROUP BY queries with HAVING support, utilizing a DocumentCacheEnumerable to manage group data. The pipeline introduces a TopN sorting mechanism (BasePipe.TopN.cs) for efficient ORDER BY with OFFSET/LIMIT, and adds an IndexAggregatePipe for optimized COUNT operations that avoid full document loading. Additionally, the QueryPipe has been updated to support 'borrowed' execution paths, allowing filters, projections, and order-by operations to be evaluated on index nodes before materializing full documents, reducing memory overhead.

LiteDB/Engine/Query/Pipeline · high confidence

New system collections for database introspection and file I/O

The engine now exposes a set of internal system collections (prefixed with $) that allow users to inspect database state and perform file operations. These include $database for engine and cache metrics, $cols and $indexes for schema details, $transactions and $snapshots for concurrency monitoring, $open\_cursors for query tracking, $sequences for auto-increment values, $page\_list and $dump for low-level page diagnostics, and $file for importing/exporting data in JSON and CSV formats. A new $query collection also enables running sub-queries via SQL.

LiteDB/Engine/SystemCollections · high confidence

New utility classes and internal infrastructure for LiteDB

This change introduces a suite of new internal utility classes in the LiteDB/Utils directory to support the engine's core operations. Key additions include AsyncManualResetEvent for asynchronous coordination, BsonNumberComparison for robust numeric value handling, and BufferSlice for efficient byte array management. The update also brings a new Tokenizer for parsing expressions, Collation for culture-aware string comparisons, and LCID for locale mapping. Supporting infrastructure includes Constants for engine limits, FileHelper for file system operations, MimeTypeConverter for file type detection, and LiteException for standardized error reporting. These components form the foundational utilities required for the database engine's query processing, storage, and error handling.

LiteDB/Utils · high confidence

Systematic fuzzing infrastructure with integrity verification and regression tracking

The LiteDB.Fuzz project now includes a comprehensive fuzzing framework that introduces database integrity verification (checking page structures, free-lists, and data chains), semantic integrity verification (validating index consistency against documents), and vector index integrity verification. The system tracks known findings and regression cases in JSON corpus files, enabling automated replay and minimization of failures. It also implements a finding registry to classify and deduplicate fuzz results, ensuring that known issues are properly tracked and fixed cases are recognized.

LiteDB.Fuzz · high confidence

Vector similarity search and indexing support

LiteDB now supports vector similarity search, allowing users to create vector-aware indexes on collections and repositories using configurable dimensions and distance metrics (Euclidean, Cosine, or DotProduct). The query API exposes new extension methods such as WhereNear, TopKNear, and WithScore on ILiteQueryable, enabling nearest-neighbor filtering, top-K retrieval, and access to similarity scores in query results. This capability is provided through new extension classes in the LiteDB.Vector namespace alongside supporting types like VectorIndexOptions and VectorSearchResult.

LiteDB/Client/Vector · high confidence

Security

Added deserialization type blacklist to prevent unsafe object instantiation

The LiteDB mapper now includes a default type binder that blocks the deserialization of specific, well-known vulnerable types (such as System.Diagnostics.Process and various XML/serialization handlers) by throwing an exception when they are encountered. This change introduces the ITypeNameBinder interface and a DefaultTypeNameBinder implementation to enforce this security constraint during deserialization.

LiteDB/Client/Mapper/TypeNameBinder · high confidence

Architecture

Refactored LiteCollection into modular partial classes

The LiteCollection API has been reorganized into distinct partial classes (Aggregate, Delete, Find, Include, Index, Insert, Update, Upsert) to improve code maintainability. This structural change preserves the existing public surface area, ensuring that all standard collection operations—such as querying, indexing, inserting, updating, and deleting—continue to function as before without requiring changes to user code.

LiteDB/Client/Database/Collections · high confidence

Repository initialization with structured development guidelines and build configuration

This change establishes the foundational structure for the LiteDB repository. It introduces AGENTS.md and CLAUDE.md to define development workflows, data safety rules, and area-specific guidance for contributors. The build system is standardized with Directory.Build.props and GitVersion.yml to automate versioning, while the solution file (LiteDB.sln) is configured to include core projects, tests, benchmarks, and a repro runner. Additionally, CI test settings are optimized with specific timeouts and parallelization controls in tests.ci.runsettings.

(repo-wide) · high confidence

Behavioural changes

Adopts GitVersion for automated semantic versioning

The build pipeline now uses GitVersion (via the dotnet-gitversion tool) to automatically calculate semantic version numbers based on git history and branch structure. New PowerShell and Bash scripts in the scripts/gitver directory replace previous manual or custom versioning logic, ensuring consistent versioning for NuGet packages and GitHub releases by resolving version details from the repository state.

scripts/gitver · high confidence

Atomic file uploads with custom ID support

The file storage API now supports custom file ID types (TFileId) and ensures that uploads are atomic: if an upload fails, the previous file version is preserved rather than left in a corrupted state. This is achieved by staging new chunks separately and only publishing them upon successful completion, while also rejecting uploads with missing or orphaned chunks to maintain data integrity.

LiteDB/Client/Storage · high confidence

BsonSerializer now uses BufferReader/Writer for serialization

The BsonSerializer class has been updated to utilize the new BufferReader and BufferWriter classes for converting BsonDocument objects to and from byte arrays. This change replaces the previous implementation with a more direct approach using these buffer-based readers and writers, which may affect performance characteristics and memory usage during BSON serialization and deserialization operations.

LiteDB/Document/Bson · high confidence

Enforce C\# file size limits via pre-commit hook

A new pre-commit hook has been added to the repository to automatically check C\# file sizes before commits are accepted. The hook executes the \scripts/check-csharp-size.py\ script, prioritizing \python3\ if available and falling back to \python\, ensuring that code changes adhere to established size constraints.

.githooks · high confidence

Honor date projection settings in covered index queries

Covered index queries now correctly respect the database's UTC date configuration. Previously, date values retrieved directly from index keys might not align with the configured time zone handling; the new \IndexLookup\ implementation detects date-bearing projections and loads the full document to apply the correct UTC/local time conversion, ensuring consistent date interpretation across all query types.

LiteDB/Engine/Query/Lookup · high confidence

Improved dictionary schema detection and expression-based member access

The reflection layer now uses a dedicated dictionary schema resolver that correctly identifies key and value types for complex generic dictionary interfaces and standard dictionary implementations, preventing incorrect mapping for opaque adapters. Additionally, the system has shifted to using compiled LINQ expressions for creating objects and accessing members, which improves performance and reliability. This change also fixes an issue where inherited private property setters were not detected during reflection, ensuring that all valid properties are correctly mapped for serialization and deserialization.

LiteDB/Client/Mapper/Reflection · high confidence

LiteEngine now exposes direct CRUD, indexing, and transaction primitives

The engine layer now provides explicit methods for managing collections and data: \DropCollection\ and \RenameCollection\ handle schema changes; \Insert\, \Upsert\, \Update\, and \Delete\ (including \DeleteMany\ and \UpdateMany\) manage document lifecycle; \EnsureIndex\ and \EnsureVectorIndex\ handle index creation; \Query\ executes read operations; \BeginTrans\, \Commit\, and \Rollback\ manage transactions; \Pragma\ allows runtime configuration; \Rebuild\ and \Recovery\ handle database maintenance and upgrades; and \RejectInvalidLocalTime\ enforces strict datetime validation. These changes shift the engine from a black-box model to one where users can directly control low-level data operations, indexing, and transaction boundaries.

LiteDB/Engine/Engine · high confidence

New SQL command parser implementation

The SQL parser in this location has been completely rewritten to support a comprehensive set of SQL commands, including transaction control (BEGIN, COMMIT, ROLLBACK), data definition (CREATE INDEX, DROP INDEX, DROP COLLECTION), data manipulation (SELECT, INSERT, UPDATE, DELETE), and maintenance operations (PRAGMA, REBUILD, RENAME, CHECKPOINT). The SELECT command now supports advanced features such as INCLUDE paths, GROUP BY, HAVING, ORDER BY with alias resolution, LIMIT/OFFSET, and FOR UPDATE. Additionally, INSERT statements now support explicit auto-id type specification (e.g., :GUID, :INT).

LiteDB/Client/SqlParser/Commands · high confidence

New borrowed BSON evaluation and serialization infrastructure

The serializer layer now introduces a borrowed evaluation model to optimize query performance. BorrowedBsonValue and BorrowedDocumentReader allow scalar values to be decoded and compared without owning document or array payloads, while BorrowedValueBuffer manages these slots using the shared ArrayPool. BufferReader and BufferWriter have been refactored to use spans and stack allocations for string handling, and BsonElementReader now clamps out-of-range DateTime values to prevent collection failures.

LiteDB/Engine/Disk/Serializer · high confidence

New bounded memory cache and disk service architecture

The disk layer has been replaced with a new bounded memory cache and disk service implementation. This introduces a CLOCK-based cache reclaimer to manage memory limits, a new DiskService that handles file validation, trailing page trimming, and durable WAL flushing (with automatic degradation on unsupported storage), and a new DiskReader that uses pooled streams for page reads. The change also adds support for vector file format promotion and crash-testing hooks within the disk subsystem.

LiteDB/Engine/Disk · high confidence

New encrypted stream implementation with improved integrity and concurrency handling

The engine now uses a new AesStream implementation for encrypted database files, introducing an AesPreamble class to validate file markers and handle interrupted creation states, which prevents corruption from partial writes. Concurrent access to underlying streams is now managed by a new ConcurrentStream wrapper that uses locking to ensure thread-safe reads and writes, and a NonClosingStream helper prevents accidental disposal of shared streams. Additionally, the TempStream class has been updated to support configurable memory limits before spilling to temporary disk files.

LiteDB/Engine/Disk/Streams · high confidence

New engine configuration and database pragma system

The engine now exposes a new \EngineSettings\ class to control database initialization, introducing options for memory profiles, cache size, transaction page limits, durable commits, and automatic rebuilds on crash. It also adds a \SharedMutexNameStrategy\ to customize how file locks are named for concurrent access. Database behavior is now managed via a new \EnginePragmas\ system that persists settings like user version, collation, timeout, and checkpoint frequency directly in the file header, allowing runtime tuning of these parameters.

LiteDB/Engine · high confidence

New engine services for locking, snapshots, and rebuild recovery

The engine now includes dedicated services in LiteDB/Engine/Services to manage concurrency and data integrity. CheckpointBackoff introduces exponential backoff for auto-checkpoints to prevent long-lived readers from stalling commits. LockService and CollectionLock handle transaction and collection-level locking, with CollectionLock using .NET 9's Lock type when available. Snapshot manages read consistency and page caching, including vector version promotion and traversal limits. RebuildService and RebuildRecovery implement a safe rebuild process with recovery markers to block access during incomplete installations. DataService and IndexService handle document and index operations with loop detection and bounded memory usage.

LiteDB/Engine/Services · high confidence

New file reader architecture for database upgrades and shrink operations

The engine now uses a dedicated \IFileReader\ interface with version-specific implementations (\FileReaderV7\ and \FileReaderV8\) to handle reading data from different database file structures. This change introduces support for upgrading databases from the older v7 format (LiteDB v4) to the current v8 format, including handling encrypted files and preserving user versions. It also enables the new shrink and rebuild processes by providing a flexible way to read and migrate data from legacy file structures without modifying the original files.

LiteDB/Engine/FileReader · high confidence

New merge-sort engine for ORDER BY with multi-key and collation support

The sort subsystem has been replaced with a new merge-sort implementation (SortService, SortContainer, SortMerge, SortDisk, SortKey, TopNSort) that supports multi-key ordering and respects the database collation. Users will see correct sort results for complex ORDER BY clauses, including descending/ascending segments and collation-aware comparisons, with improved stability and performance for large datasets.

LiteDB/Engine/Sort · high confidence

New query execution structures and GroupBy support

The query engine now uses a new internal structure for query execution, introducing a GroupBy definition and supporting multi-key query ordering. This change includes a new GroupBy structure, OrderBy definition, and query plan structures, enabling more complex query operations and improved query optimization.

LiteDB/Engine/Query/Structures · high confidence

New tokenizer-based JSON serialization and deserialization

LiteDB now uses a new tokenizer-based engine for JSON operations, replacing the previous implementation. This change improves the accuracy of numeric parsing and serialization: integers are now parsed into the narrowest fitting type (Int32, Int64, Decimal, or Double) to preserve precision, and double values are serialized using a shortest-text algorithm that guarantees round-trip fidelity. The new system also correctly handles special floating-point values (NaN, Infinity, negative zero) by serializing them as null or preserving their bit patterns, and supports extended data types like $numberLong and $numberDecimal.

LiteDB/Document/Json · high confidence

New tokenizer-based expression parser with MAP, FILTER, and SORT support

The expression parser in LiteDB has been replaced with a new tokenizer-based engine that supports a richer set of query operations. Users can now use MAP, FILTER, and SORT functions to transform, filter, and order data within expressions. The parser also introduces new operators including LIKE, BETWEEN, and IN, along with logical operators AND/OR and arithmetic operations. It handles scalar-to-enumerable conversions, supports collation for string comparisons, and allows parsing of integers larger than Int32.MaxValue as Int64 or Decimal. The new system also supports vector similarity calculations via the VECTOR\_SIM function and improves handling of nested expressions and parameters.

LiteDB/Document/Expression/Parser · high confidence

Redesigned BsonExpression engine with compiled caching and borrowed-field evaluation

The expression evaluation system has been completely redesigned to improve performance and reduce memory overhead. Expression parsing and compilation are now cached, with a global \CacheEnabled\ switch for diagnostics, and scalar predicates use deferred compilation to avoid retaining unused parse trees. A new 'borrowed' evaluation model (BorrowedPredicateEvaluator, BorrowedProjectionEvaluator, BorrowedScalarEvaluator) allows queries to operate on borrowed field slots, enabling efficient projections and sorting without creating owning source documents. Additionally, expressions can now be bound to specific parameter documents via \Bind()\, and streaming aggregation is supported for single-pass scalar aggregates.

LiteDB/Document/Expression · high confidence

Redesigned BsonMapper with improved concurrency and deserialization hooks

The BsonMapper has been refactored to improve thread safety and deserialization flexibility. Concurrent access to the mapper is now handled via a ConcurrentDictionary and atomic initialization logic to prevent race conditions. A new OnDeserialization hook allows users to intercept and modify values before they are deserialized. Additionally, the mapper now supports cloning to create independent instances with shared configuration, and constructor-bound members are populated more reliably using a new ConstructorScope mechanism.

LiteDB/Client/Mapper · high confidence

Redesigned page storage architecture with new page types

The internal storage engine has been refactored to use a new page-based structure, introducing distinct page types for Header, Collection, Data, Index, and Vector Index data. This change replaces the previous memory-file and block-based approach with a more robust system that includes dedicated pages for managing free space slots, transaction IDs, and WAL confirmation states, significantly altering how data and indexes are persisted on disk.

LiteDB/Engine/Pages · high confidence

Refactored disk I/O to use a new StreamFactory and StreamPool architecture

The disk layer has been restructured to use a new \IStreamFactory\ interface with two implementations: \FileStreamFactory\ for persistent data files and \StreamFactory\ for in-memory or temporary streams. This change introduces a \StreamPool\ to manage concurrent read access and a single writer, improving thread safety and resource management. Key behavioral updates include handling encrypted files by reserving the first page for salt, checking file sizes against \PAGE\_SIZE\ to detect interrupted creations, and supporting hidden file attributes on creation.

LiteDB/Engine/Disk/StreamFactory · high confidence

Refactored index query execution into a dedicated Index class hierarchy

The engine's index search operations have been restructured into a new \LiteDB.Engine.Query.IndexQuery\ namespace, introducing an abstract \Index\ base class and specialized implementations (\IndexEquals\, \IndexRange\, \IndexLike\, \IndexIn\, \IndexScan\, \IndexAll\, \IndexNotEquals\, \IndexRangeUnion\, \IndexVirtual\, and \VectorIndexQuery\). This change replaces the previous monolithic query logic with a modular system where each operator (seek, range, full scan, virtual, and vector search) is handled by its own class, enabling distinct cost calculations, execution strategies, and support for features like SQL-like pattern matching with collation awareness and vector similarity search.

LiteDB/Engine/Query/IndexQuery · high confidence

Refactored low-level buffer and string handling utilities

The utility extensions in LiteDB have been reorganized and optimized. Buffer serialization now uses direct unsafe pointer writes for integers and byte arrays, with a specific fix for 32-bit ARM alignment issues on Int64/UInt64 to prevent crashes. Guid handling now leverages native Span-based methods on .NET 8+ while maintaining compatibility with older frameworks. String operations have been updated to support complete and terminating LIKE wildcard matching, and connection string parsing now correctly handles quoted values and special characters like equals signs in file paths.

LiteDB/Utils/Extensions · high confidence

Rewritten LINQ expression translation with caching and improved enum handling

The LINQ query translation engine has been refactored to use a new shared query IR and optimized execution pipeline. This change introduces a caching mechanism (LinqExpressionCache) to reuse compiled BsonExpression templates, significantly improving query performance for repeated patterns. It also adds systematic handling of captured constants and closures via LinqBindingEvaluator, ensuring that runtime values are correctly bound without aliasing issues. Additionally, the translation now safely handles row-dependent enum equality comparisons, addressing previous limitations where such comparisons might fail or produce incorrect results.

LiteDB/Client/Mapper/Linq · high confidence

Test coverage

Added SharedMutexHarness test tool for validating cross-process mutex behavior; Added benchmark for file metadata generation; Added comprehensive unit tests for BsonExpression execution and caching; Added comprehensive unit tests for query execution and optimization; Added insertion performance benchmarks; Added legacy .NET Framework fuzzing harness; Added memory regression benchmarks for LiteDB; Added query performance benchmarks; Added stress testing framework for LiteDB; Added test fixtures and documentation for dictionary serialization compatibility; Added test model classes for Person and Zip entities; Added test utility infrastructure for LiteDB; Added tests for custom BsonMapper inheritance and collection serialization; Added tests for fuzz reliability, corpus management, and finding deduplication; Added tests for the LiteDB Repro Runner CLI; Added unit tests for LiteDB database operations; Added unit tests for LiteDB internals; Expanded engine test coverage for collation, vector promotion, and concurrency; Expanded mapper test coverage for LINQ, serialization, and caching; Expanded regression and fuzzing test coverage for database stability; Expanded test coverage for document serialization, vector similarity, and type handling; New internal tooling for memory, query, and performance validation.

Dependencies

Migrate to .NET 10 and add .NET 8 support

LiteDB and its associated tooling (Shell, Benchmarks, Stress tests) have been updated to target .NET 10, with .NET 8 added as a supported framework for the core library and various tools. The test suite now targets net462, net481, net8.0, and net10.0, and several new projects have been introduced for fuzzing, repro runners, and vector search demos, all leveraging the updated .NET versions.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 61.

Lenses

  • Code Health 62
  • Architecture 91
  • Maturity 60
  • Readiness 64
  • Security 61
  • Performance 59

Changes since last survey

  • 300 commits — 182 feature/other, 118 fixes

By area

  • LiteDB.Tests/Issues — 77 commits
  • LiteDB/Engine — 51 commits
  • (repo) — 41 commits
  • LiteDB/Client — 36 commits
  • .github/workflows — 21 commits
  • LiteDB.Tests/Engine — 18 commits
  • (root) — 9 commits
  • LiteDB.Tests/Internals — 7 commits
  • LiteDB.Tests/Query — 6 commits
  • LiteDB/Document — 4 commits
  • LiteDB.ReproRunner/LiteDB.ReproRunner.Cli — 3 commits
  • LiteDB.Tests/Expressions — 3 commits
  • docs/memory-management-todo.md — 3 commits
  • docs/memory-measurements — 3 commits
  • LiteDB.Fuzz/Targets — 2 commits
  • LiteDB.Tests/Database — 2 commits
  • LiteDB.Tests/Document — 2 commits
  • docs/memory-management-benchmark-results.md — 2 commits
  • docs/memory-management-proposal.md — 2 commits
  • LiteDB.Shell/Commands — 1 commit

Notable commits

  • fix: Add failing Min and Max regression tests
  • fix: Add memory regression coverage
  • fix: Add red System.Index regression tests
  • fix: Add regression test
  • fix: Add regression test for System.Index deserialization
  • fix: Add review regression coverage
  • fix: Clarify aggregate regression test scope
  • fix: Confirm rollback bug in dev
  • fix: Enable the hosted bugfix sweep scheduler [skip ci]
  • fix: Feat/fix mutexes (#2711)
  • fix: Fix #1159: make repeated member ignores idempotent
  • fix: Fix #1162 Expando document mapping
  • fix: Fix #1166 open quoted shell filenames
  • fix: Fix #1644 defer boolean compilation until execution
  • fix: Fix #1706 choose efficient range starts consistently
  • fix: Fix #1759: alignment-safe ToBytes for Int64/UInt64 (SIGBUS/BUS_ADRALN on 32-bit ARM) (#2762)
  • fix: Fix #2144: preserve collation semantics in indexed LIKE queries
  • fix: Fix #2190: avoid duplicate id element enumeration (#2758)
  • fix: Fix #2211: allow equals signs in database file paths (#2757)
  • fix: Fix #2225: recover inherited private property setters
  • …and 280 more

Architecture

  • 11 containers · 2 bounded contexts · 0 dependency edges (baseline)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

litedb-org/LiteDB was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 0fd277aaed127b9dec99524277fb4173a2351167 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.