[ODB1] Chapter 1 - About ObjectDB
ObjectDB for Java/JDO is a powerful Object Database Management System (ODBMS) written entirely in Java. It can efficiently handle a wide range of database sizes, from a few KBs to hundreds of GBs. It has a small footprint, high performance, and a flexible architecture (1-Tier, 2-Tier or N-Tier).
This introductory chapter contains the following sections:
1.1 Why ObjectDB?
There are many benefits to using ObjectDB. This section describes some of them.
ObjectDB is an Object Database
Developing object oriented applications with ObjectDB is easier and much more effective because the content of the database is application objects. Whereas, working with a Relational Database Management Systems (RDBMS) is difficult because developers must deal with tables, records and SQL in addition to the application's classes and objects.
ObjectDB is JDO Compliant
ObjectDB is compliant with the JDO (Java Data Objects) standard, developed by Sun. Therefore, applications that use ObjectDB are not tied to ObjectDB. Switching to another JDO compliant database (for example, as a result of special customer needs or requests) can be done without modifying code. The JDO API is available today for most relational database systems (RDBMS), e.g. Oracle, IBM DB2 and Microsoft SQL Server. In addition, by using JDO you are backed up by a large community that's expanding every day. JDO already has websites, a forum, a mailing list, consulting and training companies, and many books dedicated to it.
ObjectDB is Easy to Use
You can be productive with ObjectDB in a very short time, because it is very easy to use. In fact, it is the easiest JDO implementation. Most other JDO implementations map classes and objects to tables and records in an RDBMS. Using such mapping makes it possible to write clean Java code, but still requires some familiarity with relational database concepts and the tables and columns defined for an application in order to perform the necessary mappings and maintain them throughout the life of a system. With ObjectDB, you can forget relational databases, tables, records, fields, SQL, JDBC and drivers, and focus your attention on the application's Java classes exclusively.
ObjectDB is Very Portable
ObjectDB is written entirely in Java. Therefore, it can run on any environment that supports Java. You can easily move your application to other platforms (Windows, Unix, Macintosh and almost any other platform), simply by taking the ObjectDB and JDO jar files with you. You can even run your application on small devices like PocketPC (if Java is installed), because ObjectDB has a very small footprint (about 300KB at runtime).
ObjectDB is Very Fast
ObjectDB has very good performance. It can store and retrieve thousands of objects per second. Even queries on millions of objects are very fast, when proper indexes are defined.
ObjectDB has a Database Explorer
The ObjectDB database explorer, which is provided with every ObjectDB product, is a sophisticated tool that enables browsing, querying, editing and the construction of Java objects in a database, visually, without writing a single line of code. Many object databases do not have a visual browsing tool at all, or have a very limited one. Keep in mind that database programming without the ability to explore, query and edit the database content visually, is like developing software without a debugger.
1.2 ObjectDB Operating Modes
ObjectDB for Java/JDO can operate in one of two modes: embedded mode or client server mode.
In client-server mode, an ObjectDB server is running on a separate JVM (in a separate process). Applications running on different JVM's communicate with the database server using TCP/IP. Many client processes (running on the same machine or on different machines) can safely access the database simultaneously, because the database server manages an automatic lock mechanism.
In embedded mode, the application uses ObjectDB as a class library, so no server process is needed in another JVM. The database file is accessed directly by the application's process, using JDO and ObjectDB jar files that are added to the application's classpath. In this mode, the database file is locked for a single process, and multi user support may be achieved only by multithreading (several threads) in a single process.
Client-Server Mode vs. Embedded Database Mode
The embedded database mode is easier to use and faster because no server has to run in the background and no TCP/IP communication is needed. Adding JDO and ObjectDB jar files to the classpath is the only requirement. Client-Server mode, however, is useful for accessing remote databases and for database access of several processes simultaneously. Moving from one mode to the other can be done simply by changing a single string (the connection URL), because the JDO API is the same for both modes.
1.3 ObjectDB Editions
ObjectDB for Java/JDO is available in three editions: Free, Embedded and Server.
Server Database Edition
This is the most advanced edition. It supports all ObjectDB features and both the embedded database operating mode as well as the client-server operating mode.
Embedded Database Edition
This edition is limited to the embedded database operating mode. Otherwise, it is very similar to the server database edition.
Free Database Edition
This is a special edition for personal non-commercial use. It is based on the embedded database edition, but has some additional restrictions and limitations.
This developer's guide is for all ObjectDB editions. Therefore, you can assume that every feature described in this guide is supported by all the editions, unless explicitly specified otherwise.
1.4 ObjectDB in Web Applications
ObjectDB for Java/JDO is specially designed for Java web applications. Each one of the ObjectDB editions can be easily integrated into any JSP/servlet web application. The JDO Guest Book sample provided with ObjectDB demonstrates a simple web application that uses ObjectDB and JDO.
Naturally, the server database edition, supporting client-server mode, provides the highest flexibility for web applications and advanced features, like remote database administration and manipulation. However, web applications may also use the ObjectDB embedded database edition and the free database edition in embedded mode as long as the database and the web server are on the same machine. Because embedded database mode supports multithreading, and the web server handles simultaneous requests using threads, even in embedded database mode, multi user access to a database is supported.
JDO Web Hosting
The embedded database mode is especially important if you are considering deploying a Java web application on a virtual web hosting server rather than on a dedicated server. Using embedded mode, it is easy to deploy a web application with ObjectDB on any web hosting system that supports servlets/JSP. Just drop the JDO and ObjectDB jar files into the WEB-INF/lib directory of the web application, and database support (in embedded mode) is made available.