Home

Awesome

<a href="https://github.com/JetBrains/xodus/wiki"><img src="https://raw.githubusercontent.com/wiki/jetbrains/xodus/xodus.png" width=160></a>

official JetBrains project Maven Central Last Release License Pure Java + Kotlin Stack Overflow

JetBrains Xodus is a transactional schema-less embedded database that is written in Java and Kotlin. It was initially developed for JetBrains YouTrack, an issue tracking and project management tool. Xodus is also used in JetBrains Hub, the user management platform for JetBrains' team tools, and in some internal JetBrains projects.

Hello Worlds!

To start using Xodus, define dependencies:

<!-- in Maven project -->
<dependency>
    <groupId>org.jetbrains.xodus</groupId>
    <artifactId>xodus-openAPI</artifactId>
    <version>2.0.1</version>
</dependency>
// in Gradle project
dependencies {
    implementation("org.jetbrains.xodus:xodus-openAPI:2.0.1")
}

Read more about managing dependencies.

There are two different ways to deal with data, which results in two different API layers: Environments and Entity Stores.

Environments

Add dependency on org.jetbrains.xodus:xodus-environment:2.0.1.

try (Environment env = Environments.newInstance("/home/me/.myAppData")) {
    env.executeInTransaction(txn -> {
        final Store store = env.openStore("Messages", StoreConfig.WITHOUT_DUPLICATES, txn);
        store.put(txn, StringBinding.stringToEntry("Hello"), StringBinding.stringToEntry("World!"));
    });
}

Entity Stores

Add dependency on org.jetbrains.xodus:xodus-entity-store:2.0.1, org.jetbrains.xodus:xodus-environment:2.0.1 and org.jetbrains.xodus:xodus-vfs:2.0.1.

try (PersistentEntityStore entityStore = PersistentEntityStores.newInstance("/home/me/.myAppData")) {
    entityStore.executeInTransaction(txn -> {
        final Entity message = txn.newEntity("Message");
        message.setProperty("hello", "World!");
    });
}

Building from Source

Gradle is used to build, test, and publish. JDK 1.8 or higher is required. To build the project, run:

./gradlew build

To assemble JARs and skip running tests, run:

./gradlew assemble

Find out More