Transcript
Page 1: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

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

Yang Li, Xuejie Zhang, Yun GaoSchool of Information Science and Engineering

Yunnan UniversityKunming, China

[email protected]

Abstract

Data synchronization provides a feasible solution forimproving data accessibility and consistency in mobiledatabase systems. Flexible and efficient data synchro-nization, however, remains a challenging problem inmobile database applications over mobile ad-hoc net-works(MANET). This paper proposes a novel Object-Oriented Data Synchronization(OODS) schema in mobiledatabase systems, for providing a flexible and efficientdata synchronization service to applications running overMANET. OODS employs Publication/Subscription modeand DB4O as the database engine. Subscribers can recog-nize update of publishing schema automatically. On pub-lishers, publishing schema and conflict solutions can beuser-defined or inherited from the schema inheritance tree.Sample data were configured to conduct performance eval-uation over Bluetooth Piconet. The obtained results indi-cated the efficiency and feasibility of the schema and itspotential for synchronizing data in mobile database overMANET.

1. Introduction

A mobile ad-hoc network(MANET)[7] is used to pro-vide an instant wireless communication environment with-out any preexisting infrastructure. In MANET, an au-tonomous collection of mobile nodes communicate over rel-atively bandwidth constrained wireless links, the networktopology may change rapidly and unpredictably over time,mobile nodes have limited battery power and storage re-sources. Consequently, data accessibility is much limitedin this dynamic wireless communication environment thanwired ones. One possible method to solve this problem isto use mobile databases(MDB)[4] which provide a uniformdata accessing interface for mobile applications. Data syn-

chronization is always a complex and pivotal part in mobiledatabase systems, because it guarantees data consistency,improves data availability and decrease query response de-lay.

The data synchronization system maintains the consis-tency of multiple local databases in different mobile nodesso that each node can access local data instead of remoteones[4, 10]. In this way, synchronization can significantlyimprove distributed applications’ availability, reliability andscalability.

Data synchronization technology for mobile databasehas been broadly researched and a number of datasynchronization systems have been developed, such as:RDA and Merge Replication(MR) technology[8, 5] basedon Microsoft SQL Server with SQL CE, Mobile Synctechnology[11] based on Oracle Database with Oracle Liteand other technologies[2, 3, 12]. These technologies orsystems have some disadvantages that make them unsuit-able for mobile databases in MANET. First, they are de-signed for classical mobile database architecture[2], illus-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, mobilenodes such as PDAs and Smartphones, have limited powerand storage resource, which must be taken into considera-tion when designing a data synchronization system, becausemobile nodes cannot run a large-scale RDBMS. Figure 2shows the architecture of mobile database in MANET. Sec-ond, mobile applications usually need complex and com-pound data types, which are less supported in relationaldatabases[9]. Third, impedance mismatch problem betweenobject-oriented and relational models will bring additionaldevelopment difficulties and worsen efficiency.

In this paper, we propose a novel data synchronizationsystem for mobile databases, called Object-Oriented DataSynchronization (OODS), for providing an efficient andflexible data synchronization service in MANET. OODS

2008 International Symposium on Information Science and Engieering

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

DOI 10.1109/ISISE.2008.19

133

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

Page 2: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

uses DB4O[6] as database engine. DB4O is a pure object-oriented embedded database and also open-source software.OODS adopts Publication/Subscription mode[8], it treatseverything as an object. Publishing schema is defined asa Class and can be inherited by new publishing schema.

This paper is organized as follows. Section 2 describesthe OODS schema. Section 3 presents our implementationand experimental results of OODS, respectively. Section 4summarizes this paper and outlines our future work. Finally,section 5 gives an acknowledgement.

Figure 1. Classical architecture of MDB

Figure 2. MDB architecture in MANET

2. Object-Oriented Data Synchronization

2.1. System overview

Mobile applications must be scalable and easy-updatedto catch up with changefully business logic. Publi-cation/Subscription framework satisfies this requirementwell[8]. When the business logic has changed, only pub-lishing schema has to be changed instead of redeploy-ing updated application copies on a number of mobilenodes, each subscriber can synchronize hotspot data ac-cording to new publishing schema. So, we employ Publica-tion/Subscription mode in OODS. In a MANET, each mo-bile node maintains a local DB4O database independently

and equally. Mobile nodes are divided into two roles: pub-lisher and subscriber, as shown in Figure 2, a cluster headeris often chosen as publisher while cluster members as sub-scribers, because cluster header usually has more powerfulCPU, energy and storage resource. A publisher can also bea subscriber in upper cluster networks, only if it is a clustermember in the upper cluster.

In OODS, everything is an object, including our applica-tions, data records and publications. Data and Publicationsare 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. Thisis also accord with the real application scenario in which afew mobile nodes usually have the same business logic orcomputing 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 reducedatabase file’s size.

Figure 3 illustrates the architecture of OODS. It is de-signed with two parts: publisher and subscriber, they com-municate over WiFi, Bluetooth, or other wireless ad-hocnetwork protocols which support TCP link.

