You are on page 1of 6

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.

ORG

147

A Comparison of Lightweight Databases in Mobile Systems


F. Tavakkoli, A. Andalib, A. Shahbahrami and R.Ebrahimi Atani
Abstract This paper tries to investigate some DBMS that are specially designed or optimized for mobile systems. This investigation emphasizes on some fundamental factors that in fact are the most significant features and parameters of DBMSs. First, it describes the necessity of applying LightWeight DBMS , which are briefly called LW in this paper. Then, it introduces each DBMS and explains its characteristics and finally, presents a general comparison by a table. It should be mentioned, that according to the variety of DBMSs and fast increased popularity and attraction of the Open Source, this paper studies in this scope in order to demonstrate a palpable comparison. Index Terms Ubiquitous Device, PDA, SQLite, Db4o, H2, DBMS, LightWeight, Mobile, DataBase

1 INTRODUCTION
Moreover, many of their features are not used in this particular usage (mobile systems) or might just have a minimum usage that can be ignored. These limitation and other special circumstance applies special specification for DBMSs in mobile systems. Lightweight is one of them and the some others are: Data Synchronization, Embedment in applications, Complex Operations for Advanced Applications, Self-Management, Remote management,[2],[3]. Therefore, nowadays many companies produce a LWDB or a LW version of their DBMS, such as Sql Lite, Hsqlbd, Oracle Lite, P2 and so on.

n recent years, thanks to concepts like Mobility in Action, Whenever Wherever and Continuous Connectivity in Mobile Space the rules of business, many changed and has moved into the dynamics. Today, not far from the mind that a manager with a handheld device like PDA or mobile phone can gain necessary information to complete his/her tasks while traveling in a car or on a plane. This prepared many opportunities for companies to develop conventional application for mobile systems. It is so clearly that DBMSs 1 are used in most application; even in many applications that you cannot think like browser application, antivirus software and so. The usage of DBMSs will not end here. Database systems can be used in small computer devices such as car navigator, sensor networks, smartcards, cellular phone, PDA, MP3 players and even in a robot. These small devices with mobility and embedded processors are called ubiquitous devices [1]. In general, every business that collects and monitors the data and operates a work base of them, where the data are somewhere out of the company's office, needs to apply LW. "LightWeight DBMS" term is used versus "General-Purpose DBMS" or "Heavyweight DBMS". According to the definition, LWDB are databases with high efficiency for special applications, that in this case, it is their usage in mobile systems. Although, there are several characteristics and facilities for regular databases that are used for many purposes, but they need more memory and processing. These are two limiting factors on mobile systems that will be discussed in the next section.

2 THE LIMITATIONS OF MOBILE SYSTEMS

The most significant limitations of mobile systems are their memory and their source of energy (battery). Although, the processor is another limiting factor but according to the improvement of mobile processors this factor is not as effective as others. Mobile devices such as; PDA, mobile phones, etc has limitation in terms of source of energy, thus the optimization of DBMS with the least sources to increase the efficiency has always been a challenge for this field of technology. Furthermore, limitation of memory is another factor of this challenge. To what extent the memory is accessible on systems at a time and how much of internal memory can be located in database? , These are other issues that prove the necessity to apply LWDB. Although, by improvement of technology the internal memories in mobile devices are increasing with a fast pace, but it should be considered that with a same proportion or even more, the content of savable data are F.Tavakkoli Author is with Department of IT, University of guilan, also rising. Nowadays, efficient software systems in Rasht,Guilan, IR.Iran. mobile devices such as; online and offline navigation A.Andalib Author is with Department of IT, University of guilan, Rasht and Department of SE, Islamic Azad University-Roudsar Branch, Roudsar, systems on GPS or any mobile devices that have this Guilan, IR.Iran. feature, has been developed quickly. The characteristics A.Shahbahrami Author is with Department of Computer engineering, of these systems are high content of savable data, need for University of guilan, Rasht,Guilan, IR.Iran. a fast access to data, searching or updating data trough R.Ebrahimi Atani Author is with Department of Computer engineering, University of guilan, Rasht,Guilan, IR.Iran. wireless or mobile networks. Applying these systems
2011 Journal of Computing Press, NY, USA, ISSN 2151-9617 http://sites.google.com/site/journalofcomputing/

