You are on page 1of 6

2008 International Symposium on Information Science and Engieering

Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc


Networks

Yang Li, Xuejie Zhang, Yun Gao


School of Information Science and Engineering
Yunnan University
Kunming, China
lymagic@yahoo.cn

Abstract chronization is always a complex and pivotal part in mobile


database systems, because it guarantees data consistency,
Data synchronization provides a feasible solution for improves data availability and decrease query response de-
improving data accessibility and consistency in mobile lay.
database systems. Flexible and efficient data synchro- The data synchronization system maintains the consis-
nization, however, remains a challenging problem in tency of multiple local databases in different mobile nodes
mobile database applications over mobile ad-hoc net- so that each node can access local data instead of remote
works(MANET). This paper proposes a novel Object- ones[4, 10]. In this way, synchronization can significantly
Oriented Data Synchronization(OODS) schema in mobile improve distributed applications’ availability, reliability and
database systems, for providing a flexible and efficient scalability.
data synchronization service to applications running over
Data synchronization technology for mobile database
MANET. OODS employs Publication/Subscription mode
has been broadly researched and a number of data
and DB4O as the database engine. Subscribers can recog-
synchronization systems have been developed, such as:
nize update of publishing schema automatically. On pub-
RDA and Merge Replication(MR) technology[8, 5] based
lishers, publishing schema and conflict solutions can be
on Microsoft SQL Server with SQL CE, Mobile Sync
user-defined or inherited from the schema inheritance tree.
technology[11] based on Oracle Database with Oracle Lite
Sample data were configured to conduct performance eval-
and other technologies[2, 3, 12]. These technologies or
uation over Bluetooth Piconet. The obtained results indi-
systems have some disadvantages that make them unsuit-
cated the efficiency and feasibility of the schema and its
able for mobile databases in MANET. First, they are de-
potential for synchronizing data in mobile database over
signed for classical mobile database architecture[2], illus-
MANET.
trated in Figure 1, they work well to synchronize data be-
tween mobile database and enterprise-level large-scale re-
lational databases. While, in MANET, however, mobile
1. Introduction nodes such as PDAs and Smartphones, have limited power
and storage resource, which must be taken into considera-
A mobile ad-hoc network(MANET)[7] is used to pro- tion when designing a data synchronization system, because
vide an instant wireless communication environment with- mobile nodes cannot run a large-scale RDBMS. Figure 2
out any preexisting infrastructure. In MANET, an au- shows the architecture of mobile database in MANET. Sec-
tonomous collection of mobile nodes communicate over rel- ond, mobile applications usually need complex and com-
atively bandwidth constrained wireless links, the network pound data types, which are less supported in relational
topology may change rapidly and unpredictably over time, databases[9]. Third, impedance mismatch problem between
mobile nodes have limited battery power and storage re- object-oriented and relational models will bring additional
sources. Consequently, data accessibility is much limited development difficulties and worsen efficiency.
in this dynamic wireless communication environment than In this paper, we propose a novel data synchronization
wired ones. One possible method to solve this problem is system for mobile databases, called Object-Oriented Data
to use mobile databases(MDB)[4] which provide a uniform Synchronization (OODS), for providing an efficient and
data accessing interface for mobile applications. Data syn- flexible data synchronization service in MANET. OODS

978-0-7695-3494-7/08 $25.00 © 2008 IEEE 133


DOI 10.1109/ISISE.2008.19

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.
uses DB4O[6] as database engine. DB4O is a pure object- and equally. Mobile nodes are divided into two roles: pub-
oriented embedded database and also open-source software. lisher and subscriber, as shown in Figure 2, a cluster header
OODS adopts Publication/Subscription mode[8], it treats is often chosen as publisher while cluster members as sub-
everything as an object. Publishing schema is defined as scribers, because cluster header usually has more powerful
a Class and can be inherited by new publishing schema. CPU, energy and storage resource. A publisher can also be
This paper is organized as follows. Section 2 describes a subscriber in upper cluster networks, only if it is a cluster
the OODS schema. Section 3 presents our implementation member in the upper cluster.
and experimental results of OODS, respectively. Section 4 In OODS, everything is an object, including our applica-
summarizes this paper and outlines our future work. Finally, tions, data records and publications. Data and Publications
section 5 gives an acknowledgement. are both stored in the publishers’ local database, so that,
publication object and data have a uniform access and man-
agement interface. To simplify publishing management,
each publication can have many subscribers. These sub-
scribers make a group to share one publication object. This
is also accord with the real application scenario in which a
few mobile nodes usually have the same business logic or
computing work. A publication has the definition of pub-
lishing strategies for a subscriber group while each sub-
scriber in the group can has its own data filters to reduce
database file’s size.
Figure 3 illustrates the architecture of OODS. It is de-
signed with two parts: publisher and subscriber, they com-
Figure 1. Classical architecture of MDB municate over WiFi, Bluetooth, or other wireless ad-hoc
network protocols which support TCP link.

