<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Method for Data Consistency Support in Mobile Ad hoc ♣ Distributed Systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>© Maxim Galkin</string-name>
          <email>maksim.galkin@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Saint-Petersburg Universitetsky pr. 28, Peterhof</institution>
          ,
          <addr-line>Saint-Petersburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents a research-in-progress report on a method for data consistency support in ad-hoc mobile distributed systems, based on the concept of high-level operations “compatibility” and operation history reconciliation. The proposed method also utilizes tuple spaces as a communication model and accumulators as data structures for efficient conflict resolution.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>In this paper we present a method for data consistency
support in an ad-hoc mobile distributed system. This
method combines some of the practices known for
“nomadic” distributed systems with loose data
structures such as tuple spaces that can serve as a
medium hiding the intermittent mobile network
connection.</p>
      <p>Why do we consider methods for consistency
support in ad-hoc distributed system at all? One of the
advantages of such system is in the absence of a “single
point of failure”. That is, all of the network nodes are
equally important, and if we keep their replicas
consistent then our system can continue working even if
it loses most of the nodes. Of course, that also creates
more requirements for the reconciliation protocol, as we
need to “handle” nodes, which were “offline” for a
period of time.</p>
      <p>Another advantage is the potentially unlimited
extensibility as there is no bottleneck like main server
performance or main server connection bandwidth. A
new node can join the network at any time, locate its
“neighbors” and obtain the latest available data.</p>
      <p>Finally, in a mobile world it’s a possible scenario
that the known main servers are inaccessible, while the
“neighbor devices” can be still available. The proposed
protocol can serve as a failover tool in such scenario.</p>
      <p>The advantage of the proposed method is in its
indifference to an underlying data model. It demands all
nodes to be aware of some initial data state (which can
possibly be empty, it is only required as a common
“starting point” for nodes operation history) and of a set
of high-level operations. After that is defined, the nodes
become autonomous and start applying those operations
to their local replicas. At some points in time nodes
perform reconciliations of their replicas according to the
proposed protocol and through this achieve a consistent
and actual data. Due to the general approach this
method can be used to build a middleware platform for
consistency support in ad-hoc distributed systems.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Data Model and Operations</title>
      <p>
        For the sake of the proposed method, a set of defined
high-level operations over the data is more significant
than the data model itself and further in this paper we
will only discuss operation set properties. At the same
time we must note that in some related works [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]
special data model was crucial in defining such
operations, which caused less conflicts and therefore
were better suitable for collaborative work.
      </p>
      <p>In general, we can name two sides or two states of
the data in the system. One side is the real data, which
resides in the mobile agents, and which is continuously
updated by them and another side is the ideal data, that
can be achieved by a full semantically-correct
reconciliation of all data replicas. In the process of work
our cloud of local data replicas strives to become closer
to the ideal state, where every agent knows the current
and actual state of data. Of course, in reality the degree
of consistency depends on many factors, like the
connection quality between agents and the intensity of
the continuous local updates.</p>
      <p>
        In most cases, a table of compatibility conditions is
filled together with operations definition. We call two
operations “compatible” if none of them depends on
another. In the CoACT model [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] such conditions are
called “activity interleaving rules” and given in a form
of predicates for each pair of operations. In general,
operations compatibility may depend on both their
nature (e.g., two “read” operations will never create a
conflict) and data they are applied to.
      </p>
      <p>To successfully maintain consistency the set of
operations for ad-hoc mobile distributed system must
ensure as few conflicts as possible, in other words
operations must be as compatible as possible, because
every conflict in such a system is a serious problem:
two mobile nodes, which discover a data inconsistency
during their interaction don’t possess any advantage
over each other, unlike it happens in “nomadic”
distributed systems, where the fixed nodes have the
priority, the most consistent state. Usually in ad-hoc
distributed system it’s also impossible to draw a human
operator into the process of conflict resolution, because
the inconsistent state can be discovered at nodes that
aren’t the authors of the conflicting operations.</p>
      <p>Therefore every conflict resolution must be
automatic in accordance with some pre-defined rules of
consistency. Such rules can be of two major types:
differential (e.g. when the system takes one of two
conflicting operations basing on its timestamp) and
integral (if the system, for example, has some
predefined objective function or cost function over the data
model and it discards one of the conflicting operations
basing on the value of the function).</p>
    </sec>
    <sec id="sec-3">
      <title>3 Transactional Properties of the System</title>
      <p>
        The above-stated implies that even if some operation
has been committed at one of the nodes and lived in the
system for some period of time it is not guaranteed to be
fixed in the system forever as one of the other nodes
could have submitted a conflicting operation that will
eventually overcome the first one. In other words, the
Durability property from the ACID set is not guaranteed
by our system for the sake of Consistency. Here we can
also notice that in ad-hoc distributed system no “global
commit” or “strong” [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] operations are possible. On the
contrary, all operations in the system are “weak”, that is
they are only applicable to the local replica of the data
and they are only guaranteed to be “safe” until next data
reconciliation with another node.
      </p>
      <p>
        With respect to the other ACID properties such as
