Presentation is loading. Please wait.

Presentation is loading. Please wait.

IBM Pervasive Databases: DB2 Everyplace and Cloudscape

Similar presentations


Presentation on theme: "IBM Pervasive Databases: DB2 Everyplace and Cloudscape"— Presentation transcript:

1 IBM Pervasive Databases: DB2 Everyplace and Cloudscape
Platform: IBM Pervasive Databases: DB2 Everyplace and Cloudscape Frank Koconis Partner Enablement Consultant / IBM Information Management Session: M14 Thursday, May 26, 2005 12:30 PM - 1:40 PM

2 Contents The Problem: Data storage on mobile Devices DB2 Everyplace
Cloudscape Server Connectivity: DB2 Everyplace Sync Server The Ultimate Question Summary

3 The Problem: Data Storage on Mobile Devices
Mobile devices operate in an embedded (disconnected) or “occasionally-connected” environment Example: Asset-tracking system for a construction company PDA’s are used at job sites to check out tools to workers Workers check tools back in when they finish using them Tools and worker’s badges are bar-coded Once per day, each PDA “syncs” to central server to upload transactions and receive info on new tools and employees Very successful: Tools stopped “disappearing” For applications running on workstations connected to a corporate network or the internet, data is typically stored in a relational database system (an RDBMS). The database normally resides on a centrally-located server machine, and the applications typically access it using SQL statements, passed through an ODBC or JDBC connection. All permanent data storage is on the server, not on any client device. This works well in cases where some type of network connection is always present. However, because of the proliferation of hand-held devices (such as cell phones and PDA’s), more and more applications are being developed for occasionally-connected or “embedded” environments. An occasionally-connected application normally operates independent of any network, but the user will intermittently connect the device to a server (using a LAN, a modem or the internet), to “synchronize” the data with a centrally-managed master database. An “embedded” application operates entirely on its own; there is never any connection to a server.

4 The Problem (continued)
Mobile applications cannot use traditional RDBMS’s Developers often use “flat-file” storage on mobile devices, but this has problems Requires a lot of coding Error-prone No transaction processing, indexing, joins, etc. A better solution: use a small-footprint database engine, such as IBM’s DB2 Everyplace or Cloudscape Applications running on remote devices usually require permanent data storage, but are not able to use a traditional RDBMS. For these applications, developers sometimes resort to primitive “flat-file” storage on the device, but this requires a lot of coding and is error-prone. Developers using this approach must also live without many powerful features such as transaction processing, indexing, table joining, etc. A better data storage solution is to use a small-footprint database engine, running directly on the remote device. IBM provides two small-footprint database engines: DB2 Everyplace and Cloudscape.

5 DB2 Everyplace

6 What is DB2 Everyplace? The small-footprint relational
database for mobile computing

7 The DB2 Everyplace Architecture
Click to add text. First bullet point Times 25 point Text In bullet form Times 25 point Second level Times 21 point Third level Times 19 point

8 DB2 Everyplace- Key Features
Written in highly portable C Runs on most popular devices Palm OS, Windows CE/Pocket PC, Symbian, QNX Neutrino, Linux, and WinNT/2000/XP) Ideal for embedded & mobile applications Very small footprint (about 200K) Zero admin on client Supports PDA memory expansion cards, including Microdrive Support for over a dozen national languages Local data encryption DB2 Everyplace runs well on small, independent devices. Since memory is always scarce, its small footprint is an advantage; even many cell phones now have enough memory to run it. It is also completely “zero-admin”, meaning that the user never has to install it or maintain it. In most cases, the user will not even know that there is an RDBMS running on the device at all.

9 DB2 Everyplace- Rich Database Functionality
Wide range of data types including BLOB’s Advanced indexing Primary-key and check constraints Transaction support Identity (auto-increment) columns GROUP BY and ORDER BY Prepared statements What’s really amazing is that DB2 Everyplace can do all this within a very small amount of memory: only about 200K! (This can vary slightly, depending on the device.) Compared to competing database products, DB2 Everyplace provides an excellent combination of high functionality and very low memory requirements. In particular, it is remarkable to find support for features such as transaction processing, constraints and BLOB’s in such a small database engine.