1Database

Management Systems

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.ORG

148

without using LWDB is almost a difficult job with a low reliability. Especially, concepts like Data Replication between central server and the applied DBMS on the mobile system are inevitable.

complicated structures, presents high efficiency, too. Indeed, Dbo4 has been assessed 55 times faster than the similar devices, such as; MySql and Hibernate HsqlDB[5].

3 IDENTIFICATION OF COMPARED DATABASES


3.1 SQLite (v 3.6.18) SQLite is a system of functions that can apply a selfcontained and server-less SQL database with zero configurations and no transactional settings. These features are the fundamental component of LWDB that are well gathered in this system. In the official web site of SQLite [4] the slogan of Small, Fast and Reliable can be observed that shows the general strategy of production and supporting system. SQLite is an embedded SQL database engine that unlike many other databases has no independent server for this purpose and the data are readable and writable directly through a file on normal disks. A complete database involves; tables, triggers, indexes and views only on a file of a disk. The file structure is cross-platform and can be easily transferred between 32 and 64-bit bases. SQLite is a compressed library that is 300KB in content and if it is optional facilities be ignored it reduces to 180KBs. In addition, SQLite is designed to occupy the least stack (4KB) and heap (100KB). Therefore, SQLite is a popular database engine in devices with limited memory, such as; cell phones, PDA and MP3 Players. There is a relation between memory and speed; SQLite normally operates faster if it allocated with more memory but even with limited memory, it has a good and acceptable efficiency. 3.2 Db4object (v 7.1) Dbo4 is a dynamic, flexible and open source database that allows the developers of Java and .Net to publicize their applications at the least time and with minimum expenses while there is high efficiency. The special design of Dbo4 database engine has made it an ideal option to be used in mobile devices, desktop systems or Real-time systems. Dbo4 present a good level of efficiency to its users and make them able to focus on the business instead of getting confused in complicated databases. Briefly, in all Net and Java systems that there is no need for an independent database management, Dbo4 can be used. All the OO 2 softwares' developers are familiar with this idea and changing it to a relational structure. In the past, they had to choose between the speed and the object orientation, because although SQL makes the access fast but it is difficult to use and needs some extra codes to be added into its program. Object oriented provides an appropriate link to its users but extremely decreases the efficiency and lead them to interpret the limitations and the logics of the business instead of concentration on it. Dbo4 has made a good proportion between OO and efficiency. While it allows the user to save objects with
2object

3.3 H2 (v 1.1) H2 is a relational database that is written in Java language. H2 derives from Hypersonic2 because the designer of H2 engine, Mr. Thomas Mueller, was the developer of Hypersonic SQL in 2001. Then, he started to design H2 in 2004 and supplied the first version of it in 2005. Actually, there is no common code between H2 and Hypersonic Sql and its design and programming was completely separate. Except the factors that specially will be discussed, there are prominent and considerable points about H2 that in most cases distinguishes it from the DBMS in the same level. Some examples of these cases could be; the ability to establish the database on the memory and disk making a database that is just readable and temporary tables supporting multiple links and table lock creation of a password for database by techniques like XTEA, AES and also by coding SHA-256 complete support of trigger supporting of many predefined functions including XML and data compressing functions by Lossless method complete compatibility with many databases, such as; IBM DB2, MSSQL Server, HSQLDB, Apache Derby and PostgreSQL, Oracle and MySQL supporting of prominent types of b-tree, tree, hash using of checksum for any record to ensure the accuracy of data and so forth.

4 COMPARISON OF SOME PROMINENT CHARACTERISTICS IN DBMSS AND PARTICULARLY IN LWDB