Atomicity and Isolation we should notice two levels of
their applicability. If we consider our high-level
operations as a specific form of transactions consisting
of some elementary read/write sub-operations, then
these transactions will satisfy both A and I properties. If
on the other hand we introduce even higher-level
transactions that consist of our original operations we
will need to give away the highlighted properties,
similar to how it happens in the “sagas” transaction
model [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Otherwise, long-running isolated
transactions will inevitably increase the number of
conflicts just like it is observed in other types of
distributed database systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Such an increase in
our system can lead to mobile nodes overload and
overall decline in data quality, as compensative
transactions can sometimes be ineffective in cleaning up
the database due to lack of transaction isolation.
We assume that numerous mobile nodes interact with
each other by establishing connection with some of the
other nodes in their “visibility range” and perform
reconciliation of their respective data replicas. During
the reconciliation nodes compare not the data itself, but
the history of operations made over some initial data
state: a common “starting point”, which is known to all
nodes. If a conflict is discovered it is resolved according
to the rules for the given operations, one of the
conflicting operations has to be compensated and
marked in history as rejected. This mark can make
future reconciliations faster.
      </p>
      <p>
        After the reconciliation we need to recalculate all
the static data on the nodes that depend on the changed
operations. If the changes have only affected such
structures as accumulators [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] they don’t need the
recalculation.
      </p>
      <p>
        As a communication model between the mobile
nodes we can use the tuple spaces mechanism, such as,
for example, LIME [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] or JavaSpaces [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In this case
nodes can create dynamic groups, sharing one tuple
space. In this tuple space a consistent set of operations
will be stored for each data element. If a new node
comes to the group, or a new operation is performed on
a present node it triggers the reconciliation process as
described above. All nodes also synchronize their local
replicas with the common space to be ready to go
offline any time.
      </p>
      <p>
        In this scenario the common tuple space can be
found to correspond to a notion of a “cluster of
consistency” [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], with the only difference that in our
case no data in a cluster is durable. For example, if two
nodes from different clusters interact any of the
operations in their replicas can be potentially conflicting
and subject for removal.
      </p>
    </sec>
    <sec id="sec-4">
      <title>5 Conclusion</title>
      <p>We have introduced a method for consistency support
in a mobile ad-hoc distributed system, based on the
reconciliation process of high-level operations histories.
We also presented a description of supported data
models and the requirements for operations set. We
have analyzed the transactional properties of the
proposed system and outlined a protocol for nodes
interaction.</p>
      <p>We plan to further develop this method with regards
to an experimental proof of concept. We also plan to
introduce metrics of the global consistency in such a
mobile system to be able to evaluate the efficiency of
the method and/or compare our method with other
methods. Another way of applying such metrics is to
use them in the described mobile system as an integral
rule for operational histories reconciliation, thus we can
sort out nodes, which have their replica so obsolete or
inconsistent that it doesn’t make sense to compare them
with the current data.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kozlova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kochnev</surname>
          </string-name>
          ,
          <string-name>
            <surname>B. Novikov.</surname>
          </string-name>
          <article-title>The Middleware Support for Consistency in Distributed Mobile Applications</article-title>
          .
          <source>Proc. of the Baltic DB&amp;IS'</source>
          <year>2004</year>
          ,
          <fpage>145</fpage>
          -
          <lpage>160</lpage>
          , Riga, Latvia, Scientific Papers University of Latvia,
          <year>June 2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>O.</given-names>
            <surname>Proskurnin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Novikov</surname>
          </string-name>
          .
          <article-title>Towards collaborative video authoring</article-title>
          .
          <source>Proc. of ADBIS'03</source>
          ,
          <fpage>370</fpage>
          -
          <lpage>384</lpage>
          , Dresden, Germany,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Rusinkiewicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Klas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Tesch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wasch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Muth</surname>
          </string-name>
          .
          <article-title>Towards a Cooperative Transaction Model: The Cooperative Activity Model</article-title>
          .
          <source>Proc. of the 21st VLDB Conference</source>
          , Zurich, Switzerland,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E.</given-names>
            <surname>Pitoura</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Bhargava</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Wolfson</surname>
          </string-name>
          .
          <article-title>Data Consistency in Intermittently Connected Distributed Systems</article-title>
          .
          <source>In Transactions on Knowledge and Data Engineering</source>
          ,
          <year>Nov 1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>H.</given-names>
            <surname>Garcia-Molina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Salem</surname>
          </string-name>
          . Sagas.
          <source>ACM SIGMOD Record</source>
          , Volume
          <volume>16</volume>
          , Issue 3, pp.
          <fpage>249</fpage>
          -
          <lpage>259</lpage>
          ,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J. N.</given-names>
            <surname>Gray</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Helland</surname>
          </string-name>
          ,
          <string-name>
            <surname>P. O'Neil</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Shasha</surname>
          </string-name>
          .
          <article-title>The Dangers of Replication and a Solution</article-title>
          .
          <source>In Conference on Management of Data</source>
          , pp.
          <fpage>173</fpage>
          -
          <lpage>182</lpage>
          , Canada,
          <year>June 1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Murphy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. P.</given-names>
            <surname>Picco</surname>
          </string-name>
          , G-C.
          <article-title>Roman. LIME: A Coordination Model and Middleware Supporting Mobility of Hosts and Agents</article-title>
          .
          <source>ACM Transactions on Software Engineering</source>
          , Vol. X,
          <string-name>
            <surname>No</surname>
          </string-name>
          . X, pp.
          <fpage>1</fpage>
          -
          <lpage>48</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>E.</given-names>
            <surname>Freeman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Hupfer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Arnold. JavaSpaces</surname>
          </string-name>
          , Principles,
          <source>Patterns and Practice. Addison-Wesley</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>