A distributed mobile database implementation on Pocket PC mobile devices communicating over Bluetooth

  • Published on

  • View

  • Download

Embed Size (px)


  • A distributed mobile daon Pocket PC mobile deover Bluetooth

    Hassan Artail a,, Manal Shihab


    ut, Leb


    of the

    ith a

    ed in


    As mobile applications have become more ubiquitous, the demand for database data in mobile


    Contents lists available at ScienceDirect

    Journal of Network and

    Journal of Network and Computer Applications 32 (2009) 961151084-8045/$ - see front matter & 2008 Elsevier Ltd. All rights reserved.settings has increased, and this has created a need for engineering database architectures that are


    Corresponding author. Tel.: +9611350000; fax: +9611744462.E-mail addresses: hartail@aub.edu.lb (H. Artail), mas83@aub.edu.lb (M. Shihab), hs33@aub.edu.lb (H. Safa).1. Introductionconsumption. The obtained results indicated the feasibility

    system and its potential for providing mobile users w

    framework for aggregating disparate data that are stor

    mobile databases in the wireless ad hoc network.

    & 2008 Elsevier Ltd. All rights resData availability

    Mobile databases

    Distributed database

    Mobile computing


    operating system and communicate using Bluetooth, thus limiting

    the architecture to eight devices, which is a restriction imposed by

    piconets. Sample databases were congured on the devices that

    ran the SQL Server CE database engine, and a list of 170 sample

    queries of varying complexities were designed to conduct

    performance evaluation. This evaluation involved measurement

    of query response time, generated trafc, and device energya Department of Electrical and Computer Engin

    P.O. Box 11-0236, Riad El-Solh 1107 2020, Beirb Department of Computer Science, American U

    a r t i c l e i n f o

    Article history:

    Received 15 November 2007

    Received in revised form

    11 April 2008

    Accepted 14 April 2008

    Keywords:tabase implementationvices communicating

    a, Haidar Safa b

    , American University of Beirut,


    sity of Beirut, P.O. Box 11-0236, Riad El-Solh 1107 2020, Beirut, Lebanon

    a b s t r a c t

    This paper describes a distributed database system implementa-

    tion built on top of stand-alone mobile databases found on mobile

    devices. At the heart of the architecture are elected devices that

    take on the role of data directories which collect the schema of the

    databases and become the contact points for all nodes that wish

    to submit queries against the distributed database. The system is

    implemented on Pocket PCs that run the Microsoft WinCEjournal homepage: www.elsevier.com/locate/jnca

    Computer Applications

  • using the Bluetooth communication protocol, collaboration between mobile devices, and distributeddatabases in MANETs. Accordingly, this section briey discusses related work done in those areas.

    ARTICLE IN PRESSA study of recent research trends and experimental guidelines in MANETs, which was presentedby Dow et al. (2005), surveyed more than 1300 MANET related papers from 1998 to 2003. It wasfound that topics like routing and power management attracted most of the attention, while issuessuch as IP addressing, fault tolerance, and collaboration were also popular among MANETresearchers. In the qualitative analysis covered by the studied papers, factors such as scalability,stability, and reliability were of primary concern in major MANET issues. The framework ofdistributed mobile databases addressed in this paper is collaborative in the sense that nodes (mobiledevices) cooperate by providing services to each other in order to answer a mobile nodes query.Therefore, the subject of this paper contributes to the thrust of MANET research, and provides anactual implementation on Pocket PCs that communicate using Bluetooth (BT) through the formationof a piconet, where one master device can connect with up to seven active slave devices. A set ofpiconets connected through sharing devices form a scatternet. Although proposed in the standards,this function is still not well-developed today. Several scatternet protocols have been proposed butthe BlueTrees (Zaruba et al., 2001) and BlueStars (Petrioli et al., 2003) are most known and have beenthe subject of further studies and comparisons (Amin et al., 2006; Basagni et al., 2004). Of concern toour work is the fact that current implementations of Bluetooth communication on mobile computingdevices, like Pocket PCs and PalmOS handhelds, do not support masterslave role switching, andtherefore scatternets. For this reason, our current implementation is limited to a wireless network ofeight or less devices that communicate and form a piconet structure. Similarly, previous works thatinvolved BT communication were limited to piconets. For example, Altundag and Gokturk (2006)developed a scatternet formation protocol and implemented a chat room application that utilizedthis protocol using J2ME. However, given the lack of scatternet and masterslave role switching onmobile phones, major features of the proposed protocol did not make it to the implementation, andsuitable for such dynamic environments (Chan and Roddick, 2005). The most interesting andpromising form of such environments is the mobile ad hoc network (MANET) in which a mobile hostcan act as a source of information, destination, or a router that transfers data toward its destination.Mobile hosts are generally small computing devices with relatively limited resources that can join orleave the network unexpectedly at any time. In addition to the increasingly more complexapplications that are targeting such devices, more sophisticated mobile database managementsystems are being engineered to offer capabilities that parallel those of enterprise level databasesystems.

    The ultimate goal of our design and implementation is to provide a system through which mobiledevices share data in disconnected settings (i.e., away from an access point that connects these hoststo a xed network and through it to a central data source). That is, our work targets environments inwhich mobile hosts collaborate in answering each others queries. More specically, we develop adistributed database system on top of isolated mobile databases that exist on the mobile devices thathappen to be in close proximity with each other. The protocol we consider for communication isBluetooth which is prevalent on mobile devices due to its low cost and efcient utilization of batterypower. The implementation of the system involved several issues relating to locating the datasources for the particular query, fragmenting the query among the participating mobile devices, andjoining the individual results by some mobile device before returning them to the client application.

    The rest of the paper is organized as follows. Section 2 provides a survey of related work andbriey describes the employed technologies in our implementation. Sections 3 and 4 describe thedesign and implementation of the system, respectively, while Section 5 presents the performanceresults. Finally, the paper is concluded in Section 6.

    2. Literature overview

    The developed application described in this paper tackles three main areas, namely, connectivity

    H. Artail et al. / Journal of Network and Computer Applications 32 (2009) 96115 97as a result, the chat room application was restricted to work within a single piconet.

  • ARTICLE IN PRESS3. System architecture

    The proposed system provides a cooperative framework that builds a distributed database out ofpossibly heterogeneous databases running on mobile devices that may be roaming in the wirelessnetwork in close proximity (within transmission range) to each other. In the following, basicconcepts are covered, followed by a description of the modules that were implemented.

    3.1. Basic concepts

    The system consists of moving nodes that can take one of three possible roles, as depicted inFig. 1: requesting nodes (RNs), database nodes (DBNs), and a database directory (DD). A DBNnode has its own mobile database and is willing to be part of the one large database. On theother hand, the DD stores the schemas of the DBNs in the network and serves the RNs throughfragmenting their queries so they can be processed by the individual DBNs. An RN can be any nodethat sends its request (query) to the DD for processing. The latter will look up its schema to identifyall the DBNs that will participate in answering the query and will fragment the query accordingly.Fig. 1 shows a general diagram that illustrates the elements of the system, in particular the DD andDBN nodes.

    3.2. Data directory election

    The task of fragmentation is independent of the location and size of the data, and thus decidingwhich DD to perform fragmentation does not inuence the performance of the system. A DD nodemust meet some minimum criteria that involve expected time of staying in the network, battery life,and available memory. This translates into a score that each node must compute and updateOur work involves query processing and result coalescing. Several approaches have appearedthat discuss processing queries in distributed mobile environments. The scheme presented inKottkamp and Zukunft (1998) is one of such approaches. It aims to optimize location aware queriesfor mobile database systems, and develop a mobility-aware cost model that makes use of fuzzyinformation while trying to accommodate the limited resources of the mobile devices. Anotherapproach is the one described in Li (2004), which presents a cost evaluation model for joinoperations. It incorporates the primary parameters of wireless networks, including the size of thetransmitted data, the transmission distance, and the query cost at each node. To perform equi-joinoperations between nodes, the system executes a distributed query optimization procedure that iscomposed of two parts: distribution optimization and local optimization. The rst is based onreducing the communication cost while the second can be done using centralized databaseoptimization techniques. In Epstein et al. (1978), a set of algorithms for processing databasecommands that involve data from multiple mobile nodes in a distributed database environmentwere proposed. These algorithms use mechanisms to process queries by breaking the qualicationinto separate pieces using simple heuristics. The considered cost criteria are response time andcommunications trafc. Finally, the work in Kossmann (2000) presents a textbook architecture forquery processing and discusses a series of specic techniques for distributed database systems. Itdescribes several methods for shipping data from one site to others, implementing joins, andselection of sites for executing the elements of the queries. The query processor receives an SQLquery, translates and optimizes this query in several phases into an executable query plan, andexecutes the plan in order to obtain the results. For query optimization, a plan enumeration wasdeveloped with dynamic programming to produce optimal plans given that the cost model issufciently accurate. Such an algorithm has an exponential time and space complexity and istherefore not viable for complex queries, nor is it suitable for a distributed framework involvingmobile devices.

    H. Artail et al. / Journal of Network and Computer Applications 32 (2009) 9611598periodically. Nodes must communicate their scores to each other so that a DD is selected and




    Q DBN5










    Subquery Processing

    SubqueryDBN1 Su

    Subquery Processing




    Subquery Processing

    H. Artail et al. / Journal of Network and Computer Applications 32 (2009) 96115 99becomes known to the rest of the network. The DD is the node possessing the maximum score, andpreferably not a DBN (for load balancing). Hence, a node, upon joining the network, sends itscomputed scores through a message to all nodes that it discovers, and similarly, receives the scores ofothers after being discovered. The message includes, in addition to the score, a ag indicating if thenode holds a database. Having the scores of all nodes in the network, a node with the highest score,announces its role as a DD to the other devices via a different message. This prompts all DBN nodes tosend the schema of their databases to the new DD which will in turn use them for queryfragmentation and building the query plan tree (QPT).

    3.3. Coping with dynamic environments

    Mobile devices in a mobile ad hoc network may be highly mobile, and could go ofineunexpectedly. With Bluetooth, departed or disconnected devices can be readily detected (discovered)by other devices. However, depending on the mobility behavior, a device that goes out oftransmission range of the other devices that it used to connect to may go back in range shortly afterdisconnection. Similarly, a device that becomes unavailable (appears to have been turned off) for ashort period of time (e.g., due to using it by its user) may go back online soon afterwards. These


    Subquery Processing

    Subquery Processing

    DBNName DBNAddress SCN FTPSCN TableName Attributes Size DBN1 (00:12:D1:9B:E5:94) 09 03 Cinemas Cinema_Name,Mall_Name 105DBN2 (00:12:D1:9E:88:15) 09 03 Movies Movie_Name,CinemaName,Timings 588DBN3 (00:12:D1:9C:46:12) 09 03 Restaurants Restaurant_Name,Mall_Name,Specia 203DBN4 (00:12:D1:9C:BB:B9) 09 03 Restaurants Restaurant_Name,Mall_Name,Specia 290DBN5 (00:12:D1:28:06:83) 09 03 Malls Mall_Name,Address 153DBN5 (00:12:D1:28:32:11) 09 03 Stores Store_Name,Mall_Name,Products 852DBN5 (00:12:D1:9B:84:12) 09 03 Restaurants Restaurant_Name,Mall_Name,Specia 87

    Fig. 1. An illustrative example of the proposed system and the schema structure.

  • ARTICLE IN PRESS3.4. Query processing procedure

    The task of performing query processing in a distributed database environment reduces todeciding on a strategy for executing each part of the query over the network in the most cost-effective way. The process consists of the following steps: (1) query fragmentation, (2) QPTgeneration, and (3) result generation and joining into one set. If there are unions and/or joinsinvolved, and after constructing the QPT, the DD will include in each query fragment sent to aparticipating DBN the addresses and channel information of all participating DBN nodes along withags that specify the type of joint operation (i.e., union or join). This will imply to those DBNs thatthey must communicate to each other the sizes of their intermediate results in order to identify theone holding the largest dataset. That DBN will then be the receiver of intermediate results and thenode to actually perform the union or the join.

    The decomposition of the user query into subqueries on distributed relations is accomplishedusing the information in the schema of the DD that describes the distribution of the relations amongthe DBNs. The DD uses an algorithm that recursively breaks up the query into smaller pieces: a queryis rst decomposed into a sequence of subqueries each having a unique relation (monorelation) andone multirelation query. Each monorelation (Ri) and the address of the DBN that will execute it willbe added to a list of subqueri...