1 Reply Latest reply on Nov 2, 2006 2:00 PM by brian.stansberry

    TreeCache replication optimization

    jyoonyang

      Hello,

      We are using JBoss TreeCache to store small objects where large set of objects are very short lived (probably less than a couple of minutes).

      I was wondering if we should be storing these objects in particular way in the tree to optimize the replication. Does TreeCache replicate only those nodes of tree that are modified? I ran some initial test storing the objects in a single node vs. in multiple nodes. To my surprise, I didn't see any improvements in performance. Actually, in certain cases I saw degradation. Perhaps it's due to increased lookup time.

      Thanks,
      Jennifer

        • 1. Re: TreeCache replication optimization
          brian.stansberry

          TreeCache will replicate the modified key value pairs, not the whole node and definitely not any other nodes. So if you do a put("/a/b/c", "x", "y") an object encapsulating that command is replicated.

          Putting everything in one node could be faster in a simple test because the shallower your tree, the faster the navigation to the needed node is. But, there could be a heavy price to pay in a multi-threaded system. With READ_COMMITTED or stronger isolation, if one thread is modifying that node, all other threads are blocked waiting to read it. With finer-grained nodes, any lock contention is also more fine grained.