1 Reply Latest reply on Jul 16, 2006 11:09 PM by Manik Surtani

    Proper usage for data gravitation with buddy replication


      In the PojoCache 1.4 release, I have used the data gravitation option during the getObject to gravitate the data (if there is any) for buddy replication. However, I am not quite happy with it for two reasons:

      1. It is kind of ad-hoc, meaning future refactoring may mess up the logic.

      2. It can be inefficient. PojoCache by nature can call getObject (or attach in 2.0 API) recursively for it object graph. This means potentially multiple times of distributed get (for data gravitation). Then this is also exacerbated by the new PojoCach 2.0 design where the real POJO storage happens under an internal region.

      Do you guys thin it will make more sense to delegate this to the user's code to do it?

      Or should PojoCache expose an additional API for user to do data gravitation, e.g.,


      this will gravitate all the necessary data (including those in the internal space) over first.

        • 1. Re: Proper usage for data gravitation with buddy replication
          Manik Surtani Master

          I reckon this should be passed on to the user. At the end of the day when we talk about 'users' in this context, it is not end-users who write Java applications, but rather developers who implement frameworks such as Tomcat session clustering (a.k.a. Brian :) )

          A separate method call will just add clutter. If PojoCache needs to be aware of a data gravitation (so it can gravitate internal space as well) then it should sniff for the option being present in the Invocation Context.