Xodus-DNQ: What is it?


Some time ago, JetBrains released and open-sourced the Xodus-DNQ project. Xodus-DNQ is a Kotlin library that contains a data definition language and queries for Xodus. Xodus is a transactional, schema-less, embedded database that is written in Java and is also developed by JetBrains. Its first release was in July, 2016.

Xodus development started many years ago when YouTrack needed an embedded database that would meet its product performance requirements. Originally, it was implemented as an efficient Berkeley DB replacement, and today the benchmarks show that this goal was definitely achieved.

At present, both YouTrack and Hub use Xodus as a database. While this database doesn’t require a schema, the data tables are mimicked using entity types (like “Issue”, “Project”, and “User”). One entity is similar to a single table record in a schema-driven database. To represent these types, YouTrack and Hub both use Xodus-DNQ for persistent layer definition.

To give you some real-world performance examples, have a look at our own YouTrack and Hub installations. These contain nearly 1,6 million entities of the “Issue” type, about 1,6 million records of the “AuditEvent” type, more than 21 million entries of various issue history “Event”s, not to mention the numerous entities of other types. In short, it’s a lot of data that relies on Xodus for persistence and Xodus-DNQ for data definition.

If you have already used Xodus, you know that it provides a very simple API that is based on operating generic “Entity” instances:

Xodus-DNQ significantly improves your experience by letting you define a persistent meta-model using Kotlin classes, including various properties types, parameters, constraints and triggers.

Also, Xodus-DNQ lets you build efficient database queries using a variety of operations like filtering, sorting, and mapping. Here’s a few examples:

Xodus and Xodus-DNQ are available in Maven. You are very welcome to give them a try right away!

If you have any questions, don’t hesitate to contact us in GitHub or Stack Overflow.

About Mariya Davydova

Mariya Davydova is YouTrack Developer Advocate at JetBrains. Her professional interests include issue tracking as well as machine learning and artificial intelligence. Apart from work, she is an experienced needlewoman and a loving wife and mom.
This entry was posted in news, newsletter, release and tagged , . Bookmark the permalink.

2 Responses to Xodus-DNQ: What is it?

  1. allnex says:

    Tried implementation 'org.jetbrains.xodus:dnq:1.2.419' but it couldn’t find this libraries:


    • Mariya Davydova says:

      We are sorry for the inconvenience.
      We have fixed this problem, a new build (1.2.420) is already available in Maven.

Leave a Reply

Your email address will not be published. Required fields are marked *