Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.
Frequently Asked Questions (FAQ)
ObjectDB is an Object Oriented Database Management System (ODBMS). It provides all the standard database management services (storage and retrieval, transactions, lock management, query processing, etc.), but it uses an object oriented model to store and manage data. You can easily store ordinary objects (and graphs of objects) in an ObjectDB database directly.
There's no need to define tables or convert objects to records/records to objects using SQL or ORM, as opposed to when using relational database systems (RDBMS), such as Oracle, DB2, SQL Server or MySQL.
ObjectDB is a unique NoSQL database. It doesn't have the known disadvantages and limitations of NoSQL technology, which are weak query capabilities and lack of ACID (atomicity, consistency, isolation, durability).
Unlike other NoSQL solutions, ObjectDB provides full support of rich complex queries, using two standard Java query languages: JPQL (Java Persistence Query Language) and JDOQL (JDO Query Language). The power of these query languages is equivalent to the power of SQL, but they are easier to use in object oriented languages such as Java.
In addition, unlike most other NoSQL databases, ObjectDB supports full ACID (atomicity, consistency, isolation, durability). Therefore, ObjectDB can be used in applications that cannot use conventional non ACID NoSQL databases because of a requirement for a very high level of consistency.
The Java Persistence API (JPA) is a standard API for accessing databases from within Java applications. The main advantage of JPA over JDBC (the older Java API for interacting with databases) is that in JPA data is represented by classes and objects rather than by tables and records as in JDBC. Using plain old Java objects (POJO) to represent persistent data can significantly simplify database programming.
A JPA implementation (sometimes referred to as a JPA provider) is needed in order to interact with a relational database such as Oracle, DB2, SQL Server or MySQL. The popular JPA implementations are Hibernate, TopLink, EclipseLink, Open JPA and DataNucleus. These implementations are Object Relational Mapping (ORM) tools. The mapping bridges between the data representation in the relational database (as tables and records) and the representation in the Java application (as classes and objects).
ObjectDB is the only database management system with built in support of the Java Persistence API (JPA). By interacting with ObjectDB using standard JPA you can keep your application portable. The unique benefit of using ObjectDB is that the overhead of an intermediate ORM layer is eliminated. That simplifies and accelerates the development process and makes your application run much faster.
The Java Data Objects (JDO) is another standard for accessing persistent data in databases, using plain old Java objects (POJO) to represent the object model. Unlike Java Persistence API (JPA), which is designated to be used with relational databases, JDO is designated to be used with both relational and object databases. JDO is supported by many object databases, including ObjectDB, and it is probably the most popular Java API for object databases today.
You can use ObjectDB with either the Java Persistence API (JPA) or the Java Data Objects (JDO) API. Both share similar architecture, design and abilities.
When to prefer JPA
JPA is more commonly used. Therefore, it might be the first choice for most new applications. You can use JPA as the primary API, and if necessary, switch to JDO as a secondary API for special additional features that are supported only by JDO. Selecting the more popular API leads to more portable application and extends the availability of experienced developers, forums, IDEs support, tools, books, tutorials and sample code.
When to prefer JDO
JDO might be preferred when portability to other object databases is more important than general portability to both object and relational databases. JPA is designated to be used mainly with relational databases. ObjectDB is the only object database that supports JPA. On the other hand, JDO is designated to be used with both relational and object databases and it is probably the most popular Java API for object databases today.
- Database file size up to 128 TB (= 131,072 GB = 134,217,728 MB).
- Up to 2,147,483,648 entity classes per database file.
- Up to 2,147,483,648 indexes per database file.
- Up to 9,223,372,036,854,775,808 entity objects per database file.
- Unlimited database connections (limited by operating system resources).
ObjectDB requires Java 5 or later (Java 6 is preferred). As a pure Java application, ObjectDB should be able to run on any platform that supports the Java Standard Edition. Either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) can be used. A version of ObjectDB for .NET is currently under development.
ObjectDB can be used by Java Virtual Machine (JVM) languages, such as Java, Groovy and Scala. It can also be used with other languages, such as Phyton, Ruby and PHP, but currently only with their JVM implementations (e.g. Jython for Phyton, JRuby for Ruby and Quercus for PHP). A version of ObjectDB for .NET is currently under development and future support for other languages (including full Phyton, PHP and Ruby support) is planned.
To access relational databases using the Java Persistence API (JPA) you will need an Object Relational Mapping (ORM) tool, such as Hibernate, TopLink, EclipseLink, Open JPA or DataNucleus. The DataNucleus ORM implementation supports also the Java Data Objects (JDO) API. ObjectDB is a full featured standalone Object Database Management System (ODBMS) and not an ORM tool, so it is not intended and cannot be used to access other database management systems.
ObjectDB is highly scalable and can manage efficiently databases in a wide range of sizes, from a few Kilobytes to hundreds of Gigabytes and even Terabytes. ObjectDB can be used in small embedded single user applications as well as in heavy loaded multi threaded multi user applications.
- ObjectDB is unique in supporting the standard APIs. It is the only object database with built in support for the Java Persistence API (JPA). It also supports a more recent and advanced version of the Java Data Objects (JDO) API than competing object databases.
- By using a standard API such as JPA you can keep your application portable. If necessary, you will always be able to switch to any relational database by using an ORM JPA provider such as Hibernate, EclipseLink or Open JPA.
- Another advantage of using a popular API such as JPA is the availability of experienced developers, supporting community, forums, IDEs support, tools, books, tutorials and sample code.
- ObjectDB is also unique in supporting features that are usually available only in relational databases. For example, most object databases do not support user defined primary keys, even though this is very useful in almost every application. ObjectDB supports user defined primary keys including composite primary keys.
- The support of two standard APIs (JPA and JDO) by ObjectDB minimizes the risk that during development you may find that an essential feature is missing. For example, some competing products do not support aggregate queries (max, min, count, sum and avg). ObjectDB supports rich queries, including aggregate queries, as part of its support of JPQL (JPA Query Language) and JDOQL (JDO Query Language).
- ObjectDB is faster than other products.
By using ObjectDB you can reduce development time and costs and improve your application performance.
Reducing Development Time and Costs
ObjectDB makes database programming easier and faster. The ability to store ordinary objects in the database directly can simplify the code significantly. Less (and more simple) code to write, debug and test, as well as a much easier learning curve leads to shorter time to market and saving in the total development time and costs.
ObjectDB is especially designed to store and manage graphs of objects efficiently. That can accelerate the execution time of object oriented applications significantly. For instance, collection and map fields can be stored by ObjectDB simply as part of the containing object. Relational databases lack that ability and require multiple tables, multiple records and join operations in order to support multiple values (even for a simple data structure such as a collection of strings).
In addition, eliminating the intermediate ORM layer further accelerates applications. For instance, ObjectDB processes JPQL (JPA Query Language) and JDOQL (JDO Query Language) queries directly, where ORM tools first convert these queries to SQL and then transition the SQL to the DBMS for execution through a JDBC driver. Obviously, elimination of conversions, translations and other intermediate operations leads to better performance.
As noted above, using ObjectDB instead of a relational database and ORM combination is easier and leads to better performance. ORM tools, however, are very useful where the use of a relational database is mandatory (e.g. as a result of a customer request or when a new application is developed for an existing old relational database).
By using the Java Persistence API (JPA), you can develop portable applications that can use both ObjectDB and relational databases. This way you have the best of both worlds - use ObjectDB when applicable for faster development and better performance and use a JPA ORM provider (Hibernate, TopLink, EclipseLink or DataNucleus) to access relational databases when necessary - with exactly the same code.
Naturally, this is not the place to look for an unbiased answer for this question. However, you should consider the following points when doing your own objective comparison of object databases:
ObjectDB is distributed as a zip file. Just download and extract the ObjectDB distribution zip file. No need to run any install or setup program. You can uninstall ObjectDB by deleting the ObjectDB directory. ObjectDB does not modify the registry or any other system file.
The best source for learning ObjectDB is the ObjectDB Manual, which contains all the necessary information for using ObjectDB. The only required background is a good understanding of the Java language. Reading the manual and getting started with ObjectDB could be easier for developers with prior experience in database development, SQL or JPA, but such experience is definitely not a prerequisite.