Doma review
A self-hosted database framework for teams that want generated, type-safe queries.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Doma is an open-source database access framework for Java and Kotlin teams that want DAO-oriented mapping and query construction with static type safety. It provides a Unified Criteria API and SQL builders for search, insert, update, and delete, along with SQL templates and entity mapping. Compile-time checks and annotation processing generate source code and metamodels; developers can also inspect generated SQL without executing it. It is a library to deploy within a self-hosted application, rather than a hosted database service, and its published use cases span solo projects through enterprise teams.
The central distinction is how Doma balances generated queries with SQL control. The criteria and builder APIs support structured query construction, while SQL templates with conditional directives provide another way to express queries. A raw SQL escape hatch is available, and dialect configuration covers DB2, H2, HSQLDB, Microsoft SQL Server, MySQL, Oracle Database, PostgreSQL, and SQLite. Static type safety and query compilation suit teams that value checks during compilation; teams needing asynchronous queries should look elsewhere, since that capability is not supported.
Doma fits Java and Kotlin applications that can include a database library in their own deployment and want generated code rather than a hosted query service. Documentation covers Spring Boot and Quarkus integrations, and Kotlin usage is through the separate doma-kotlin library. The project is published under the Apache-2.0 license, with documentation and community support. Its focus is database access and mapping, not a managed environment or a broad application platform. Choose it when compile-time query checks, DAO mapping, and dialect options match the team's stack; consider another approach if asynchronous query support or a managed service is a requirement.
Doma pros and cons
- Where it wins
- Compile-time checks and generated metamodels catch query issues during compilation.
- Criteria and SQL builder APIs cover search, insert, update, and delete.
- Eight SQL dialects plus Spring Boot and Quarkus integrations.
- Where it doesn't
- Self-hosted library, not a managed database service.
- Asynchronous queries are not supported.
- Kotlin projects use the separate doma-kotlin library.
Doma fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. How we rank.
Last updated · How we research and update