Micronaut Predator unveiled – faster data access for microservices
Object Computing, Inc.’s Micronaut team has unveiled a new open source project to improve runtime and memory performance of data access repository logic. The release announcement reports almost 4X faster performance and the possibility for much lighter microservices. Let’s see what this is all about.
The newly unveiled Predator wants to help Java users get the most out of their code by significantly increasing performance and speeding up cold starts. How? In Micronaut’s words:
Predator — short for Precomputed Data Repositories — uses Micronaut’s ahead-of-time (AoT) compilation APIs to move the entity meta-model into your compiler and translate a finder expression like
findByTitleinto the appropriate SQL or JPA-QL query at compilation time. A very thin runtime layer that uses Micronaut’s reflection-free compilation-time AOP then only has to execute the query and return the results.
Two initial implementations have been open sourced; one for JPA and one for SQL with JDBC. The latter is the one set to cause a stir as it can reach nearly 4X the performance GORM and 2.5X Spring Data.
Object Computing, Inc. claims in Predator’s announcement “the runtime layer is so light that even an equivalent repository method written by hand would not execute faster.” This is achieved by removing the need for any query translation at runtime. And the speed isn’t the only advantage – moving the work from runtime to compile time has the benefit of detecting errors earlier in the process. Additionally, in a world where bills are charged based on application running time or function execution time, having such a light data access toolkit could be the new ace up your sleeve.
Even though currently there is only support for JPA and SQL, they plan to bring support for MongoDB, Neo4j, Reactive SQL, and more in the near future. They’re also very excited about other possibilities opened up by Micronaut 1.0, so keep an eye out for more announcements.