Xod 2.0.1

dotnet add package Xod --version 2.0.1
                    
NuGet\Install-Package Xod -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xod" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xod" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Xod" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xod --version 2.0.1
                    
#r "nuget: Xod, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Xod@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xod&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Xod&version=2.0.1
                    
Install as a Cake Tool

XOD

XOD

An embedded database for .NET. Your objects go in, files you can read come out.

NuGet version NuGet downloads Apache-2.0 .NET 8 and 9 60 tests passing

XOD 2.0 starts here. The 2017 library (0.1.x) is on the legacy branch.


using Xod;

using var db = new XodContext("app.xod");

db.Insert(new Customer { Name = "Nadia", Orders = { new Order { Status = "open" } } });

var open = db.Query<Order>(o => o.Status == "open").ToList();

There is no server to install, no port to open and no migration between versions of your model. You point XOD at a folder, and your classes are the schema.

The files are the point

Open an XML database in an editor and you find rows, not a binary blob:

<Row code="9b2e14c1"><Customer>
  <Id>1</Id>
  <Name>Nadia</Name>
  <Orders refType="children">
    <Order refType="children"><Id>1</Id><Status>open</Status></Order>
  </Orders>
</Customer></Row>

That means git diff shows what changed, a backup is a folder copy, and a support ticket can include the data. JSON and Brotli-compressed binary formats are available for the same database, and XodMigrator switches between them without your model assembly.

Getting started

dotnet add package Xod
public class Customer
{
    public int Id { get; set; }
    public string Name { get; set; }

    [Children]
    public List<Order> Orders { get; set; }
}

public class Order
{
    public int Id { get; set; }
    public int CustomerId { get; set; }
    public string Status { get; set; }

    [ParentKey(nameof(CustomerId))]
    public Customer Customer { get; set; }
}

Relationships are ordinary collections. Primary keys, unique keys and secondary indexes are attributes on the properties you already have. Writes are transactional and journal to .xwal, so a process killed mid-write comes back whole.

Numbers

One Windows machine, 100,000 rows, same schema and same operations for each engine. Full detail, raw result files and the losing metrics are on the benchmark page in the xod-site repository.

250 MB XOD (XML) SQLite LiteDB
Bulk load 1,183 ms 2,037 ms 2,487 ms
1,000 lookups by key 4.5 ms 7.1 ms 41.6 ms
20 indexed queries 20 ms 43 ms 119 ms
Page to row 90,000 0.2 ms 20 ms 154 ms
100 updates + 100 deletes 51 ms 4.9 ms 18 ms
Size on disk 254 MB 395 MB 293 MB
Peak memory 410 MB 455 MB 692 MB

Fastest in each row is in bold.

Bulk loads and reads are the strong side. Single-row updates and deletes are not: SQLite does them about ten times faster, and at 1 GB the gap widens. If your workload is many small writes in a tight loop, SQLite is the better tool.

Where it fits

XOD is for applications that own their data: a desktop app, a service with its own folder, a device with no room for a server. Bulk loads, lookups, indexed queries and paging are where it is fastest, and the whole database is a directory you can copy or commit.

It is not the right tool for every job:

  • Several processes writing to one database. One process owns the folder at a time. Inside that process XOD is concurrent - many readers and a queued writer, the case the 140,000 reads/second figure measures - but it is a library, not a shared server. If several services must write the same data, use a server database.
  • A tight loop of single-row writes. SQLite is faster at that operation - about ten times on the 250 MB set, and more at 1 GB. XOD spends its effort on bulk load, reads and paging instead.
  • Replication, clustering or network access. XOD is a library, not a service.
  • Bulk relational graphs. Inserting and loading customer/order/line graphs is the benchmark where XOD trails SQLite today. If that is your dominant workload, measure both before choosing.

The full numbers, including the cases above, are on the benchmark page.

What is in the box

Concurrency is per table: many readers and a queued writer inside the process that owns the folder. Transactions with a write-ahead journal; primary, unique and secondary indexes; one-to-many, many-to-many and self joins; cascade delete; [Required] validation; AES-256-GCM property encryption; Select<T>(skip, take) streaming; record, DateOnly, TimeOnly and Dictionary<K,V>; and a command-line tool for stats, conversion and encryption.

The engine targets .NET 8 and .NET 9. The test suite covers the API, stress, referential integrity, crash safety, migration from a real 1.x database, format equivalence, a million rows, a differential check against SQLite and the public API surface: 54 tests, no skips, green on Windows and Linux. The release gate is in docs/TEST-PLAN-2.0.md.

Licence

Apache-2.0. Versions published before 2.0.0 (the 0.1.x line and the 1.0.0 betas) were MIT and stay under those terms. See NOTICE.

If XOD saves you time, sponsoring the project or a paid support arrangement keeps it maintained. Issues and pull requests are welcome; for anything large, please open an issue first so we can agree on the shape.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 48 11/7/2026
2.0.0 51 11/7/2026
0.1.1031 1,898 4/1/2017
0.1.103 1,568 3/31/2017
0.1.102 1,517 3/21/2017
0.1.101 1,573 3/17/2017
0.1.1 1,594 3/7/2017
0.1.1-beta-build-04 1,175 12/26/2016
0.1.1-beta-build-03 2,055 11/2/2016
0.1.1-beta-build-02 1,317 9/23/2016
0.1.1-beta 2,196 9/19/2016
0.1.0-beta 1,276 9/1/2016

2.0.1: the package page README renders on nuget.org (no library change from 2.0.0). XOD 2.0: a rework of the 2017 library. Versions before 2.0.0 (0.1.x and the 1.0.0 betas) were MIT; 2.0.0 is Apache-2.0. Notes and migration guide: https://github.com/mhsallam/xod