10 DB2 Everyplace Functionality (continued)
Read-only media support on WinNT/2000/XP & Linux Remote stored procedure calls Scrollable cursors Supports standard programming interfaces DB2 CLI (subset of ODBC) JDBC (subset) .NET Develop using C/C++, Java, C#, Visual Basic or JSP’s Sample C programs are included for all supported platforms. Some of these show how DB2 Everyplace can be used for a stand-alone (embedded) database, and some show how to use it in an occasionally-connected environment, synchronizing to the DB2e Sync Server. A program which implements a simple SQL command-line interface is also included. It is simple but very useful for executing commands in a development environment (although end-users would probably never use it). For example, it is often convenient to use this interface execute DDL statements to create or drop tables and indexes, rather than having to write C code to do that.

11 DB2 Everyplace Components
Component Name Description DB2 Everyplace Database Database Engine High performance data store for managing and using data on mobile and embedded devices DB2 Everyplace Sync Server Synchronization Server Mobile user management and synchronization of enterprise data with mobile and embedded devices DB2 Everyplace Software Development Kit Application Development Tools RAD tools, development plug-ins, whitepapers and samples enabling developers to create DB2 Everyplace applications quickly

12 RAD Tools in the DB2 Everyplace SDK
Mobile Application Builder (MAB) AppForge plug-in WebSphere Studio Device Developer (WSDD) plug-in

13 Mobile Application Developer
Generates GNU-compatible C code for Palm OS Generates Java code for devices supporting the Sun PersonalJava API WinCE/PocketPC Symbian OS V6 & V7 Sharp Zaurus PalmOS 5 (StrongARM or XScale processor required) Rapid prototyping- generates apps without writing any code

14 MAB- Features Fully supports relational database operations
Database joins on a single form Automated BLOB data handling Databases on expansion cards (Microdrive, CF, SD Card, Memory stick) Supports automatic form creation directly from database table definitions Easy to use- visually create and edit forms by selecting controls from a palette Sync API support for generation of synchronization code The Mobile Application Builder tool runs on Windows NT/2000/XP. It has the typical look and feel of a GUI-based application development tool. The developer works within a window which is the same size and shape as the target device, building a data-entry form using various types of text fields and buttons. Many different fonts and colors are supported, depending on the target device. BLOB image display is also supported.

15 Mobile Application Builder

16 Other RAD tools in the DB2 Everyplace SDK
AppForge AppForge MobileVB is an add-in for Microsoft Visual Basic Provides development environment for Palm, Pocket PC & Symbian Develop once, deploy anywhere! (platform independence) IBM provides plug-in for AppForge MobileVB to enable DB2 Everyplace application development Websphere Studio Device Developer (WSDD) Enables developers to extend e-business applications to mobile devices such as cellular telephones and PDA’s Extends the WebSphere family to build applications based that support J2ME™ as well as non- J2ME™ configurations Lets developers create Java based DB2 Everyplace applications Supports both relational database and synchronization features

17 Cloudscape

18 What is Cloudscape? An embeddable, lightweight, relational SQL database engine for Java. IBM Cloudscape is a small-footprint relational database system written entirely in Java. Although it is small, it provides full relational database functionality and can even support multi-user concurrent access. It is designed to be tightly embedded with a Java application, invisible to the end user. It can also be used as an inexpensive test database in a development environment, for applications which are later deployed with larger database systems.

19 Cloudscape History Cloudscape, Inc. founded in 1996 by a team of experts from Informix, Illustra, Oracle and Sybase Purchased in September of 1999 by Informix Corporation Acquired by IBM with Informix purchase in July of 2001 Released by IBM as open source (“Derby”) in September of 2004 Cloudscape, Incorporated was originally founded in 1996 by a team of experts from Informix, Illustra, Oracle and Sybase. Since the beginning, the company’s primary product was the Cloudscape relational database system, written in Java. The company was purchased in September of 1999 by Informix Corporation, and Informix continued to actively enhance, market and sell it. In July of 2001, IBM purchased all of the database-related assets of Informix, in what was IBM’s second-largest acquisition ever (the largest was its purchase of Lotus). This purchase included many software products, including Informix’s main-line relational database system, IDS (Informix Dynamic Server), the data warehousing engine Red Brick (which Informix had acquired in 1998) and Cloudscape. In the four years since then, IBM has continued to enhance and strongly support all of these products, and feedback from users has been very positive. Since the Informix purchase by IBM, Cloudscape support and development has continued, and several new versions have been released. Many IBM partners are embedding Cloudscape in their software products (although this is usually not obvious to end users). In addition, IBM uses Cloudscape within several of its own software products, including Lotus LearningSpace, Tivoli Storage Area Network Manager, Tivoli Monitor and WebSphere Application Server. IBM’s latest product containing Cloudscape is its recently-announced Workplace Client. This software package, which allows customers to centrally manage and deploy key business applications and data to a large number of client devices, uses Cloudscape as its internal data store. Cloudscape was released by IBM as open-source with the code name “Derby” in September of IBM still provides technical support services for Cloudscape customers, and recently released the new Cloudscape Network Server product (described later in this presentation).