4.1 Acid Compliance In mobile and wireless platform, the nature of data processing remains the same, but the situations under which data are processed may change. It is, therefore, important to understand the effect of mobility on data distribution and ACID properties of transactions [6]. The databases should support four basic characteristics to ensure the accuracy of data. These four features are called ACID and are including the following items [7]: Atomicity: is a transaction of an inseparable unit of a process. It means, it would apply entirely or never would be applied. Consistency preservation: it takes the transaction or database to a compatible position or if it fails all the data will return to the position that was before the transaction. Isolation: one transaction will be isolate from the other transactions when it performs. It means the application of a transaction has no impact on the other transactions that are simultaneously applied. Durability: applied changes in a database by a committed transaction should exist in the bank. These changes should not waste because of any failure in process.

oriented

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.ORG

149

In SQLite: SQLite properly react to the flaws of allocating incorrect memory and the errors of reading and writing of the disk. Thus, there are ACID feature for the transactions, even if they lose their source of energy or have a delay in their operation system. The extensive test suite that comes as part of the SQLite package contains thousands of test cases which combine to provide many thousands of executable tests. The test suite provides 100% code coverage for every SQLite release[8]. In Db4object: Dbo4 entirely supports from the ACID features in transactions. In other words, in addition to the characteristics such as; thread, safety, automatic recovery and online backup, Db4o is 100% ACID compliant. In H2: H2 is always atomic. As a presumption, the database is constantly in a consistent situation. In H2, isolation that is actually read committed, are considered like most primary databases. However, it presents a proper level of efficiency; but in fact, the transactions are not completely isolated. Therefore, in addition to the mentioned features, H2 supports other ones such as; serializable and unread committed [9]. Unfortunately, H2 do not guaranty to maintain and complete all the transactions when the power source is lost. The experiments have shown that losing the power can cause to having some uncompleted transactions and losing data. Hence, durability, which is the fourth feature of ACID, is not entirely supported by H2, so it cannot be recognized as a full acid database; although in terms of durability, H2 has presented some techniques like clustering that can solve this problem. However, it should be mentioned that in most databases similar to H2 there is this flaw, such as; HSQLDB, PostgreSQL, Derby.

object oriented API s such as; Native Queries (NQ), S.O.D.A, Query By Example (QbE), LINQ and API for XML trough tools like Xstream. Although, it is not possible to directly perform SQLs questions, but as it has the ability for replication with most RDBMS, it can be done by them. In H2: H2 is accessible by two interfaces; one by ADO.NET API and the other by JDBC API. Also, H2 supports ODBC Driver. Although, it currently does not have this feature but it is accessible by PostgreSQL ODBC [9].

4.3 Platform In SQLite: SQLite is independent from the platform and can be performed on several types of platforms such as; Windows, Unix, OS/2, Windows CE and Symbian. In other words, it is cross-platform. In Db4object: Db4o is independent from the platform and because of supporting from Java and .NET, it can be performed on every platforms as it is performable via Java interface in platforms like Os, Tomcat, OSGi, J2EE, J2SE, CDC 8, Symbian, Palm and many others like this and via .NET interface in forum workers of version 1.0,2.0,3.0,3.5, Widows, Windows (XP, Vista), Mobile/Pocket PC. According to the support of many mobile devices from J2ME, CLDC 9, MIDP 10, it can be a good option for these uses. In H2: As this database is written by Java it can be applied on different platforms. The last version of that has been tested by Java 1.5, 1.6, but the special feature of Java 1.6 has not been used in its source. Currently, it is tested on operating systems of Windows XP, Mac OS X via JDK1.5, but it can be performed on other operating systems via JRE 11 [9]. 4.4 Full Unicode support In SQLite: Unfortunately, basic settings and SQLite presumption does not completely support Unicode. It means, SQLite only support case-sensitive ASCII as a presumption. The justification of the SQLite development system is the application of full Unicode needs tables and logics that increases the content of SQLite functions and decreases the strength of SQLite as a LWDB. For this purpose, SQLite uses external routines to compare and change the characters and supports this as a collation no case. In Db4object: It entirely supports Unicode and with applying a method (Unicode), it is possible to activate or deactivate this feature easily [11]. But, as the series occupy more content when they are saved in Unicode format and it is more time consuming to access to them, it is sug7 all languages that supports NET such as; C#, VB.NET, ASP .NET, Boo, etc 8 CDC stands for Connected Device Configuration. It is a framework for building Java ME applications on embedded devices ranging from pagers to set-top boxes. 9 J2ME Connected, Limited Device Configuration, is a Java Community Process effort that has standardized a portable, minimum-footprint JavaTM building block for small, resource-constrained devices[10]. 10 J2ME Mobile Information Device Profile, combined with the Connected Limited Device Configuration (CLDC), is the Java runtime environment for today's mobile information devices (MIDs) such as mobile phones and entry level PDAs[10]. 11 Java Runtime Environment