Figure 2. MDB architecture in MANET

2. Object-Oriented Data Synchronization

2.1. System overview Figure 3. OODS architecture

Mobile applications must be scalable and easy-updated On the publisher, mobile application can access pub-
to catch up with changefully business logic. Publi- lisher database directly or as a subscriber through the
cation/Subscription framework satisfies this requirement Publisher-Agent. The core part is Pub-Update module
well[8]. When the business logic has changed, only pub- which is in charge of publishing schema managing, conflict
lishing schema has to be changed instead of redeploy- resolving and subscriber group managing. Publisher must
ing updated application copies on a number of mobile authenticate each subscriber, so an access control list is
nodes, each subscriber can synchronize hotspot data ac- maintained by Subscriber Group Manager object which also
cording to new publishing schema. So, we employ Publica- cooperates with Schema Manager to authenticate coming-in
tion/Subscription mode in OODS. In a MANET, each mo- subscribers. When many subscribers update the same data
bile node maintains a local DB4O database independently object, conflicts will occur, Schema Manager object mes-

134

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.
sages to Conflict Resolver object which resolves the con- ferent synchronizing strategies have to be satisfied.
flicts according to predefined strategies. Schema Manager
defines and maintains every publishing schema with the
help of Subscriber Group Manager and Conflict Resolver,
it also communicates with Publisher-Agent for publishing
data objects to subscribers.
On the subscribers, mobile applications access their lo-
cal database when they are off line. Once they go back to
the network or up to date data are required, data synchro-
nization starts. Subscriber-Agent first sends a subscribe re-
quest to the Publisher-Agent. Then the publisher responses
subscribers with their publishing schema instead of dataset,
which unlike other synchronizing technologies such as MR
that sends data directly to the subscribers. This design strat-
egy eases the burden on publishers, because their limited
hardware resources and they may have to deal with many
Figure 4. Class diagrams of PubSchema & Subscriber
synchronizing jobs at the same time. OODS puts part of
the synchronizing works onto the subscribers. When the
subscribers receives publishing schema which is an object,
Publishing schema management is the core part of pub-
they compare with the old schema to find changes. If the
lishing process. It affects application’s efficiency and deter-
schema has changed, Subscriber-Agent will request a snap-
mines what dataset will be published. Figure 5 illustrates
shot dataset according to the new schema, otherwise, only
the activity diagram of schema management.
an increment-update dataset will be requested. When the
required data objects arrived, Data Filter only saves inter-
ested data according to use-defined strategies to reduce the
database file’s size.

2.2. Publishing schema management

In OODS, publishing schema is defined as a Class


PubSchema; every publishing definition is an instance
of that class. In this way, schema management can
use object-oriented technologies, such as: inheriting from
other schema to form a new publishing definition, encap-
sulating control data together with override conflict re-
solving functions, etc. Furthermore, publishing defini-
tions can be stored in database like other data objects, Figure 5. Activity diagram of schema manage
which simplifies updating, sending and persisting pro-
cesses. Subscribers are also defined as objects of Class
Subscriber. Figure 4 shows the class diagrams of Pub- When establishing a publishing schema initially, the
Schema and Subscriber. Property SuberList holds a sub- schema manager requests subscriber’s information from
scriber list; it is associated with a group of Subscriber ob- subscriber-group manager and then creates a subscriber list.
jects that contain authentication information of each sub- A pub-class list is also created according to publishing
scriber who subscribes this publication. This authenti- strategies. Now, schema manager uses the two lists to es-
cation information helps ensure the subscriber’s identity. tablish pub-objects and stores them into the DB4O database.
Property ClassList holds publishing class list, these classes When publishing schema has to be modified, schema man-
are included in this publication, i.e. only subscribers ager firstly searches for the pub-object and fetch it into main
in the SuberList can subscribe objects of classes in the memory from database. Since publication is also an ob-
ClassList. Methods UpdateSuberList(IList<Subscriber>) ject, search process uses the “SELECT” operation provided
and UpdateClassList(IList<Type>) are used to maintain by DB4O engine. Next, schema manager updates the ob-
SuberList and ClassList, respectively. To judge whether a ject’s subscriber list and class list through its two methods:
data object is required to be synchronized, method IsRe- UpdateSuberList() and UpdateClassList(). At last, schema
quireSync(object) will be called, it will be override if dif- manager stores the modified object back into the database.