20 Cloudscape- Key Features
Pure Java (runs on any machine with a JVM!) Embeddable Can be installed as a JAR file (as part of a Java application) Can be started within an application Installation, startup and shutdown are invisible to user Fully-functional RDBMS Adheres to standards JDBC SQLJ ANSI SQL-92 Although Cloudscape is small, it is powerful. It provides full RDBMS functionality, including complete support of the SQL-92E, JDBC 3.0 and JDBC 2.0 standards, and partial support of SQL-99.

21 Cloudscape- Key Features (continued)
"Zero" Administration No need for DBA at customer site Users may even be unaware that a database engine is present Lightweight Can run in as little as 8MB Scales to Moderate Size No defined limits on table or row sizes Table size limit of 2GB in some environments (OS limit) Existing customer databases of about 10 GB working well Cloudscape is ideally suited for applications which require local data storage, in an isolated or occasionally-connected environment. Cloudscape can be easily embedded with a Java application, since it is implemented as a Java class library. Java applications are normally delivered as “JAR” files, so the developer can simply add the Cloudscape JAR files into his/her JAR file. Cloudscape is lightweight. Its class library is only about 2MB, and it can run in as little as 16MB of RAM. (This varies somewhat, depending on the OS and Java Virtual Machine being used.) Although it is small, it can manage a lot of data. Cloudscape does not have any limit on the number of databases, the number of tables per database or the number of data rows in a table. (However, some OS’s have a 2GB limit on the size of a single file, so this effectively becomes the limit on the size of a single table, since Cloudscape implements each table as a separate file.) There are customers who have databases holding tens of gigabytes of data, working very well.

22 Cloudscape- Key Features (continued)
Supports Disk Encryption Tested with IBM JCE Easy for Application Developers to Use To set up, just copy Cloudscape JAR files and set Java CLASSPATH Database engine starts automatically when application attempts to connect to it Cloudscape databases are completely portable To move a Cloudscape database to another machine, just copy it! (This works even if the machines have different OS or hardware!) Cloudscape is written entirely in Java, which means that it runs on any machine that has a JVM (Java Virtual Machine). This includes all popular laptop and desktop machines, and most minicomputers and mainframe systems. Technically speaking, Cloudscape requires J2SE V1.3 or later (Java experts will note that this is J2SE, not J2ME, which means that Cloudscape will not run on very small devices such as PDA’s and cell phones). Even the data it stores is portable. Cloudscape databases can be copied from machine to machine (possibly with different hardware and/or OS), with no conversion or “export/import” needed; very few database systems allow this. It is possible to create a Cloudscape database on a Windows XP laptop machine with one Java program, then copy it to an IBM mainframe and open it with another one. This portability means flexibility for application developers. They do not have to make an iron-clad commitment to a particular machine or OS. If they decide to change, there is little impact. They also do not limit their potential market; they can sell to customers who use other platforms.

23 Cloudscape is a Fully-Functional RDBMS
Indexes Views Triggers and Stored Procedures Constraints (primary-key, foreign-key, unique, check) Concurrency Support Transactions (with crash recovery) Savepoints Row-level locking, with escalation JDBC isolation levels (including dirty-read) Cloudscape gives developers almost all of the functionality of a high-end RDBMS. In particular, it is unusually to find support for such features as foreign key constraints, transaction processing and multi-user concurrent access in a “small” database engine.

24 Cloudscape Database Functionality (continued)
Scrollable Cursors (result sets) Cascading Delete Internationalization/Localization Support Supports multi-user access (using Network Server) SQL syntax is very similar to DB2 UDB “Develop on Cloudscape; deploy on DB2”

