6 Replies Latest reply on May 6, 2017 11:51 PM by jeh.sandoval

    Modeshape with DocumenDB as BinaryStore

    jeh.sandoval

      We are evaluating Modeshape with DocumentDB (via its MongoDB api) as its binary store using the built-in MongoDbBinaryStore.

       

      Connection at first cannot be established because DocumentDB requires connections to be in SSL. Is there any out-of-the-box way to set SSL using the built-in MongoDbBinaryStore? I looked around the code and haven't found anything, so just made it to work by modifying it to accept connection options. After that, tried uploading some documents and everything is working fine.

       

      The next issue is that the built-in MongoDbStore uses one collection per document. With DocumentDB billing on a collection basis, this would be impractical. So I was thinking if we could implement something like what

      Jackrabbit Oak is doing with one collection for blobs then just adding another collection for the document headers. Are there any things that I should keep in mind when defining custom binary store? Should the key be consistent with other stores?

        • 1. Re: Modeshape with DocumenDB as BinaryStore
          hchiorean

          The connection to MongoDB is performed using the Mongo java driver (2.x) API, namely the ServerAddress class. From a ModeShape configuration perspective you pass the hostname / port and/or replica set. I don't know what "SSL support" means in terms of the Mongo Java Driver API. If it's an easy enhancement, please feel free to open a PR.

           

          As far as implementing a custom binary store, ideally you should extend AbstractBinaryStore and implement your logic similar to other existing binary stores.

          • 2. Re: Modeshape with DocumenDB as BinaryStore
            jeh.sandoval

            Thanks you for the quick response.

             

            My bad, SSL support was introduced in 3.0 and requires at least Java 7. Hence, will not able to do PR. Have to go with the custom binary store then.

            • 3. Re: Modeshape with DocumenDB as BinaryStore
              hchiorean

              ModeShape 5 uses Java 8, so the JDK version would not be an issue. Also, changing the driver version from 2.x to 3.x might not be that complicated and might be a simpler alternative to a new binary store.

              Either way, we welcome any contributions in this area

              • 4. Re: Modeshape with DocumenDB as BinaryStore
                jeh.sandoval

                Oops, my bad again, I was reading the development workflow and it mentioned Modeshape is being built on Java 6. Haven't noticed it was outdated.

                 

                Back on topic. Yes, its just a matter of changing the version for the Mongo Java Driver, changing the deprecated methods, and adding additional properties for the mongo binary store. I already have an implementation on my local repo. Will it be okay if I log an enhancement and issue a PR?

                 

                Thanks!

                • 5. Re: Modeshape with DocumenDB as BinaryStore
                  hchiorean

                  sure, as long as there are no backward compatibility issues. By that I mean that

                  a) the data written using the old driver can still be read back using the new driver

                  b) there are no repository configuration changes

                  • 6. Re: Modeshape with DocumenDB as BinaryStore
                    jeh.sandoval

                    There will be a new optional flag in the MongoDB BinaryStore section for enabling/disabling SSL. Will that be okay?