What is Micronaut Data
5.2.xMicronaut Data is a database access toolkit that uses Ahead of Time (AoT) compilation to pre-compute queries for repository interfaces. These queries are then executed by a thin, lightweight runtime layer.
Key advantages over traditional frameworks like Spring Data or GORM include:
- No runtime model: Does not maintain a runtime metamodel using reflection, reducing memory consumption.
- No query translation at runtime: Queries are translated from method definitions into actual queries by the Micronaut compiler at compilation time, rather than using regex or pattern matching at runtime.
- No Reflection or Runtime Proxies: Improves performance and reduces memory usage by avoiding reflection caches and runtime proxies (though the underlying driver, like Hibernate, may still use reflection).
- Type Safety: The compiler actively checks that repository methods can be implemented, failing the build if a method cannot be translated into a valid query.