25 The Cloudscape Network Server
Allows multiple local and/or remote clients to concurrently access the same Cloudscape databases Clients may be JDBC, ODBC or .Net* 100% Java JDBC Client JDBC-DRDA Driver JVM JDBC Client JDBC-DRDA Driver Cloudscape DB DRDA Application Server ODBC Client ODBC-DRDA Driver Cloudscape has always been intended as a database for Java. However, customers sometimes need to access their Cloudscape databases using non-Java applications. For example, someone may want to analyze their data using Microsoft Excel, but since Excel expects to connect to a database using ODBC, not JDBC, there was no easy way to do this. (The only option was cumbersome: export the data to a text file, then import it into Excel.) However, in the latest version of Cloudscape, this problem has been solved. ODBC (and soon, .Net) connections are provided by the new Cloudscape Network Server. This is actually the secondary purpose of the Network Server; its main function is to support multi-user access, as explained below: CONCURRENT ACCESS TO CLOUDSCAPE DATABASES Some developers may be surprised to know that Cloudscape DOES support concurrent database access. They key limitation to remember is that all concurrent access to a single Cloudscape database must occur WITHIN A SINGLE JVM. This means that a Java program can have any number of concurrent threads running, and all of these can concurrently access the same Cloudscape database, if desired. What is NOT permitted is for a program running in ANOTHER JVM to access this same database. It is quite possible to have several JVM’s running on a workstation, at the same time. This can happen without the user even realizing it. For example, the user may start a Java application from the OS command prompt, then open a web browser which uses a (second) JVM to run an applet, while the first application is still running. Two or more Java programs running concurrently in different JVM’s, as in that example, cannot access the same Cloudscape database concurrently. Because this would cause unrecoverable database corruption, Cloudscape implements a locking mechanism to prevent it (the first access succeeds, but the second fails). Note that it is perfectly acceptable for programs running in different JVM’s to concurrently access DIFFERENT Cloudscape databases, but never the same database. CONCURRENT DATABASE ACCESS FROM MULTIPLE JVM’S To address the need for concurrent access to Cloudscape databases by multiple JVM’s, IBM recently developed the Cloudscape Network Server. It provides multi-thread and multi-user connectivity to Cloudscape databases within a single system or over a network. Using the Network Server, any number of Java programs running in any number of JVM’s can concurrently connect to any number of Cloudscape databases (or the same database). These programs may be running on the same machine as the Network Server, or may connect to it across a LAN or WAN (such as the internet). Client programs communicate with the Network Server using IBM’s standard Distributed Database Architecture (DRDA) protocol. Databases are accessed through the Cloudscape Network Server using IBM's JDBC driver, the DB2 JDBC Universal Driver. The Cloudscape Network Server is robust. It can handle hundreds of concurrent connections. It also provides an additional feature: access to Cloudscape databases for non-Java applications. The Network Server currently supports ODBC as well as JDBC clients, and will soon support .NET clients. This means that reporting and analysis tools which do not support JDBC (such as Microsoft Excel) can now be used with Cloudscape databases. Cloudscape DB ODBC Client ODBC-DRDA Driver Cloudscape DB .Net Client .Net-DRDA Driver *- Currently Under Development

26 Cloudscape as a Development Database
The problem Developers need a database for unit testing of their code Usual practice: a development database (DB2 UDB) on a server However, this has many disadvantages Must pay for DB2 UDB license on the server Requires a DBA to set up and administer the development database BIGGEST PROBLEM: Whenever one developer “trashes” the database, work stops for everyone, and the DBA must rush to fix it! Cloudscape can also be used to fulfill a common need in a development shop: how to provide all application programmers with a database for code development and unit testing. The traditional solution is to create a database on a server somewhere and let all of the developers connect to it. This requires that a DBA be assigned to the project to set up the database and populate it with test data (since the server will be running a high-end database system such as DB2 UDB or Oracle). The DBA must also remain “on-call” for the duration of the project, because every so often, one of the developers will accidentally “trash” the database. For example, if someone’s code submits an SQL “DELETE” statement, but omits the “WHERE” clause, then every row in a table goes away, instead of just the desired one. When something like this happens, development work is halted for the entire team, and the DBA must rush to restore the test data so everyone can get back to work. The logical way to minimize the impact of this kind of coding error is to give each developer his/her own copy of the test data, using a smaller database engine running on the developer’s workstation. All of the major database vendors offer “lite” versions of their products which can be used for this purpose (for example, there is IBM DB2 Express and Oracle Database Lite). However, these still often require a DBA to properly install, set up and administer. Although there may be less administration work for these “lite” database engines, the DBA must do it on every developer’s workstation (and run around fixing them, when the developers “trash” them!).