135

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.
2.3. Synchronization process

In OODS, like other data synchronizing technology, the


data synchronization process is launched by subscribers.
OODS provides three data synchronization modes: upload-
sync, download-sync and bi-sync, which three support dif-
ferent application scenarios.
(1) Upload-sync is suitable for data collection central-
ized business logic. In this mode, subscribers only submit
their data update to the publisher and the latter synchronizes
its local data after conflict resolving.
(2) Download-sync is more efficient when there’re a
mount of query operations in business logic. This time,
the Subscriber-Agent sends a request for synchronizing data
with its identity. Publisher-Agent checks the authentication
information by sending a message to the schema manager.
If the identity confirmed, schema manager will search for
the pub-object that subscribed by the subscriber in database
and then send the pub-object to the subscriber through Figure 6. Sequence diagram of Bi-sync
Publisher-Agent. Then, publisher continues to serve other
subscribers in the subscribe-queue until a data request is
3.1. Experimental environment
ready in the data-request-queue. In this way, many syn-
chronization processes are parallel in the application layer,
which improves OODS’s throughput. When subscriber re- Our testing mobile application contains seven mobile
ceives the pub-object, it checks whether the object are up- nodes, one as publisher and the others as subscribers; each
dated. OODS deal with this work by using object version of them is a HP iPAQ rx4240 Pocket PC with 400MH CPU,
number. If the current version number of the pub-object 64MB SDRAM and 128MB ROM. They are running the
is greater than the old one, it is considered to be updated Windows Mobile 5.0 operating system. Their embedded
and Subscriber-Agent will prepare a new data-request ac- Bluetooth 2.0 + EDR (3MB/s) adapters are used to estab-
cording to new version pub-object and send it to publisher. lish a Piconet due to the advantages (low price, energy-
Otherwise, Subscriber-Agent only sends a data-request for saving, anti-jamming, scalability, flexibility) of Bluetooth
increment update dataset accord with previous pub-object. technology[7].
OODS and the experimental mobile application are both
(3) Bi-sync is the combination of upload and download
implemented by C# programming language with Microsoft
synchronizing modes. Figure 6 shows the sequence dia-
.NET Compact Framework, because they have the best
gram of bi-sync process. This mode is a trade off between
compatibility and efficiency on Windows operating sys-
upload and download modes, it is more convenient in com-
tems. To avoid impedance mismatch problem between
pound environments in which both query and modifying op-
object-oriented and relational models, the DB4O database
erations are necessary. After a subscriber verifying the pub-
engine is involved. It works as a dynamic link library and
object’s update status, the upload synchronizing process be-
its APIs are used to interact with it.
gins, the updated dataset is sent to publisher with the status
Deploy publishing module and subscribing parts of the
flag. Then download synchronizing process starts accord-
experimental application onto publisher and subscribers, re-
ing to the status flag, i.e. that flag decide which download
spectively. The schema of testing database is shown in Ta-
modes is chosen, snapshot or increment.
ble 1. It is designed into an object-oriented database, but
we illustrate it in table form for comparing it with rela-
tional database that using with MR. In Table 1, there are
3. Performance evaluation two classes Student and Course, every student object has a
property Course which represents a course schedule, it’s an
array of integer and holds the identity of each Course ob-
We study the performance of OODS by setting up a mo- ject. In this way, a multiple-to-multiple relation has been
bile application system based on OODS and deploying it created. The counterpart database schema using relational
over a Bluetooth Piconet[1, 7]. model is shown in Table 2, it has to contain an additional

136

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.
table Stu Cous to create the multiple-to-multiple relation.
In both two Tables, we assume that each student has ten
courses in his schedule and the number ’n’ has integer value
from 1 to 5 for evaluating OODS’s performance with differ-
ent synchronizing data quantity.

Table 1. Experimental object-oriented schema


Class Properties Type Sync-objects
Student Stu id int 100 × n
Stu name string
Course int[10]
Score float[10] Figure 7. Sync-delay in three sync-modes
Course Cous id int 10 × n
Cous name string
Credit float

