Start here

XOD documentation

XOD is an embedded, object-oriented database for .NET 8 and .NET 9. Your classes are the schema, and your data stays in files you can open, diff and commit.

XOD runs inside your application. There is no server to install, no port to open and no connection string. You point it at a folder, hand it your objects, and it stores them as pages of XML, JSON or compressed binary, with indexes and transactions.

These pages describe the current release. Upgrading from an earlier 2.x version? See Upgrading.

using Xod;

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

db.Insert(new Customer { Name = "Nadia" });

var nadia = db.Find<Customer>(c => c.Name == "Nadia");

What you get

  • Your objects, not a mapping layer. Insert a plain C# class, query it with a lambda and get the same type back. There are no migration files or generated code, and SQL SELECT is built in when you want joins, grouping or reports (see Querying with SQL).
  • Transactions. BeginTransaction() groups writes that must land together. Its commit writes an undo journal first: if a process crash cuts the commit short, the database is put back as it was before the transaction at the next open. Writes outside a transaction aren’t journalled (see Transactions and durability).
  • Indexes. Primary keys, unique keys and secondary indexes are attributes on properties you already have.
  • Relationships. Parents and children (one-to-many) and single references (one-to-one). Deleting a parent always deletes its children.
  • Three storage formats. Readable XML (the default), readable JSON, or Brotli-compressed binary, with one tool to convert between them.
  • Security built in. A password-protected database, and per-property hashing or AES-256-GCM encryption.
  • Concurrent inside one process. Many readers at once, with writes serialized one at a time.

Where to go next

If you want to Read
Install XOD and store your first objects Getting started
Choose keys, indexes and property types Modelling data
Link objects to each other Relationships
Query, page and count Reading data
Insert, update and delete Writing data
Group writes and control when they reach the disk Transactions and durability
Pick XML, JSON or binary, or convert a database Storage formats and files
Protect the database or a single property Passwords and encryption
Look up a method, option, attribute or exception Reference

Requirements

  • .NET 8 or .NET 9, on Windows, Linux or macOS.
  • The Xod package from NuGet. It has no other dependencies.

XOD is open source under the Apache-2.0 licence. The code, issues and release notes are on GitHub. How fast it is, with every run’s raw file, is on the benchmarks page.

Source on GitHub · Report a problem with this page