Xod 2.0.2
See the version list below for details.
dotnet add package Xod --version 2.0.2
NuGet\Install-Package Xod -Version 2.0.2
<PackageReference Include="Xod" Version="2.0.2" />
<PackageVersion Include="Xod" Version="2.0.2" />
<PackageReference Include="Xod" />
paket add Xod --version 2.0.2
#r "nuget: Xod, 2.0.2"
#:package Xod@2.0.2
#addin nuget:?package=Xod&version=2.0.2
#tool nuget:?package=Xod&version=2.0.2
XOD
An embedded database for .NET. Your objects go in, files you can read come out.
Documentation · Getting started · API reference · Benchmarks
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() { 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. When writes must land together or not at all, even across a process crash, use a transaction: a commit that a crash cuts short is undone at the next open.
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 commit 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) paging; SQL SELECT from .NET and the xod query command; 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, with no skips, 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 | Versions 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. |
-
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.2.0 | 92 | 11/28/2026 |
| 2.1.0 | 127 | 11/18/2026 |
| 2.0.3 | 128 | 11/16/2026 |
| 2.0.2 | 149 | 11/14/2026 |
| 2.0.1 | 111 | 11/7/2026 |
| 2.0.0 | 102 | 11/7/2026 |
| 0.1.1031 | 1,908 | 4/1/2017 |
| 0.1.103 | 1,576 | 3/31/2017 |
| 0.1.102 | 1,526 | 3/21/2017 |
| 0.1.101 | 1,579 | 3/17/2017 |
| 0.1.1 | 1,604 | 3/7/2017 |
| 0.1.1-beta-build-04 | 1,181 | 12/26/2016 |
| 0.1.1-beta-build-03 | 2,064 | 11/2/2016 |
| 0.1.1-beta-build-02 | 1,327 | 9/23/2016 |
| 0.1.1-beta | 2,203 | 9/19/2016 |
| 0.1.0-beta | 1,283 | 9/1/2016 |
2.0.2: XOD SQL (SELECT) in .NET and the xod CLI; every context holds the database's and the folder's lock files; values, maps and lists read back as written; a failed commit is undone at once, and one a crash cut short at the next open; a password change is all or nothing; property encryption with a key of the database's own; autonumber seeds and increments. Some behaviour changes: read https://xod.sabaeon.com/docs/upgrading before upgrading. All notes: https://github.com/mhsallam/xod/blob/main/docs/RELEASE-NOTES-2.0.2.md. 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. Migration guide from 1.x: https://github.com/mhsallam/xod/blob/main/docs/MIGRATION-GUIDE.md