4.2 Interface In SQLite: SQLite support most standards of SQL92 for SQL, but has weaknesses in some features. For example, it supports some triggers, but triggers cannot be used in views. Also, although it supports complicated issues, but still has limits to cancel and change the columns by using Alter Table. However, as a LWDB it covers the needs of its users in an acceptable extent. An interface link with SQLite is possible in two methods in version 3 upward. One is using CLI 4 and the library functions is the second. There are more than 182 functions in the library of SQLite functions in form of C/C++ language [4]. Furthermore, SQLite is accessible with most programming languages such as; Basic, Lisp, Java, Perl, Php, etc. Moreover, it has COM (ActiveX) to connect to the Windows script languages like; Vbscript and Javascript [6]. In addition, SQLite has Tcl/Tk 5 interface that has 22 methods for the user. In Db4object: Dbo4 is accessible with two interfaces of Java 6 and NET 7. it also has API and Query Lang that uses
A link for accessing to the saved data in database Command Line Interface 5Tools command Language/Tool Kit- is a scripting language created by John Ousterhout. Tcl is used on embedded systems platforms, both in its full form and in several other small-footprinted versions[WIKIPEDIA]. It is pronounced like tickle 6 JDK1.1X-JDK6.0
3 4

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.ORG

150

gested to deactivate this feature until it needs to be used. In H2: H2 completely supports Unicode. In presumption of type of data, varchar can save Unicode data. This support derives from the substantial feature of Java.

4.5 Footprint In SQLite: SQLite has the minimum trace on the system. As it is described in introduction of SQLite, it requires the maximum content of 300 KB for installation (although, it does not need to be installed and it works just by copying on the system). This feature distinguishes SQLite from other LWDBs. In Db4object: Dbo4 needs the least source of system to operate, as it requires the minimum content of 600KB of the disk and less than 3MB (it depends to the control program) of the memory. In H2: H2 requires to the least content to operate on the system, as its Jar file needs content of about 1MB. Although, in a glance it might seems too much, but it should be considered that this file contains the data related to debug, while in similar databases such as hsqldb, that its files size is about 700KB, there is no data of Debug. Any way, this amount is not enough even for todays mobile systems and H2 is still considered as LWDBs. 4.6 Boundary Limitations In SQLite: Some of the discussed limits are because of the SQLite and some because of the operating system and the device. For instance, in Symbian OS, the limit of files size is 2GB and the maximum size of the buffer is 256MB [12]. Nevertheless, our discussion is the limits of the SQLite itself. The maximum number of records: 2 64 1 The maximum number of attachable database: 10 The maximum size of Page file: 32,768B, which is the default value, can be increased. The maximum number of Page file in a database: 1,073,741,823 The maximum number of wildcard that can be used in query: 999 In Db4object: The maximum content of the database file: As an assumption, the most databases content in this system is 2GB. However, with increasing the size of block it can be raised up to maximum of 254GB. There are no limits in terms of records number and objects, unless it results from the limitation of the databases maximum size. In H2: Content of the databases file: (except data of BLOB, CLOB) in general structure of storing, the maximum content of a databases file is 256GB and an index file is 256GB, too. If the feature of Page_store be used, in theory this amount can reach to 4TB. In version 1.1, this mechanism (file store) is inactive by assumption, so the general
12 Trace and the impact that the database have on the operating area. This impact is usually explained base on the required content of the memory for save and operation.

