On 05.03.2019 11:40, Damiano Albani wrote:
Hi Julian,

On Thu, Feb 28, 2019 at 1:34 PM Julian Reschke <[email protected]>
wrote:


You can use
<https://sling.apache.org/documentation/bundles/datasource-providers.html>

as datasource provider.


That's indeed the piece I was looking for, thanks a lot for the tip!
For the record, in case someone else would ever be interested, here's what
I did:

Maven pom.xml

   <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.datasource</artifactId>
       <version>1.0.4</version>
   </dependency>


OAK JSON configuration file:

   "org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService": {
     "documentStoreType": "rdb"
   },
   "org.apache.sling.datasource.DataSourceFactory": {
     "datasource.name": "oak",
     "driverClassName": "org.postgresql.Driver",
     "url": "${oak.postgresql.url}",
     "username": "${oak.postgresql.username}",
     "password": "${oak.postgresql.password}"
   },


I saw a few interesting configuration flags as well in RDBDocumentStore.java
<https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java#L2145>
(NOGZIP, NOAPPEND, etc).
What the reasoning behind those flags? Are they useful to activate in
certain conditions / with certain databases?

These were added so that certain features could be switched off when there's doubt that it works properly. (Don't panic: weren't needed after all...)

By the way, using a set of ON SELECT / INSERT / UPDATE / DELETE DO INSTEAD
rules, I could even store the *data* column as *jsonb* in PostgreSQL.
(That should also be possible for the bdata column but I ran into some JSON
syntax issues so far.)

Yes, DB-specific optimizations are in theory interesting. However, the goal was to keep stuff simple and portable.

That said: don't expect this to perform better than MongoDB - the
RDBDocumentStore essentially emulates the JSON storage of MongoDB inside
a relational database.


Speaking of performance, how can I determine if my Oak setup works as fast
as it should?
I understand that performance is very specific to the environment where it
runs, but what's an average "baseline" performance to expect from Oak?
In terms of nodes added / updated / deleted per second for example? No
queries here, simply CRUD operations.
And what would be the associated MongoDB insert / query / update / delete
metrics to expect?
I couldn't find much information related to performance (tuning) on the
website.


There is no such information there, and I really do not have anything to share. Sorry.

Best regards, Julian

Reply via email to