OhmDB - The Irresistible Database for Java - JAR Running in Your JVM - Combining Great RDBMS and NoSQL Features

The Irresistible database for Java

OhmDB is "the irresistible database" that offers the power of relational databases and the flexibility of NoSQL databases.

Easy to use

OhmDB db = Ohm.db("my.db");
Table<Item> items = db.table(Item.class);
long id = items.insert(new Item("item1"));

Easy setup and maintenance

Just add ohmdb.jar to your project, and you are ready! All data is stored in a single file (e.g. my.db), which makes backups/duplications super-simple!

Type-safe queries

Item i = items.queryHelper();
Search<Item> it = items.where(i.title).eq("item1").and(i.published).eq(true);

Full ACID transactions

Full support for ACID transactions, providing the same high level of data safety as relational databases. After unexpected termination, OhmDB automatically detects and rollbacks unfinished transactions.

Type-safe relations

OneToMany<Item, Tag> tagged = db.oneToMany(items, "tagged", tags);
tagged.link(item1, tag1);
tagged.delink(item2, tag2);

Very fast joins with graph-based relations

A single join has O(1) time complexity. A combination of multiple joins is internally processed as graph traversal with smart query optimization.

Elegant inner and outer joins

Search<Item> publishedItems = items.where(i.published).eq(true);
JoinResult publishedItemsWithTags = db.join(publishedItems, tagged, tags.any()).all();

Serializable transaction isolation

OhmDB executes transactions with serializable isolation level. This is the highest isolation level, and protects against bugs caused by read phenomena (dirty reads, non-repeatable reads, phantom reads).

Your custom Java triggers

db.before(Item.class).inserted().or().updated().run(new LoggingTrigger<Item>());

OhmDB vs RDBMS vs NoSQL - No Silver Bullet!

Data complexity Unlimited Unlimited Limited
Relations Graph-based Yes Graph-based or none
JOINS Fast Slow Fast or none
Transactions ACID ACID Limited
Schema Strict Strict Flexible
Schema migration Automatic Manual Automatic
Agile-friendly Yes No Yes
Data capacity Limited to RAM Unlimited Unlimited
Scale Up Yes Yes Yes
Replication Not yet Yes Yes
Partitioning Not yet Yes Yes

Let's learn Java 8 at java8.org!

Fork me on GitHub