Familiar Tasks.
Simpler Solutions.

Task-focused tutorials for engineers coming from JPA, Hibernate, or Exposed, plus how-to recipes for Storm itself. Each comparison takes a persistence task you already know, shows both approaches side by side, and lets you inspect the SQL they produce.

//Start hereNew to Storm? Build a complete REST API from an empty project, then use the task recipes below as you go.
//From JPAYou know Spring Data JPA and Hibernate. Each tutorial shows a task the JPA way and the Storm way, side by side.
Solving the N+1 problem→
Why a JPA list query over a lazy relation runs 1 + N selects, what JOIN FETCH, entity graphs and batch fetching change, and how Storm decides loading in the entity model.
JPA to Storm7 min readKotlin
Projections: read-only views on your data→
A Storm projection is a read-only type over a table, a database view or a SQL query, with a repository without write methods, typed predicates and nesting. In JPA the same job falls to Hibernate's @Immutable and @Subselect.
JPA to Storm5 min readKotlin
Typed query results without an entity→
Spring Data JPA shapes custom results with interface projections and constructor expressions. In Storm, any data class whose constructor matches the selected columns is a result type, for the query builder and for full SQL.
JPA to Storm5 min readKotlin
Pagination and keyset scrolling→
Offset pages cost more the deeper they go, and a total takes a count query. Storm reads pages and slices by offset, scrolls by keyset with cursors a client sends back, and logs advice when a count is slow or an offset is deep.
JPA to Storm6 min readKotlin
Upserts in one statement→
Spring Data JPA saves an entity with an assigned key by reading it first. Storm sends the database's own upsert, keyed on the primary key, on every supported database.
JPA to Storm4 min readKotlin
Optimistic locking with immutable entities→
JPA checks the version when the persistence context flushes, usually at commit. Storm checks it on the update call, with the version the entity carries, and transaction(retries = 2) reruns a block that lost a conflict.
JPA to Storm5 min readKotlin
Transactions as blocks→
@Transactional applies through a proxy, which skips self-invocation in its default mode. Storm's transaction blocks put the scope in the code, register onCommit callbacks inline, rerun on deadlocks with retries, and run as suspend functions.
JPA to Storm6 min readKotlin
Mapped collections vs queried associations→
owner.pets is one property access. Storm queries the association instead: one line that loads when you call it, takes filters, paging and many owners at once, and keeps working when the join table gains columns.
JPA to Storm6 min readKotlin
Persisting object graphs: cascades vs write sets→
CascadeType configures, once per mapping, how far every persist travels. A Storm write set decides per call: pass the entities, and Storm inserts their unsaved parents first, in dependency order, with generated keys filled in.
JPA to Storm6 min readKotlin
Full SQL with your model→
A native query is SQL text the entity model does not see. Storm's SQL templates bind interpolated values as parameters, map rows onto data classes, and expand entity types and metamodel paths into columns, joins and aliases.
JPA to Storm6 min readKotlin
//From ExposedYou know and like JetBrains Exposed, with good reason. Same format: the Exposed way next to the Storm way.
One model instead of three→
Exposed and Storm are both type-safe Kotlin data layers. They differ in where joins and row mappings live: Exposed writes them with each query, Storm declares them once in the data class.
Exposed to Storm5 min readKotlin
Ktor services, side by side→
Exposed needs a transaction around every operation, reads included. Storm installs as a plugin, reads without one, and covers writes with suspend transaction { } blocks and transactional { } routes.
Exposed to Storm5 min readKotlin
Eager loading and N+1→
Exposed DAO references load lazily, and .with() batches them into one query at each call site. Storm decides loading in the model: an entity field is joined, a Ref field loads when your code asks.
Exposed to Storm5 min readKotlin
Transactions translate almost one to one→
Exposed and Storm agree that transactions are explicit blocks. A translation table for the settings you know, plus where they differ: what reruns and timeouts cover, propagation per block, and after-commit callbacks.
Exposed to Storm5 min readKotlin
Queries and full SQL→
Everyday Exposed queries translate to Storm almost line by line, without the row mapping. For SQL written as text, exec() hands you the ResultSet; Storm's SQL templates map rows onto data classes and bind interpolated values.
Exposed to Storm5 min readKotlin
Upserts and batching→
Both libraries write the database's own upsert. Exposed can target any unique index and shape the update per call; Storm resolves on the primary key and returns the entity.
Exposed to Storm4 min readKotlin
Who owns the schema→
Exposed creates tables from its table objects, which suits prototypes. Storm leaves the schema to your migrations and validates the entities against it at startup.
Exposed to Storm4 min readKotlin
//The Storm wayAlready using Storm? Task recipes, no comparisons, straight to the point.
Search and suggest on your own database→
A search page and a type-ahead box with two predicates. Input goes in as typed, matches the same way on every database, finds owners through their pets, and runs on an ordinary trigram index.
The Storm way7 min readKotlin
Statement advice: what to change, and why→
Storm builds every statement, so it knows the shape, the entity graph, the indexes and what each transaction repeated. The log names the problem, the fix and the trade-off, at no cost per execution.
The Storm way8 min readKotlin
Validate input end to end→
A form posts an owner. The request type rejects product rules, the column rejects a value too long, the unique constraint rejects a duplicate, and one handler answers with the field that failed.
The Storm way6 min readKotlin and Java
Testing your data layer with @StormTest→
One annotation gives you an in-memory database, schema scripts, per-test rollback and injected parameters. Assert results and the SQL that produced them, then run the same tests against PostgreSQL with one attribute.
The Storm way4 min readKotlin
Streaming large result sets→
Process millions of rows in bounded memory: resultFlow streams rows as they arrive, windows(size) frees the connection for loops that write, and lists or Flows batch the write direction.
The Storm way4 min readKotlin
Sealed entity hierarchies→
Map a Kotlin sealed interface to one table: subtypes are data classes, the discriminator picks the type on read, each subtype is an entity of its own, and when over results is exhaustive.
The Storm way4 min readKotlin
JSON columns in relational entities→
Mark a field @Json and maps, lists and structured objects are written as JSON and read back typed. JSON aggregation loads a one-to-many in a single query.
The Storm way4 min readKotlin
Auditing with entity callbacks→
Stamp createdAt and updatedAt with an EntityCallback. Entities are immutable, so a before-hook returns a changed copy; the entity, the template, Spring or Ktor registers it.
The Storm way4 min readKotlin
Seeing what Storm does→
The SQL log shows every statement where it executes, TRACE adds the values, per-request summaries show what a call cost, and the slow statement log names the execution that took too long.
The Storm way4 min readKotlin
In progress
Converters and custom types Composite and natural keys Entity caching and dirty checking

Want one of these sooner, or a topic that is not listed? Open an issue on GitHub.