Object-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc
2008 International Symposium on Information Science and EngieeringObject-Oriented Data Synchronization for Mobile Database over Mobile Ad-hoc NetworksYang Li, Xuejie Zhang, Yun Gao School of Information Science and Engineering Yunnan University Kunming, China firstname.lastname@example.orgAbstractData synchronization provides a feasible solution for improving data accessibility and consistency in mobile database systems. Flexible and efcient data synchronization, however, remains a challenging problem in mobile database applications over mobile ad-hoc networks(MANET). This paper proposes a novel ObjectOriented Data Synchronization(OODS) schema in mobile database systems, for providing a exible and efcient data synchronization service to applications running over MANET. OODS employs Publication/Subscription mode and DB4O as the database engine. Subscribers can recognize update of publishing schema automatically. On publishers, publishing schema and conict solutions can be user-dened or inherited from the schema inheritance tree. Sample data were congured to conduct performance evaluation over Bluetooth Piconet. The obtained results indicated the efciency and feasibility of the schema and its potential for synchronizing data in mobile database over MANET.chronization is always a complex and pivotal part in mobile database systems, because it guarantees data consistency, improves data availability and decrease query response delay. The data synchronization system maintains the consistency of multiple local databases in different mobile nodes so that each node can access local data instead of remote ones[4, 10]. In this way, synchronization can signicantly improve distributed applications availability, reliability and scalability. Data synchronization technology for mobile database has been broadly researched and a number of data synchronization systems have been developed, such as: RDA and Merge Replication(MR) technology[8, 5] based on Microsoft SQL Server with SQL CE, Mobile Sync technology based on Oracle Database with Oracle Lite and other technologies[2, 3, 12]. These technologies or systems have some disadvantages that make them unsuitable for mobile databases in MANET. First, they are designed for classical mobile database architecture, illustrated in Figure 1, they work well to synchronize data between mobile database and enterprise-level large-scale relational databases. While, in MANET, however, mobile nodes such as PDAs and Smartphones, have limited power and storage resource, which must be taken into consideration when designing a data synchronization system, because mobile nodes cannot run a large-scale RDBMS. Figure 2 shows the architecture of mobile database in MANET. Second, mobile applications usually need complex and compound data types, which are less supported in relational databases. Third, impedance mismatch problem between object-oriented and relational models will bring additional development difculties and worsen efciency. In this paper, we propose a novel data synchronization system for mobile databases, called Object-Oriented Data Synchronization (OODS), for providing an efcient and exible data synchronization service in MANET. OODS1331. IntroductionA mobile ad-hoc network(MANET) is used to provide an instant wireless communication environment without any preexisting infrastructure. In MANET, an autonomous collection of mobile nodes communicate over relatively bandwidth constrained wireless links, the network topology may change rapidly and unpredictably over time, mobile nodes have limited battery power and storage resources. Consequently, data accessibility is much limited in this dynamic wireless communication environment than wired ones. One possible method to solve this problem is to use mobile databases(MDB) which provide a uniform data accessing interface for mobile applications. Data syn978-0-7695-3494-7/08 $25.00 2008 IEEE DOI 10.1109/ISISE.2008.19Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.uses DB4O as database engine. DB4O is a pure objectoriented embedded database and also open-source software. OODS adopts Publication/Subscription mode, it treats everything as an object. Publishing schema is dened as a Class and can be inherited by new publishing schema. This paper is organized as follows. Section 2 describes the OODS schema. Section 3 presents our implementation and experimental results of OODS, respectively. Section 4 summarizes this paper and outlines our future work. Finally, section 5 gives an acknowledgement.Figure 1. Classical architecture of MDBand equally. Mobile nodes are divided into two roles: publisher and subscriber, as shown in Figure 2, a cluster header is often chosen as publisher while cluster members as subscribers, because cluster header usually has more powerful CPU, energy and storage resource. A publisher can also be a subscriber in upper cluster networks, only if it is a cluster member in the upper cluster. In OODS, everything is an object, including our applications, data records and publications. Data and Publications are both stored in the publishers local database, so that, publication object and data have a uniform access and management interface. To simplify publishing management, each publication can have many subscribers. These subscribers 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 denition of publishing strategies for a subscriber group while each subscriber in the group can has its own data lters to reduce database les size. Figure 3 illustrates the architecture of OODS. It is designed with two parts: publisher and subscriber, they communicate over WiFi, Bluetooth, or other wireless ad-hoc network protocols which support TCP link.Figure 2. MDB architecture in MANET2. Object-Oriented Data Synchronization2.1. System overviewMobile applications must be scalable and easy-updated to catch up with changefully business logic. Publication/Subscription framework satises this requirement well. When the business logic has changed, only publishing schema has to be changed instead of redeploying updated application copies on a number of mobile nodes, each subscriber can synchronize hotspot data according to new publishing schema. So, we employ Publication/Subscription mode in OODS. In a MANET, each mobile node maintains a local DB4O database independently Figure 3. OODS architecture On the publisher, mobile application can access publisher database directly or as a subscriber through the Publisher-Agent. The core part is Pub-Update module which is in charge of publishing schema managing, conict resolving and subscriber group managing. Publisher must authenticate each subscriber, so an access control list is maintained by Subscriber Group Manager object which also cooperates with Schema Manager to authenticate coming-in subscribers. When many subscribers update the same data object, conicts will occur, Schema Manager object mes-134Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.sages to Conict Resolver object which resolves the conicts according to predened strategies. Schema Manager denes and maintains every publishing schema with the help of Subscriber Group Manager and Conict Resolver, it also communicates with Publisher-Agent for publishing data objects to subscribers. On the subscribers, mobile applications access their local database when they are off line. Once they go back to the network or up to date data are required, data synchronization starts. Subscriber-Agent rst sends a subscribe request 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 strategy eases the burden on publishers, because their limited hardware resources and they may have to deal with many 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, they compare with the old schema to nd changes. If the schema has changed, Subscriber-Agent will request a snapshot dataset according to the new schema, otherwise, only an increment-update dataset will be requested. When the required data objects arrived, Data Filter only saves interested data according to use-dened strategies to reduce the database les size.ferent synchronizing strategies have to be satised.Figure 4. Class diagrams of PubSchema & SubscriberPublishing schema management is the core part of publishing process. It affects applications efciency and determines what dataset will be published. Figure 5 illustrates the activity diagram of schema management.2.2. Publishing schema managementIn OODS, publishing schema is dened as a Class PubSchema; every publishing denition 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 denition, encapsulating control data together with override conict resolving functions, etc. Furthermore, publishing denitions can be stored in database like other data objects, which simplies updating, sending and persisting processes. Subscribers are also dened as objects of Class Subscriber. Figure 4 shows the class diagrams of PubSchema and Subscriber. Property SuberList holds a subscriber list; it is associated with a group of Subscriber objects that contain authentication information of each subscriber who subscribes this publication. This authentication information helps ensure the subscribers identity. Property ClassList holds publishing class list, these classes are included in this publication, i.e. only subscribers in the SuberList can subscribe objects of classes in the ClassList. Methods UpdateSuberList(IList) and UpdateClassList(IList) are used to maintain SuberList and ClassList, respectively. To judge whether a data object is required to be synchronized, method IsRequireSync(object) will be called, it will be override if dif-Figure 5. Activity diagram of schema manageWhen establishing a publishing schema initially, the schema manager requests subscribers information from subscriber-group manager and then creates a subscriber list. A pub-class list is also created according to publishing strategies. Now, schema manager uses the two lists to establish pub-objects and stores them into the DB4O database. When publishing schema has to be modied, schema manager rstly searches for the pub-object and fetch it into main memory from database. Since publication is also an object, search process uses the SELECT operation provided by DB4O engine. Next, schema manager updates the objects subscriber list and class list through its two methods: UpdateSuberList() and UpdateClassList(). At last, schema manager stores the modied object back into the database.135Authorized 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 processIn OODS, like other data synchronizing technology, the data synchronization process is launched by subscribers. OODS provides three data synchronization modes: uploadsync, download-sync and bi-sync, which three support different application scenarios. (1) Upload-sync is suitable for data collection centralized business logic. In this mode, subscribers only submit their data update to the publisher and the latter synchronizes its local data after conict resolving. (2) Download-sync is more efcient when therere 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 conrmed, 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 Publisher-Agent. Then, publisher continues to serve other subscribers in the subscribe-queue until a data request is ready in the data-request-queue. In this way, many synchronization processes are parallel in the application layer, which improves OODSs throughput. When subscriber receives the pub-object, it checks whether the object are updated. OODS deal with this work by using object version number. If the current version number of the pub-object is greater than the old one, it is considered to be updated and Subscriber-Agent will prepare a new data-request according to new version pub-object and send it to publisher. Otherwise, Subscriber-Agent only sends a data-request for increment update dataset accord with previous pub-object. (3) Bi-sync is the combination of upload and download synchronizing modes. Figure 6 shows the sequence diagram of bi-sync process. This mode is a trade off between upload and download modes, it is more convenient in compound environments in which both query and modifying operations are necessary. After a subscriber verifying the pubobjects update status, the upload synchronizing process begins, the updated dataset is sent to publisher with the status ag. Then download synchronizing process starts according to the status ag, i.e. that ag decide which download modes is chosen, snapshot or increment.Figure 6. Sequence diagram of Bi-sync3.1. Experimental environmentOur testing mobile application contains seven mobile nodes, one as publisher and the others as subscribers; each of them is a HP iPAQ rx4240 Pocket PC with 400MH CPU, 64MB SDRAM and 128MB ROM. They are running the Windows Mobile 5.0 operating system. Their embedded Bluetooth 2.0 + EDR (3MB/s) adapters are used to establish a Piconet due to the advantages (low price, energysaving, anti-jamming, scalability, exibility) of Bluetooth technology. OODS and the experimental mobile application are both implemented by C# programming language with Microsoft .NET Compact Framework, because they have the best compatibility and efciency on Windows operating systems. To avoid impedance mismatch problem between object-oriented and relational models, the DB4O database engine is involved. It works as a dynamic link library and its APIs are used to interact with it. Deploy publishing module and subscribing parts of the experimental application onto publisher and subscribers, respectively. The schema of testing database is shown in Table 1. It is designed into an object-oriented database, but we illustrate it in table form for comparing it with relational database that using with MR. In Table 1, there are two classes Student and Course, every student object has a property Course which represents a course schedule, its an array of integer and holds the identity of each Course object. In this way, a multiple-to-multiple relation has been created. The counterpart database schema using relational model is shown in Table 2, it has to contain an additional3. Performance evaluationWe study the performance of OODS by setting up a mobile application system based on OODS and deploying it over a Bluetooth Piconet[1, 7].136Authorized 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 OODSs performance with different 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 Score oat Course Cous id int 10 n Cous name string Credit oatFigure 7. Sync-delay in three sync-modesTable 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 oat Stu Course Stu id int 100 10 n Cous id int Score oatFigure 8. Upload-sync response time Bidirectional synchronizing process includes upload and download synchronization as well as conict resolving process. According to Table 1, when n = 5, it means that there are 1100 objects are synchronized during that synchronizing process, as shown in Figure 10, it takes less than 70 seconds and satises common mobile applications.3.2. Experimental results and analysisWe emphasize the effect of data quantity during synchronizing process, which greatly affects the performance of synchronizing response time. Figure 7 shows that the relationship between synchronizing data quantity and response time is basically linear in each sync-mode. In bi-sync mode, transferred data are double than the other two modes because it includes two phases: 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 syncmodes, respectively. In the application layer, we can see that with our experimental database, upload, download and bidirectional synchronizing delays of MR are, respectively, 2.16, 2.46 and 1.28 times higher on average than that of OODS. The synchronizing performance improved much, because OODS using object-oriented model and the design strategies are object-oriented as well, which not only avoids impedance mismatch problem but also takes the advantages of object database.4. Conclusion and future workIn this paper, we present the OODS, an object-oriented data synchronizing schema for mobile database in mobile ad-hoc networks. The schema adapts Publication/Subscription mode to t object-oriented synchronizing process. The object-oriented data model is used to accelerate synchronizing speed. The publishing schema management is introduced, which deals with subscriber authentication and updates publishing denitions. We also explain why OODS facilitates business logic changes and application updates. Three synchronizing modes are studied to adapt different application scenarios. An experimental system is built to evaluate OODSs performance and then the results indicate that OODS has a satised synchronizing efciency and scalability. When data synchronizing scale is higher , the synchronizing delay will be longer, it is necessary to reduce these137Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.Figure 9. Download-sync response time Y. Min and Q. Xiong. Study of synchronization technology in mobile database. Journal of Wuhan University of Technology, 32:156159, 2 2008.  J. Paterson and S. Edlich. The Denitive Guide to db4o. Apress, 2006.  B. Tavli and W. Heinzelman. Mobile Ad Hoc Networks: Energy-Efcient Real-Time Data Communications. Springer, 06 2006.  A. Wigley and D. Moth. Microsoft Mobile Development Handbook. Microsoft Press, Redmond, Washington, 2007.  J. Xu. Object-oriented Database System and Application. Science Press, Beijing, 2003.  W. G. Yee and O. Frieder. Scalable synchronization of intermittently connected database clients. MDM 2005 05 Ayia Napa Cyprus, ACM 1-59593-041-8/05/05.  A. Yeung and P. Stephenson. Oracle9i Mobile. McGrawHill, 2002.  X. Zhang and X. Meng. Kingbase lite: A smart mobile embedded 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, energysaving will be enhanced.5. AcknowledgementThis work was supported by National Natural Science Foundation of China via the Grant NO. 60573104 and Innovation Group Project from Yunnan University.References H. Artail and M. Shihab. A distributed mobile database implementation on pocket pc mobile device communicating over bluetooth. Journal of Network and Computer Application, doi:10.1016/j.jnca.2008.04.003, 2008.  S. Byun and S. Moon. Resilient data management for replicated mobile database systems. Data & Knowledge Engineering, 29:4355, 1999.  S. Jing and X. Zhong. Designing of synchronizing system in mobile dbma. Application Research of Computers, 6:193 195, 2006.  V. Kumar. Mobile Database Systems. John Wiley&Sons, Inc., Hoboken, New Jersey, 2006.138Authorized licensed use limited to: Chaitanya Bharathi Institute of Technology. Downloaded on November 24, 2009 at 00:24 from IEEE Xplore. Restrictions apply.