<div dir="ltr"><div class="gmail_extra"><br class=""><br><div class="gmail_quote">On Thu, May 5, 2016 at 7:48 PM, Jesper Pedersen <span dir="ltr">&lt;<a href="mailto:jesper.pedersen@redhat.com" target="_blank">jesper.pedersen@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi,<br><span class=""><br>On 05/04/2016 02:16 PM, Scott Marlow wrote:<br>&gt; Below is an update on the WildFly NoSQL integration project.  The goal<br>&gt; is for deployed applications to have access to NoSQL databases (via<br>&gt; Hibernate OGM or native APIs).  Items 1-4, should be finished in our<br>&gt; first pass, with as much of the others items as we can do as well.<br>&gt;<br><br></span>Some general comments:<br><br>- Good start :)<br>- Maybe refactor from <a href="http://org.jboss.as/" rel="noreferrer" target="_blank">org.jboss.as</a> to org.wildfly<br></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">- Maybe use version identifiers in the package name since NoSQL APIs<br>change a lot<br></blockquote><div><br></div><div>Well even if it is different we had bad experience on this w/ IJ and removed those version identifier from package name. I think package name should not have version ids, even if it could be acceptable in this first phase we should try to hide this kind of infos to users of OURS API even if APIs from NoSQL impl would be dependents from specific release.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">- Add some additional asserts to the test cases to verify input / output<br>from the stores<br><span class=""><br>&gt; 1. connection management will deal with obtaining NoSQL connections for<br>&gt; application use.<br>&gt;<br>&gt;    - borrow/share Hibernate OGM connection configuration setup code<br>&gt;    - authentication integration<br>&gt;    - support transport level security<br>&gt;<br><br></span>Connection management is a huge area to tackle. I think it is best to<br>start with what each NoSQL implementation offer.<br></blockquote><div><br></div><div>Yup it would be a good start, even if the other question is &quot;why a user should use WF integration instead of direct use of various implementation?&quot;. One of the possible answer could be &quot;to have a common connection management&quot; for sure. So the (final) effort should be to have a common connection management.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>The big question is if the connections should be truly managed which<br>would give the option to no-op dangerous API calls out. There aren&#39;t any<br>spec requirements for this, so it is really a matter of how the APIs<br>should be presented.<br></blockquote><div><br></div><div>Yup exactly.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>You may have to proxy some of the classes in order to pass the security<br>information into the stores. I think people would expect to use WildFly<br>security domains for this (SubjectFactory/Subject).<br></blockquote><div><br></div><div>Yes it&#39;s another possible question to &quot;why use WF integration?&quot;</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><br>&gt; 2. CDI programming simplifications will make it easy to inject NoSQL<br>&gt; data into your application classes.<br>&gt;<br>&gt;    - <a href="https://github.com/antoinesd/javaee-nosql" rel="noreferrer" target="_blank">https://github.com/antoinesd/javaee-nosql</a> is initial idea<br>&gt;<br>&gt; 3. You will easily get a native NoSQL connection from the specified<br>&gt; NoSQL profile and use the native NOSQL (Cassandra/MongoDB/other) API in<br>&gt; your application.<br>&gt;<br><br></span>I think this is key, as the APIs change almost per release.<br></blockquote><div><br></div><div>Agree 100%. And it gives us also another requirement: should be easily to upgrade this Wildfly subsystem (or at least underlying NoSQL implementations) because NoSQL users would expect to use latest &quot;cool&quot; features of their NoSQL impl and don&#39;t want to wait for WildFLy (or EAP) release cycle.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><br>&gt; 4. You will also be able to easily use Hibernate OGM with the defined<br>&gt; NoSQL profiles (exactly how is TBD but will be awesome :-).<br>&gt;    - Hibernate OGM static module is included.<br>&gt;    - need to align with OGM dependencies (e.g. Hibernate ORM + other<br>&gt; dependencies).<br>&gt;    - as mentioned above, OGM already has some connection setup code,<br>&gt; which might be good to share for WildFly + standalone NoSQL use.<br>&gt;    - once WildFly has a common NoSQLSource (not a DataSource) that OGM<br>&gt; can use, OGM will be enhanced to use it.<br>&gt;<br>&gt; 5. How best for the WildFly NoSQL subsystem to be optional?<br>&gt;    - Is it enough to not run the wildfly/testsuite/nosql tests by default?<br>&gt;    - Or do we need to start a separate <a href="https://github.com/wildfly/nosql" rel="noreferrer" target="_blank">https://github.com/wildfly/nosql</a><br>&gt; project for the NoSQL subsystems?<br>&gt;<br>&gt; 6. transaction enlistment<br>&gt;<br><br></span>This will vary for each store, and there are many loopholes that you may<br>want to plug, f.ex. sharing a connection between 2 transactions.<br><br>For 1-phase, you will have to insert a LocalXAResource instance into the<br>transaction when the &quot;connection&quot; is obtained, and return it on the<br>boundary (afterCompletion). Same deal for 2-phase basically.<br><br>The LocalXAResource implementation will of course be different for each<br>store.<br><br>You may want a transaction option for the stores that supports this such<br>that people can choose the &quot;level&quot; of enlistment (ala jta=&quot;false&quot;).<br><br>One task I see is that people will have access to the transactional<br>methods in the API, and you don&#39;t want them to call these methods in<br>their apps unless the transaction setting allows this.<br><br>I think you can leave out the corner-cases in the 1st iteration, like<br>deferred enlistment (get connection, start transaction).<br><br>&gt; 7. compensating transactions<br>&gt;<br><br>Another huge area.<br><br>I would let the use-cases from WildFly/Swarm drive this.<br><br>A simple way to start is to have a SPI that apps can implement in case<br>the transaction is MARKED_FOR_ROLLBACK (hooks to an enlisted XAResource).<br></blockquote><div><br></div><div>We implemented those in IJ (even if in much more standard JCA environment), and maybe we could share and eventually copy/paste some code.  </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>&gt; 8. runtime application monitoring<br>&gt;<br><br>As each store is different I would only look into what the subsystem can<br>expose, plus whatever the store can display.<br></blockquote><div><br></div><div>Maybe a plugin approach could be taken as we did for datasource and RA subsystems reading statistics available during deployment and runtime and exposing them as pure runtime metrics in DMR.</div><div><br></div><div>Just my 2 cents.</div><div><br></div><div>Best regards</div><div>S.</div></div></div></div>