5. Object Oriented Databases
5. Object Oriented Databases
Introduction
Object-oriented databases are a type of database management system. Different database
management systems provide additional functionalities. Object-oriented databases add
the database functionality to object programming languages, creating more manageable code
bases.
• Objects are the basic building block and an instance of a class, where the type is either
built-in or user-defined.
• Classes provide a schema or blueprint for objects, defining the behavior.
• Methods determine the behavior of a class.
• Pointers help access elements of an object database and establish relations between
objects.
In contrast, the basic building blocks of relational databases, such as PostgreSQL or MySQL, are
tables with actions based on logical connections between the table data.
These characteristics make object databases suitable for projects with complex data which
require an object-oriented approach to programming. An object-oriented management system
provides supported functionality catered to object-oriented programming where complex objects
are central. This approach unifies attributes and behaviors of data into one entity.
• Polymorphism
• Inheritance
• Encapsulation
• Abstraction
These four attributes describe the critical characteristics of object-oriented management systems.
Polymorphism
Polymorphism is the capability of an object to take multiple forms. This ability allows the same
program code to work with different data types. Both a car and a bike are able to break, but the
mechanism is different. In this example, the action break is a polymorphism. The defined action
is polymorphic — the result changes depending on which vehicle performs.
Inheritance
Inheritance creates a hierarchical
rarchical relationship between related classes while making parts of
code reusable. Defining new types inherits all the existing class fields and methods plus further
extends them. The existing class is the parent class, while the child class extends the parent.
p
For example, a parent class called Vehicle will have child classes Car and Bike.
Bike Both child
classes inherit information from the parent class and extend the parent class with new
information depending on the vehicle type.
Encapsulation
Encapsulation is the ability to group data and mechanisms into a single object to provide access
protection. Through this process, pieces of information and details of how an object works
are hidden,, resulting in data and function security. Classes interact with each other
o through
methods without the need to know how particular methods work.
As an example,
e, a car has descriptive characteristics and actions. You can change the color of a
car, yet the model or make are examples of properties that cannot change. A
class encapsulates all the car information into one entity, where some elements are modifiable
while some are not.
Abstraction
Abstraction is the procedure of representing only the essential data features for the
needed functionality.. The process selects vital information while unnecessary information stays
hidden. Abstraction helps reduce the comple
complexity
xity of modeled data and allows reusability.
For example, there are different ways for a computer to connect to the network. A web browser
needs an internet connection. However, the connection type is irrelevant. An established
connection to the internet represents an abstraction, whereas the various types of connections
represent different implementations of the abstraction.
Feature Description
Query Language Language to find objects and retrieve data from the database.
GemStone/S
GemStone/S is an object database system based on Smalltalk – an object-oriented programming
language influenced by Java. Developers who write applications in Smalltalk adapt easily to this
database. GemStone/S integrates seamlessly with existing Smalltalk applications, improving
speed and productivity.
Gemstone/S is best for high-availability projects. There are multiple options for licensing
depending on the project size. The database server is available for various platforms, including
Linux, Windows, macOS, Solaris, AIX, as well as Raspberry Pi.
Note: Learn all about how database servers work to find out how they can be an asset to you.
ObjectDB
ObjectDB is a NoSQL object database for the Java programming language. Compared to other
NoSQL databases, ObjectDB is ACID compliant. ObjectDB does not provide an API and
requires using one of the two built-in Java database APIs:
ObjectDB includes all basic data types in Java, user-defined classes, and standard Java
collections. Every object has a unique ID. The number of elements is limited only by the
maximum database size (128 TB). ObjectDB is available cross-platform and the benchmark
performance is exceptional.
ObjectDatabase++
ObjectDatabase++ is a real-time embeddable object database designed for server-side
applications. The required external maintenance is minimal.
ObjectDatabase++ supports:
The object database is C++ based. One of the main features is advanced auto-recovery from
system crashes without compromising the database integrity.
Objectivity/DB
Objectivity/DB utilizes the power of objects and satisfies the complex requirements within Big
Data. The object database is flexible by supporting multiple languages:
• C++
• C#
• Python
• Java
The schema changes happen dynamically without the need for downtime, allowing real-time
queries against any data type. Objectivity/DB is available for multiple platforms, including
macOS, Linux, Windows, or Unix.
Note: Learn more about big data processing by refering to our post Big Data Servers Explained.
ObjectStore
ObjectStore integrates with C++ or Java and provides memory persistency to improve the
performance of application logic. The object database is ACID-compliant. The responsiveness
allows developers to build distributed applications cross-platform, whether on-premises or in the
cloud.
The main feature is cloud scalability, which allows database access from anywhere. ObjectStore
simplifies the data creation and exchange process seamlessly.
Versant
Versant provides primary transparent object persistence from C++, Java, and .NET. However,
there is also support for Smalltalk and Python. Versant supports different APIs depending on the
language used. Standard SQL queries are also available, making Versant a NoSQL database.
The object database is a multi-user client-server database. Versant performs best when used for
online transaction systems with large amounts of data and concurrent users.
Advantages
The main advantages are:
• Complex data and a wider variety of data types compared to MySQL data types.
• Easy to save and retrieve data quickly.
• Seamless integration with object-oriented programming languages.
• Easier to model the advanced real world problems.
• Extensible with custom data types.
Disadvantages
Some disadvantages include:
Conclusion
Object databases provide a modern approach to database modeling, mirroring the used in object-
oriented programming. Learn more about database technologies in our blog article What is
database as a service (DBaaS).