Table 2. Experimental relational schema


Table Field Type Sync-records
Student Stu id int 100 × n
Stu name varcher
Course Cous id int 10 × n
Cous name varchar
Credit float Figure 8. Upload-sync response time
Stu Course Stu id int 100 × 10 × n
Cous id int
Score float Bidirectional synchronizing process includes upload and
download synchronization as well as conflict resolving pro-
cess. According to Table 1, when n = 5, it means that there
are 1100 objects are synchronized during that synchroniz-
3.2. Experimental results and analysis
ing process, as shown in Figure 10, it takes less than 70
seconds and satisfies common mobile applications.
We emphasize the effect of data quantity during syn-
chronizing process, which greatly affects the performance
of synchronizing response time. 4. Conclusion and future work
Figure 7 shows that the relationship between synchro-
nizing data quantity and response time is basically linear In this paper, we present the OODS, an object-oriented
in each sync-mode. In bi-sync mode, transferred data are data synchronizing schema for mobile database in mo-
double than the other two modes because it includes two bile ad-hoc networks. The schema adapts Publica-
phases: upload-sync and download-sync. tion/Subscription mode to fit object-oriented synchronizing
We also examine the performance of OODS versus MR. process. The object-oriented data model is used to acceler-
Figure 8, 9 and 10 shows the numerical results in three sync- ate synchronizing speed. The publishing schema manage-
modes, respectively. ment is introduced, which deals with subscriber authenti-
In the application layer, we can see that with our exper- cation and updates publishing definitions. We also explain
imental database, upload, download and bidirectional syn- why OODS facilitates business logic changes and applica-
chronizing delays of MR are, respectively, 2.16, 2.46 and tion updates. Three synchronizing modes are studied to
1.28 times higher on average than that of OODS. The syn- adapt different application scenarios. An experimental sys-
chronizing performance improved much, because OODS tem is built to evaluate OODS’s performance and then the
using object-oriented model and the design strategies are results indicate that OODS has a satisfied synchronizing ef-
object-oriented as well, which not only avoids impedance ficiency and scalability.
mismatch problem but also takes the advantages of object When data synchronizing scale is higher , the synchro-
database. nizing delay will be longer, it is necessary to reduce these

137

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.
[5] Y. Min and Q. Xiong. Study of synchronization technology
in mobile database. Journal of Wuhan University of Tech-
nology, 32:156–159, 2 2008.
[6] J. Paterson and S. Edlich. The Definitive Guide to db4o.
Apress, 2006.
[7] B. Tavli and W. Heinzelman. Mobile Ad Hoc Net-
works: Energy-Efficient Real-Time Data Communications.
Springer, 06 2006.
[8] A. Wigley and D. Moth. Microsoft Mobile Development
Handbook. Microsoft Press, Redmond, Washington, 2007.
[9] J. Xu. Object-oriented Database System and Application.
Science Press, Beijing, 2003.
[10] W. G. Yee and O. Frieder. Scalable synchronization of in-
termittently connected database clients. MDM 2005 05 Ayia
Napa Cyprus, ACM 1-59593-041-8/05/05.
Figure 9. Download-sync response time [11] A. Yeung and P. Stephenson. Oracle9i Mobile. McGraw-
Hill, 2002.
[12] X. Zhang and X. Meng. Kingbase lite: A smart mobile em-
bedded database system. IEEE, 0-7695-0589-2/00, 2000.

Figure 10. Bi-sync response time

delays advanced. Battery-power consumption is also a


deadly problem in mobile applications, therefore, energy-
saving will be enhanced.

5. Acknowledgement

This work was supported by National Natural Science


Foundation of China via the Grant NO. 60573104 and In-
novation Group Project from Yunnan University.

References

[1] H. Artail and M. Shihab. A distributed mobile database im-


plementation on pocket pc mobile device communicating
over bluetooth. Journal of Network and Computer Appli-
cation, doi:10.1016/j.jnca.2008.04.003, 2008.
[2] S. Byun and S. Moon. Resilient data management for repli-
cated mobile database systems. Data & Knowledge Engi-
neering, 29:43–55, 1999.
[3] S. Jing and X. Zhong. Designing of synchronizing system in
mobile dbma. Application Research of Computers, 6:193–
195, 2006.
[4] V. Kumar. Mobile Database Systems. John Wiley&Sons,
Inc., Hoboken, New Jersey, 2006.

138

Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.

You might also like