27 Cloudscape as a Development Database (cont.)
A better solution: A Cloudscape database for each developer Create a “master” database, then copy it onto developer workstations If any developer “trashes” it, he/she just re-copies from the master! No DBA required, and other developers are not affected! Later, when modules are integrated, switch to DB2 UDB A better solution is a zero-administration database, such as Cloudscape. No DBA is required to install or set up Cloudscape: the developers simply copy the Cloudscape JAR files onto their workstations, then edit their Java CLASSPATH’s to point to them. Also, since Cloudscape’s data is completely portable, the test data can be loaded once into a “master” database (which is then write-protected), and the developers can copy this onto their workstations. Whenever developers accidentally damage their copies of the test data, they just copy from the master database again. No DBA is involved, and database damage caused by one developer never causes a delay for anyone else. Cloudscape would be used for application coding and unit testing, and in later phases of a large project (integration, performance testing and deployment), a high-end database system would be used. This is why IBM has coined the phrase “Build on Cloudscape, Deploy on DB2”, and IBM has taken steps to make Cloudscape compatible with DB2 UDB. For example, minor data-type and SQL syntax differences have been removed, and certain DB2 features have been added to Cloudscape, such as cascading DELETE. “Develop on Cloudscape; deploy on DB2”

28 IBM Products which use Cloudscape
WebSphere (WSAD and WAS) Cloudscape used for sample applications Can handle pooling of Cloudscape connections Integration plug-in allows easy development in Eclipse environment Tivoli Monitor and Tivoli Storage Area Network Manager Both use embedded Cloudscape Lotus LearningSpace Uses embedded Cloudscape IBM Workplace Client Many others deployed and under development

29 Server Connectivity: The DB2 Everyplace Sync Server
For DB2 Everyplace and Cloudscape What if you need to occasionally transfer data to or from a server? Data collected by remote devices in the field must be periodically “uploaded” to a server, for permanent, long-term storage. The transactions performed by a given field device must be made available all other field devices. Also, it is often necessary to download new data into field devices, such as updated lookup tables (customer or product lists, for example). DB2 Everyplace Sync Server performs this function. It provides efficient two-way data synchronization between client devices and enterprise data sources, with a mechanism provided for conflict resolution. Also, updated application code and set-up files can also be automatically sent to the client devices, when necessary.

30 DB2 Everyplace Sync Server Architecture

31 DB2 Everyplace Sync Server- Key Features
Efficient 2-way synchronization Supports most server databases (DB2 UDB, IDS, Lotus Domino, Oracle, SQL Server, Sybase and Cloudscape) on many platforms Optimized, secure transmission (56-bit or 128-bit encryption) Centralized administration User and group administration Data subscription by user or group, with horizontal and/or vertical data filtering Customizable conflict resolution (using “user exits”) Automatic distribution of data, files and applications Monitor synchronization progress in real-time Zero administration on mobile device All administrative tasks are handled on the server side. This includes data source definition, data subscription setup, user/group management, access control and synchronization monitoring. The administrator uses the DB2 Everyplace Mobile Device Administration Center (described in the next section) to perform these tasks. The synchronization client devices are completely zero-admin.

