Database

Store, index and query large collections of XML and other data

At its core, BaseX is a native XML database. Documents are stored in a compact format that is optimized for fast navigation and updates, indexes are created and used automatically, and everything can be queried and updated with XQuery.

Lightweight Databases

Create a database with a single command, from XQuery, in the GUI or via an API. Resources are addressed by their path, collections are created implicitly, and a single query can access any number of databases.

Resource Types

Store XML documents, binary files and XQuery values side by side. Binary files are kept unchanged, and maps and arrays can be stored for fast retrieval.

Indexes

Compact text, attribute, token and full-text indexes speed up queries by orders of magnitude. Queries are rewritten to use them automatically, and all indexes, including the full-text index, are kept up to date with every update.

Scalability

A single database can hold up to 2 billion XML nodes and more than 500 million resources. Real-world databases, such as Wikipedia history dumps, exceed 400 GiB. Larger data sets can be distributed across multiple databases.


Import

Add XML documents, or convert JSON, CSV and HTML files to XML while importing them.

Updates

Add, replace, rename and delete resources, and update individual nodes with the W3C XQuery Update Facility.

Transactions

Queries and updates are executed as ACID-safe transactions, and read operations run concurrently.

XQuery Access

The Database module lets you create, query, update and export databases from within XQuery – the same features are available as commands and in the GUI.

Main-Memory Databases

Create temporary databases in main memory for even faster processing.

Backups and Export

Create and restore backups of your databases, and export their contents to the file system.