12

mechanism is used, but in version 1.2, it is active by presumption. The limitation of the system file of FAT and FAT32 should be considered that the maximum size of their file is 4GB. To solve this problem and apply the maximum size of the database file, a feature that is called split is used which is one of the H2 functions, to divide files to the less content one. The basic content of the divided files is 1GB. The maximum number of records in each table: 2,147,483,648 The maximum content of the main required memory in a general storing situation (file store), for every 12GB of databases content is a minimum of 240MB of main memory. By using the method of page_store this amount will be less. It means for every 8GB of the content of database there is need for 1MB of the main memory. There is a limitation in terms of the complication of the sql commands. For example, if in command of; select * from dual where x=1 or x=2 or x=2 or x=2 or x=2 or x=2 Repeating the second line for 500 times, the error of Stack overflow will be the result. Except the limits of the main and the secondary memory, there is no other limit. For example, in the maximum number of indexes, tables, triggers and so forth.

5 TEST AND BENCHMARK


In order to, comparing the operation of the three mentioned databases, the PolePosition 13 tool is used. This open source tool has five standard benchmarks to evaluate the operations efficiency (speed) of the databases. Each test has it owns proceeds. For example, in Bahrain test the experiment performs with writing of 30.000 simple objects or in Sepang test an object tree with dept of 14 is written in the database. Hardware: The hardwares feature of the tested system is as follow: Dell 1520 notebook, CPU:2.66 , 6MB cache, RAM: 4GB, HDD: 320GB, Graphic card: geforce 9300 Operating System: MS-Windows 7-32bit, enterprise edition The special considerations: There was no installed antiviruses program on the system during the tests operations. Thirteen various tests were done on the three mentioned databases that the results (as the time of their operation) are shown on Table. 1 and Fig. 1.

6 CONCLUSION
According to the described issues and the outcomes of the last session, the following results can be deduced:

13

www.polepos.org

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.ORG

151

In terms of average speed of the operation, H2 is faster than two other DBs. DBo4 is slower than H2 only in operation of the cdelete test and if this time be ignored, it will be the best in terms of operation speed. It should be mentioned, that this ignorance is not feasible because usually the installed databases softwares on the mobile systems are for searching and performing the data and normally the delete action occurs rarely. In terms of security, undoubtedly H2 is the best choice. Moreover, it has special feature to avoid SQL injection. In terms of supporter and software developer team the best choice is SQLite. By looking at the following statistics 14 (users of this database): Mozilla with more than 300 million users Skype with more than 450 million users 20 million websites that are designed by PHP and have used this DB Millions users of MCafee If you want to gain from the capability of a RDBMS, DBo4 is not a suitable choice as it is basically an object oriented database. Nowadays, almost all the mobile systems support Java, so applying H2 and Dbo4 can be an appropriate option as they are completely compatible with Java. However, if you need a high content of data (more than 256MB) there is just one option, which is H2.

THE RESULT OF TESTING THREE DATABASES WITH POLEPOSITION TOOLS

TABLE 1

REFERENCES
[1] J.-H. Wu and T.-L. Hisa, Analysis of e-commerce innovation and impact: a hypercube model, Electronic Commerce Research and Applications, vol. 3, no. 4, pp. 389 404, 2004. [2] A. Nori, Mobile and embedded databases, IEEE DataEng, Bull, vol. 30, no. 3, pp. 3 12, Sept. 2007. [3] K.-Y. Whang, I.-Y. Song, T.-Y. Kim, and K.-H. lee, The ubiquitous