32 DB2 Everyplace Sync Server Features (cont.)
Scalable Supports WAS Server Groups for High Availability and Scalable configurations Automatic upgrades of sync client and DB2 Everyplace or Cloudscape database software without user interventions Remote Stored Procedure support Allows mobile applications to access server data sources in real time Now works with Cloudscape Cloudscape supported as a mobile client and as a server data source DB2 Everyplace Sync Server is highly scalable and secure. A single server can handle a large number of concurrent synchronization clients. For very large loads, the Sync Server can run on a WebSphere Application Server group (cluster of servers), with automatic load balancing. To insure data security, the communications flowing to and from the client devices can be encrypted. Another really neat feature of the DB2 Everyplace Sync Server is Remote Stored Procedure support. This allows an application running on a remote device to directly interact with an enterprise data source, in real time. The application issues a call, through the sync server, to procedure which runs within the enterprise database engine. Any results are passed back through the sync server to the client. For example of how a Remote Stored Procedure could be used, consider a hand-held order entry device for a large product warehouse. The user would select the desired product from a list which is stored in a DB2 Everyplace database on the device. After the selection was made, the application would call a remote procedure, running in the warehouse’s server database, which checks the stock of the desired item. Note that data moving between the client and server in this case is very small: just the ID of the product to check going “up” to the server, and the quantity-on-hand coming back “down”. For application developers who want control of synchronization, an API is provided. The API can be used to allow the client application to monitor the state of the synchronization process, and optionally take alternative actions when certain events occur. For example, it is possible use the API to write a custom handler for data-conflict resolution. (A conflict occurs when the server cannot accept an uploaded data row for some reason, such as the violation of a server-side constraint.) DB2 Everyplace Sync Server can run on Windows NT/2000, AIX, Solaris or Linux. Note that this does not limit the permissible platforms for the enterprise database (the sync data source). This database can be located anywhere, so long as the Sync Server can obtain a connection to it.

33 Sync Server Administration: Mobile Device Administration Center
After a DB2 Everyplace application has been developed and deployed to the remote devices in the field, it is necessary to set up and manage access to the enterprise data source(s). We have to properly set things up so that users will be able to “synchronize” (send and/or receive new data) whenever they need to. The DB2 Everyplace Mobile Device Administration Center (MDAC) is used to perform this task. MDAC is a GUI-based tool for centrally managing all mobile devices. It provides the ability to define the information a given group of users may access, and the way that information is replicated on each user's mobile device. Note that since MDAC is written in Java, it runs on any hardware platform. This means that it can be used on all platforms where the DB2 Everyplace Sync Server can run (Windows NT/2000, AIX, Solaris or Linux).

34 Cloudscape Synchronization
New sync client for Cloudscape Works with DB2Everyplace Sync Server 100% Java Synchronize Cloudscape clients to any database supported by DB2 Everyplace Sync Server, including Cloudscape DB2 UDB on all platforms; also DB2 on zSeries and iSeries IBM Informix (IDS) Oracle MS SQL Server Sybase Cloudscape Recently, IBM completed modifications to the DB2 Everyplace Sync Server to support Cloudscape. Support for IBM Cloudscape data sources is implemented with a pure Java synchronization client. This enables the Cloudscape database to act as a client for the DB2 Everyplace Synchronization Server with full synchronization with any supported data source of the DB2 Everyplace Sync Server (DB2 UDB, Oracle, Sybase, Microsoft SQL Server, etc.). It is interesting to note that IBM Cloudscape is also supported as a data source, enabling DB2 Everyplace database or Cloudscape database clients to synchronize data with a Cloudscape server. This means that Cloudscape can be used as the client-side database, the server-side (“master”) database, or both.

35 And Now- The Ultimate Question
(to which the answer is not 42)

36 DB2 Everyplace or Cloudscape?
Footprint ~200K 8MB+ Database size Small Small-to-medium Language C Java Platform support Many Any (except PDA’s) DB Access Methods ODBC,OLE, .Net, JDBC JDBC, ODBC, .Net (future) Concurrent Users One Small group (using the Cloudscape Network Server) Synchronization DB2 Everyplace Sync Server So, which small-footprint database is best for YOUR application, DB2 Everyplace or Cloudscape? This table compares them, side-by-side, to help you make this decision.

37 For More Information DB2 Everyplace
Cloudscape (and the Cloudscape Network Server) DB2 Everyplace Sync Server Developers can obtain a free evaluation copy of DB2 Everyplace from IBM using the URL shown above. Cloudscape is open-source, so anyone can download it free (of course). The Cloudscape Network Server is an IBM product; for more information, go to

38 Questions?

39 IBM Pervasive Databases: DB2 Everyplace and Cloudscape Session: M14
Frank Koconis Partner Enablement Consultant / IBM Information Management


Download ppt "IBM Pervasive Databases: DB2 Everyplace and Cloudscape"

Similar presentations


Ads by Google