6 Replies Latest reply on Feb 21, 2017 8:24 PM by dstark RSS
    dstark Newbie

    Configuring neo4j database backend

    Hello,

     

    I am trying to find documentation about how to configure Thingworx to use neo4j on the backend. I am trying to dockerize my Thingworx deploy and use a remote neo4j database. I found a very small bit about platform-settings.json that seems to have postgresql configuration parameters but very little about neo4j.

     

    Appendix B shows sample platform-settings.json for postgres - does it work for setting a remote neo4j?

    Setting THINGWORX_PLATFORM_SETTINGS env variable to specify where platform-settings.json lives

     

    Ideally, I'd like to have neo4j as a standalone database (preferably with high availability with one writer and multiple readers).  At a mimum I'd like one remote database.  Is this possible?

      • Re: Configuring neo4j database backend
        polinao Ninja

        Hi, Neo4j has reached end of sale/support. Currently, h2, hana, postgresql, and DSE integration is available.

          • Re: Configuring neo4j database backend
            dstark Newbie

            Thanks for your feedback, Polina! I will be exploring other backends in the future. Could you still point me to how neo4j (or any database) is configured within the ThingWorx application? I explode the .war, but cannot find the database connection settings.

          • Re: Configuring neo4j database backend
            supandey Collaborator

            Hi Dan, if running a DB as persistence provider remotely is your key concern you can always go for PostgreSQL, SAP Hana or DataSatax Apache Cassandra.

             

            If you are just looking for a external data store, (or if you are looking forward to connect your existing RDBMS to ThingWorx) you can choose to configure JDBC connection using the Relational Databases Connectors from the ThingWorx Marketplace. Do note that this won't act as a persistence provider for ThingWorx itself.

             

            Let me know if you'd need more information on this.

              • Re: Configuring neo4j database backend
                dstark Newbie

                This is my question: how does the persistence for ThingWorx itself work? (Sorry if this is obvious but I'm new to ThingWorx).

                 

                Looking in /ThingworxStorage/database/data/messages.log it's clear I am using Neo4j on the host.  I'm not sure where in the webapp this database backend is configured. For example, typical web applications will have a configuration file and you set database connection settings. I don't know where this is configured (either in the webapp or on the filesystem).

                 

                Thank you.

                  • Re: Configuring neo4j database backend
                    supandey Collaborator

                    Dan, you don't need to configure Neo4j's connectivity because its an embedded database, i.e. its instantiated with the Thingworx.war file deployment, you can configure some part of how it's utilized by the ThingWorx platform in the platform-settings.json for e.g.

                     

                    "NeoPersistenceProviderPackage": { "StreamProcessorSettings": { "maximumBlockSize": 2500, "maximumQueueSize": 250000, "maximumWaitTime": 10000, "scanRate": 5, "sizeThreshold": 1000 }, "ValueStreamProcessorSettings": { "maximumBlockSize": 2500, "maximumQueueSize": 500000, "maximumWaitTime": 10000, "scanRate": 5, "sizeThreshold": 1000 } },

                     

                    Generally speaking Neo4j and H2 for that matter are "hardcoded" within the ThingWorx. Though you can still view the database files if you'd to navigate to \\ThingworxStorage\database\data , ThingworxStorage\database\ (for H2) Also you can check what sort of PersistenceProvider ThingWorx is using if you'd navigate to PersistenceProviders under the Data Storage, something like this :

                     

                     

                     

                    just in case if you don't see this listed, enable the visibility of system objects by :

                     

                    And if you'd click on the icon you should see which DB is used as persistence provider :

                     

                     

                     

                     

                    To finish my long reply, I would reiterate what Polina mentioned above you should be using H2 as Neo4j is end of support

                     

                    Hope this would clarify to some extent.