Figure 3. OODS architecture

On the publisher, mobile application can access pub-lisher database directly or as a subscriber through thePublisher-Agent. The core part is Pub-Update modulewhich is in charge of publishing schema managing, conflictresolving and subscriber group managing. Publisher mustauthenticate each subscriber, so an access control list ismaintained by Subscriber Group Manager object which alsocooperates with Schema Manager to authenticate coming-insubscribers. When many subscribers update the same dataobject, 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.

Page 3: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

sages to Conflict Resolver object which resolves the con-flicts according to predefined strategies. Schema Managerdefines and maintains every publishing schema with thehelp of Subscriber Group Manager and Conflict Resolver,it also communicates with Publisher-Agent for publishingdata objects to subscribers.

On the subscribers, mobile applications access their lo-cal database when they are off line. Once they go back tothe 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 responsessubscribers with their publishing schema instead of dataset,which unlike other synchronizing technologies such as MRthat sends data directly to the subscribers. This design strat-egy eases the burden on publishers, because their limitedhardware resources and they may have to deal with manysynchronizing jobs at the same time. OODS puts part ofthe synchronizing works onto the subscribers. When thesubscribers receives publishing schema which is an object,they compare with the old schema to find changes. If theschema has changed, Subscriber-Agent will request a snap-shot dataset according to the new schema, otherwise, onlyan increment-update dataset will be requested. When therequired data objects arrived, Data Filter only saves inter-ested data according to use-defined strategies to reduce thedatabase file’s size.

2.2. Publishing schema management

In OODS, publishing schema is defined as a ClassPubSchema; every publishing definition is an instanceof that class. In this way, schema management canuse object-oriented technologies, such as: inheriting fromother 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,which simplifies updating, sending and persisting pro-cesses. Subscribers are also defined as objects of ClassSubscriber. Figure 4 shows the class diagrams of Pub-Schema and Subscriber. Property SuberList holds a sub-scriber list; it is associated with a group of Subscriber ob-jects that contain authentication information of each sub-scriber who subscribes this publication. This authenti-cation information helps ensure the subscriber’s identity.Property ClassList holds publishing class list, these classesare included in this publication, i.e. only subscribersin the SuberList can subscribe objects of classes in theClassList. Methods UpdateSuberList(IList<Subscriber>)and UpdateClassList(IList<Type>) are used to maintainSuberList and ClassList, respectively. To judge whether adata object is required to be synchronized, method IsRe-quireSync(object) will be called, it will be override if dif-

ferent synchronizing strategies have to be satisfied.

Figure 4. Class diagrams of PubSchema & Subscriber

Publishing schema management is the core part of pub-lishing process. It affects application’s efficiency and deter-mines what dataset will be published. Figure 5 illustratesthe activity diagram of schema management.

Figure 5. Activity diagram of schema manage

When establishing a publishing schema initially, theschema manager requests subscriber’s information fromsubscriber-group manager and then creates a subscriber list.A pub-class list is also created according to publishingstrategies. Now, schema manager uses the two lists to es-tablish pub-objects and stores them into the DB4O database.When publishing schema has to be modified, schema man-ager firstly searches for the pub-object and fetch it into mainmemory from database. Since publication is also an ob-ject, search process uses the “SELECT” operation providedby DB4O engine. Next, schema manager updates the ob-ject’s subscriber list and class list through its two methods:UpdateSuberList() and UpdateClassList(). At last, schemamanager 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.

Page 4: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

2.3. Synchronization process

In OODS, like other data synchronizing technology, thedata 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 submittheir data update to the publisher and the latter synchronizesits local data after conflict resolving.

(2) Download-sync is more efficient when there’re amount of query operations in business logic. This time,the Subscriber-Agent sends a request for synchronizing datawith its identity. Publisher-Agent checks the authenticationinformation by sending a message to the schema manager.If the identity confirmed, schema manager will search forthe pub-object that subscribed by the subscriber in databaseand then send the pub-object to the subscriber throughPublisher-Agent. Then, publisher continues to serve othersubscribers in the subscribe-queue until a data request isready 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-ceives the pub-object, it checks whether the object are up-dated. OODS deal with this work by using object versionnumber. If the current version number of the pub-objectis greater than the old one, it is considered to be updatedand Subscriber-Agent will prepare a new data-request ac-cording to new version pub-object and send it to publisher.Otherwise, Subscriber-Agent only sends a data-request forincrement update dataset accord with previous pub-object.

(3) Bi-sync is the combination of upload and downloadsynchronizing modes. Figure 6 shows the sequence dia-gram of bi-sync process. This mode is a trade off betweenupload and download modes, it is more convenient in com-pound environments in which both query and modifying op-erations are necessary. After a subscriber verifying the pub-object’s update status, the upload synchronizing process be-gins, the updated dataset is sent to publisher with the statusflag. Then download synchronizing process starts accord-ing to the status flag, i.e. that flag decide which downloadmodes is chosen, snapshot or increment.

