quarkiverse / quarkus-jnosql

The Quarkus JNoSql Extension adds support for JNoSQL, an implementation of Jakarta NoSQL.
http://www.jnosql.org/
Apache License 2.0
13 stars 4 forks source link

Recommendation to Use Eclipse JNoSQL Lite Engine in Quarkus JNoSQL Extension #45

Closed otaviojava closed 1 year ago

otaviojava commented 1 year ago

Currently, the Quarkus JNoSQL extension employs a reflection-based approach, which runs counter to the main principles of Quarkus that promote compile-time validation and optimizations. This issue proposes a shift towards integrating the Eclipse JNoSQL Lite engine within the Quarkus JNoSQL extension. This change aligns with Quarkus' philosophy and ensures more efficient and reliable interactions between the two frameworks.

Issue Details:

The Eclipse JNoSQL Lite engine offers a promising alternative to the existing reflection-based solution within the Quarkus JNoSQL extension. By leveraging the Java Annotation Processor, the Eclipse JNoSQL Lite engine generates metadata at compile time, addressing the concerns raised by the current reflection approach. This aligns well with Quarkus' emphasis on compile-time checks and optimizations and improves overall performance and reliability.

Key Benefits:

  1. Compile-Time Validation: Utilizing the Java Annotation Processor in Eclipse JNoSQL Lite enables compile-time validation, ensuring that issues are detected early in the development process rather than at runtime.

  2. Improved Performance: The Java Annotation Processor eliminates the runtime overhead associated with reflection, resulting in improved performance and reduced memory consumption.

  3. Quarkus Philosophy: The proposed shift to Eclipse JNoSQL Lite better aligns with Quarkus' core principles of compile-time validation, ahead-of-time compilation, and minimized runtime reflection.

Example Usage:

A sample code repository has been prepared to showcase the advantages of the Eclipse JNoSQL Lite engine within the Quarkus JNoSQL extension. The repository includes code snippets and documentation demonstrating the new approach's usage. You can explore this sample code repository at:

https://github.com/JNOSQL/demos-se#mongodb

Feedback and Contributions:

The community is encouraged to provide feedback, report bugs, and contribute to this integration's ongoing development and improvement. Any issues related to the code, documentation, or other aspects can be reported directly through the repository's issue tracker.

By adopting the Eclipse JNoSQL Lite engine as part of the Quarkus JNoSQL extension, we can embrace the principles of Quarkus more effectively while improving performance and maintainability. Developers are invited to explore the sample code repository and provide valuable feedback to ensure the success of this integration.

otaviojava commented 1 year ago

@amoscatelli @dearrudam

amoscatelli commented 1 year ago

I'll take a look and give it a shot. Some hints on how to integrate this instead of normal impl ?

amoscatelli commented 1 year ago

I suppose these are the hints : https://github.com/eclipse/jnosql-extensions#jnosql-lite

amoscatelli commented 1 year ago

The jnosql-mapping-reflection is not among the 1.0.1 drivers versions. Should I wait for the 1.0.2 versions ?

otaviojava commented 1 year ago

Those still as 1.0.2-SNAPSHOT. I am super happy to release version 1.0.2, as it makes sense to move it forward. Could you try this snapshot version and check if it works?

Also, there is a point that I need to know, how to register a Java annotation processor in Quarkus.

I created using Java SE and CDI: https://github.com/JNOSQL/demos-se/blob/main/mongodb-lite/pom.xml

But I believe that Quarkus might be different.

amoscatelli commented 1 year ago

@otaviojava we have problems about the Hazelcast driver ... we didn't have prior of 1.0.2 ... please have a look at the dearrudam pull request.

I don't have a clue about this

otaviojava commented 1 year ago

Ops, weird, I will check it out!

otaviojava commented 1 year ago

Hazelcast

Please, it is here: https://mvnrepository.com/artifact/org.eclipse.jnosql.databases/jnosql-hazelcast/1.0.2

amoscatelli commented 1 year ago

59 has been merged so this can be closed

otaviojava commented 1 year ago

That is nice, please, let me know when is available to talk about more it.