dbms, SIGMOD Record, vol. 38, no. 4, pp. 14 22, 2009. [4] (2010) The sqlite website. [Online]. Available: http://www.sqlite.org/
[5]

(2010) The db4o website. [Online]. Available: http://www.db4o.com/ [6] V. Kumar, Mobile Database Systems, ser. Wiley Series on Parallel and Distributed Computing. Wiley-Interscience; first edition, 2006. [7] M. Blaze, J. Feigenbaum, and A. D. Keromytis, fundamentals of data-

Fig. 1. Comparison of the three databases. Farzad Tavakkoli is a Master of Science student at the Universityof Guilan in Iran. He received his B.Sc degree in Electronic engineer-

base systems. Addison Wesley, 2002, ch.19.3. [8] I. L. with Richard Maynard, Inside Symbian SQL, A Mobile Developers Guide to SQLite. John Wiley and Sons, Ltd., Publication, 2010, ch. 7.1. [9] (2010) The h2 website. [Online]. Available: http://www.h2database.com/ [10] (2011) The oracle official web site. [Online]. Available: http://www.sun.com/software/communitysource/j2me/ [11] J. Paterson, S. Edlich, H. Horning, and R. Horning, The definitive guid to db4o. Apress, 2006. [12] (2010) Symbian developer official web site. [Online]. Available: http://developer.symbian.org

His research interests are in the areas of Mobile Computing, Information Security, distant Learning, Computer Networks, and MCommerce.

ing from the University of Guilan, Iran, in May 1997. He will receive his Master of Science degree from the University of Guilan, Rasht, Iran, in June 2011. He is worked as technical director in Information technology(IT) depatement many years.

Azam Andalib is a M aster of Science student at the University of Guilan in Iran. She is received her B.Sc degree in Software engineering from the Islamic Azad University- Lahidjan Branch, Iran, in July 2009. she will receive her Master of Science degree from the University of Guilan, Rasht, Iran in June 2011. She is working at the Islamic azad University- Roudsar Branch now. Her research interests are in the areas of Web Services, E-Learning, Mobile Learning, Mobile Computing and P rogramming.

14

These statistics are for the end of 2006

JOURNAL OF COMPUTING, VOLUME 3, ISSUE 7, JULY 2011, ISSN 2151-9617 HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/ WWW.JOURNALOFCOMPUTING.ORG

152

Dr. Asadollah Shahbahrami received the BSc and MSc degrees in computer engineering (hardware and machine intelligence) from Iran University of Science and Technology and Shiraz University in 1993 and 1996, respectively. He was offered a faculty position in the Department of Electrical Engineering at University of Guilan. He has been working at University of Guilan since August 1996. In January 2004, he j oined the Faculty of Electrical Engineering, Mathematics, and Computer Science, Delft University of Technology, Delft, The Netherlands, as a full-time Ph.D. student under advisors Prof. Stamatis Vassiliadis and Dr. Ben Juurlink. He received his PhD degree in September 2008 f rom Delft University of Technology. He has an assistant professor position in Department of Computer Engineering at the Universitry of Guilan. His research interests include advanced computer architecture, image and video processing, multimedia instructions set design, reconfigurable computing, parallel processing, and SIMD programming. . Dr. Reza Ebrahimi Atani was born in 1980. He received the B.S. degree in electrical engineering from the University of Guilan in 2002 and the M.Sc and PhD degrees in electronics from Iran University of Science and Technology in 2004 and 2010 respectively. Since 2010, he is an assistant professor in Computer Engineering Department at the University of Guilan. His current research interests include stream cipher design and cryptanalysis, cryptographic hardware and embedded system (CHES), side channel attacks (Power and fault attacks), and des ign of VLSI circuits.

You might also like