3. Performance evaluation

We study the performance of OODS by setting up a mo-bile application system based on OODS and deploying itover a Bluetooth Piconet[1, 7].

Figure 6. Sequence diagram of Bi-sync

3.1. Experimental environment

Our testing mobile application contains seven mobilenodes, one as publisher and the others as subscribers; eachof them is a HP iPAQ rx4240 Pocket PC with 400MH CPU,64MB SDRAM and 128MB ROM. They are running theWindows Mobile 5.0 operating system. Their embeddedBluetooth 2.0 + EDR (3MB/s) adapters are used to estab-lish a Piconet due to the advantages (low price, energy-saving, anti-jamming, scalability, flexibility) of Bluetoothtechnology[7].

OODS and the experimental mobile application are bothimplemented by C# programming language with Microsoft.NET Compact Framework, because they have the bestcompatibility and efficiency on Windows operating sys-tems. To avoid impedance mismatch problem betweenobject-oriented and relational models, the DB4O databaseengine is involved. It works as a dynamic link library andits APIs are used to interact with it.

Deploy publishing module and subscribing parts of theexperimental application onto publisher and subscribers, re-spectively. The schema of testing database is shown in Ta-ble 1. It is designed into an object-oriented database, butwe illustrate it in table form for comparing it with rela-tional database that using with MR. In Table 1, there aretwo classes Student and Course, every student object has aproperty Course which represents a course schedule, it’s anarray of integer and holds the identity of each Course ob-ject. In this way, a multiple-to-multiple relation has beencreated. The counterpart database schema using relationalmodel 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.

Page 5: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

table Stu Cous to create the multiple-to-multiple relation.In both two Tables, we assume that each student has tencourses in his schedule and the number ’n’ has integer valuefrom 1 to 5 for evaluating OODS’s performance with differ-ent synchronizing data quantity.

Table 1. Experimental object-oriented schemaClass Properties Type Sync-objectsStudent Stu id int 100× n

Stu name stringCourse int[10]Score float[10]

Course Cous id int 10× nCous name stringCredit float

Table 2. Experimental relational schemaTable Field Type Sync-recordsStudent Stu id int 100× n

Stu name varcherCourse Cous id int 10× n

Cous name varcharCredit float

Stu Course Stu id int 100× 10× nCous id intScore float

3.2. Experimental results and analysis

We emphasize the effect of data quantity during syn-chronizing process, which greatly affects the performanceof synchronizing response time.

Figure 7 shows that the relationship between synchro-nizing data quantity and response time is basically linearin each sync-mode. In bi-sync mode, transferred data aredouble than the other two modes because it includes twophases: upload-sync and download-sync.

We also examine the performance of OODS versus MR.Figure 8, 9 and 10 shows the numerical results in three sync-modes, respectively.

In the application layer, we can see that with our exper-imental database, upload, download and bidirectional syn-chronizing delays of MR are, respectively, 2.16, 2.46 and1.28 times higher on average than that of OODS. The syn-chronizing performance improved much, because OODSusing object-oriented model and the design strategies areobject-oriented as well, which not only avoids impedancemismatch problem but also takes the advantages of objectdatabase.

Figure 7. Sync-delay in three sync-modes

Figure 8. Upload-sync response time

Bidirectional synchronizing process includes upload anddownload synchronization as well as conflict resolving pro-cess. According to Table 1, when n = 5, it means that thereare 1100 objects are synchronized during that synchroniz-ing process, as shown in Figure 10, it takes less than 70seconds and satisfies common mobile applications.

4. Conclusion and future work

In this paper, we present the OODS, an object-orienteddata synchronizing schema for mobile database in mo-bile ad-hoc networks. The schema adapts Publica-tion/Subscription mode to fit object-oriented synchronizingprocess. The object-oriented data model is used to acceler-ate synchronizing speed. The publishing schema manage-ment is introduced, which deals with subscriber authenti-cation and updates publishing definitions. We also explainwhy OODS facilitates business logic changes and applica-tion updates. Three synchronizing modes are studied toadapt different application scenarios. An experimental sys-tem is built to evaluate OODS’s performance and then theresults indicate that OODS has a satisfied synchronizing ef-ficiency and scalability.

When data synchronizing scale is higher , the synchro-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.

Page 6: Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc

Figure 9. Download-sync response time

Figure 10. Bi-sync response time

delays advanced. Battery-power consumption is also adeadly problem in mobile applications, therefore, energy-saving will be enhanced.

5. Acknowledgement

This work was supported by National Natural ScienceFoundation 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 communicatingover 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 inmobile dbma. Application Research of Computers, 6:193–195, 2006.

[4] V. Kumar. Mobile Database Systems. John Wiley&Sons,Inc., Hoboken, New Jersey, 2006.

[5] Y. Min and Q. Xiong. Study of synchronization technologyin 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 DevelopmentHandbook. 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 AyiaNapa Cyprus, ACM 1-59593-041-8/05/05.

[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.

138

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


Recommended