Docsity

Object-Oriented Databases and Their Advantages and Disadvantages, Study notes of Database Management Systems (DBMS)

Toggle sidebar
bg1
Object-oriented databases
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.
An object database is managed by an object-oriented database management system
(OODBMS). The database combines object-oriented programming concepts with relational
database principles.
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 behaviour.
Methods determine the behaviour of a class.
Pointers help access elements of an object database and establish relations between
objects.
The main characteristic of objects in OODBMS is the possibility of user-constructed
types. An object created in a project or application saves into a database as is.
Object-oriented databases directly deal with data as complete objects. All the
information comes in one instantly available object package instead of multiple tables.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Object-Oriented Databases and Their Advantages and Disadvantages and more Study notes Database Management Systems (DBMS) in PDF only on Docsity!

Object-oriented databases

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.

An object database is managed by an o bject- o riented d ata b ase m anagement s ystem (OODBMS). The database combines object-oriented programming concepts with relational database principles.

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 behaviour.  Methods determine the behaviour of a class.  Pointers help access elements of an object database and establish relations between objects.

The main characteristic of objects in OODBMS is the possibility of user-constructed types. An object created in a project or application saves into a database as is.

Object-oriented databases directly deal with data as complete objects. All the information comes in one instantly available object package instead of multiple tables.

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 behaviours of data into one entity.

Object-Oriented Programming Concepts

Object-oriented databases closely relate to object-oriented programming concepts. The four main ideas of object-oriented programming are:

PolymorphismInheritanceEncapsulationAbstraction

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

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 complexity 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.

Object-Oriented Database Examples

There are different kinds of implementations of object databases. Most contain the following features:

Feature Description

Query Language Language to find objects and retrieve data from the database.

Transparent Persistence

Ability to use an object-oriented programming language for data manipulation.

ACID Transactions ACIDconflicting changes.^ transactions guarantee all transactions are complete without

Database Caching

Creates a partial replica of the database. Allows access to a database from program memory instead of a disk.

Recovery Disaster recovery in case of application or system failure.

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.

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:

JPA with JPA Query Language (JPQL) based on Java syntax.  JDO with JDO Query Language (JDQL) based on SQL syntax.

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:

 Multi-process with multi-threaded server applications.  Full transaction control.  Real-time recovery.  C++ related languages, VB.NET as well as C#.

Object-Oriented Database Advantages and Disadvantages

Every database modeling technique has advantages and disadvantages. Before opting in for object-oriented databases, you must know the available languages in addition to the application intent.

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:

 Not as widely adopted as relational databases.  No universal data model. Lacks theoretical foundations and standards.  Does not support views.  High complexity causes performance issues.  An adequate security mechanism and access rights to objects do not exist.

The Relational Data Model

The relational data model was introduced by E. F. Codd in 1970. Currently,

it is the most widely used data model.

The relational model has provided the basis for:

 Research on the theory of data/relationship/constraint

 Numerous database design methodologies

 The standard database access language called s tructured query language (SQL)

 Almost all modern commercial database management systems

The relational data model describes the world as ―a collection of inter-related

relations (or tables).‖

Fundamental Concepts in the Relational Data Model

Relation

A relation, also known as a table or file , is a subset of the Cartesian product

of a list of domains characterized by a name. And within a table, each row

represents a group of related data values. A row , or record, is also known as

a tuple. The columns in a table are a field and are also referred to as an attribute.

You can also think of it this way: an attribute is used to define the record and a

record contains a set of attributes.

The steps below outline the logic between a relation and its domains.

1. Given n domains are denoted by D1, D2, … Dn

2. And r is a relation defined on these domains

3. Then r ⊆ D1×D2×…×Dn

Table

A database is composed of multiple tables and each table holds the data.

Figure 7.1 shows a database that contains three tables.

 The domain of Salary is the set of all floating-point numbers greater than 0 and less

than 200,000.

 The domain of First Name is the set of character strings that represents names of

people.

In summary, a domain is a set of acceptable values that a column is allowed to

contain. This is based on various properties and the data type for the column.

Records

Just as the content of any one document or item needs to be broken down

into its constituent bits of data for storage in the fields, the link between them also

needs to be available so that they can be reconstituted into their whole form.

Records allow us to do this. Records contain fields that are related, such as a

customer or an employee. As noted earlier, a tuple is another term used for record.

Records and fields form the basis of all databases. A simple table gives us the

clearest picture of how records and fields work together in a database storage

project.

The simple table example in Figure shows us how fields can hold a range of

different sorts of data. This one has:

 A Record ID field: this is an ordinal number; its data type is an integer.

 A PubDate field: this is displayed as day/month/year; its data type is date.

 An Author field: this is displayed as Initial. Surname; its data type is text.

 A Title field text: free text can be entered here.

You can command the database to sift through its data and organize it in a

particular way. For example, you can request that a selection of records be limited

by date: all before a given date, all after a given date or. all between two given

dates. Similarly, you can choose to have records sorted by date. Because the field,

or record, containing the data is set up as a Date field, the database reads the

information in the Date field not just as numbers separated by slashes, but rather,

as dates that must be ordered according to a calendar system.

Degree

The degree is the number of attributes in a table. In our example in Figure, the

degree is 4.

Properties of a Table

 A table has a name that is distinct from all other tables in the database.  There are no duplicate rows; each row is distinct.  Entries in columns are atomic. The table does not contain repeating groups or multivalued attributes.  Entries from columns are from the same domain based on their data type including: o number (numeric, integer, float, smallint,…) o character (string) o date o logical (true or false)  Operations combining different data types are disallowed.  Each attribute has a distinct name.  The sequence of columns is insignificant.  The sequence of rows is insignificant.

SQL-99: Standard Language for an ORDBMS (Object-

Relational DBMS)

SQL:1999 (also called SQL 3) was the fourth revision of the SQL database query language. It introduced many new features, many of which required clarifications in the ubsequent SQL:2003. In the meanwhile SQL:1999 is deprecated.

Used to CREATE, DROP, and ALTER the descriptions of the tables (relations) of a database

XML Database

XML database is a data persistence software system used for storing the huge amount of information in XML format. It provides a secure place to store XML documents.

You can query your stored data by using XQuery, export and serialize into desired format. XML databases are usually associated with document-oriented databases.

Types of XML databases

There are two types of XML databases.

  1. XML-enabled database
  2. Native XML database (NXD)

XML-enable Database

XML-enable database works just like a relational database. It is like an extension provided for the conversion of XML documents. In this database, data is stored in table, in the form of rows and columns

Native XML Database

Native XML database is used to store large amount of data. Instead of table format, Native XML database is based on container format. You can query data by XPath expressions.

Native XML database is preferred over XML-enable database because it is highly capable to store, maintain and query XML documents.

Let's take an example of XML database:

In the above example, a table named contacts is created and holds the contacts (contact and contact2). Each one contains 3 entities name, company and phone.

Semi-Structured Data

Data can be defined as the information converted into a very economical form for translation or processing. Data, including video, images, sounds, and text, is represented as binary values that mean 0 or 1. Using these two numbers, patterns are generated to store different types of data. The smallest unit of data in a computer system is a bit, and a single value is represented using a bit. A byte is eight binary digits long.

Data can be defined as information converted into binary digital form in today's computers and transmission media. With the increase in the number of computer users, the amount of data generated also increased significantly within the last decade. So a new term is coined for such a huge volume of data that is

generating at a rapid speed. It is called big data. It is not only the volume of the data that has increased

over time.

Along with the volume, the variety of the data getting generated is increasing rapidly. So it becomes very important to classify the types of data that is getting generated. In this era of the internet, a vast amount of data is generated. This data can be text, images, videos, documents, pdf files, videos, log files, and many more.

Examples of Semi-Structured Data

Semi-structured data comes in a multitude of formats, each with its own set of applications. Some are hardly structured at all, while others have a quite sophisticated hierarchical structure.

  1. CSV The three main languages used to interact or transfer data from a web server to a client are CSV, XML, and JSON (i.e., computer, Smartphone, etc.). CSV stands for "comma separated values", and data are expressed as Lucy, Jessica, and Anthony. It can be expressed in the same way as Excel files but with only one column.
  2. Email Email is arguably the most common type of semi-structured data since we all have it on a routine basis. Email messages comprise structured

data such as name, email address, recipient, date, time, and so on, and are also organized into folders such as Inbox, Sent, Trash, and so on. Even if most email software packages allow you to find by keyword or other text, the data inside every email is unstructured. Emails can provide a plethora of data mining opportunities for enterprises to analyze customer feedback, ensure customer service is operational, and assist in creating marketing materials.

  1. HTML HTML or "Hyper Text Markup Language" is a hierarchical language, and it is similar to XML but unlike XML. HTML is used to create websites and visualize information. The commentaries used to display text and images on a computer screen provide the semi-structure of HTML, but the text and images themselves are unstructured.
  2. Web Pages Web pages are designed to be easily accessible with tabs like Home, About Us, Blog, Contact, and so on, or links to other pages within the text, to help users find the information they need. Of course, this is all authored in HTML, but we don't see that on the computer monitor. And the text and data on each of these pages are unstructured.
  3. NoSQL Databases Non-relational databases are commonly referred to as NoSQL ("not only structured query language" or "non SQL") databases, with the most common types being document, key-value, wide-column, and graph. They are versatile data storage devices because they can store both structured and unstructured data. And are ideal for semi-structured data because they scale easily. A single added layer of structure (subject, value, data type, etc.) can make unstructured data easier to search and process.
  4. Electronic Data Interchange (EDI) EDI is the electronic computer-to-computer transmission of business documents such as purchase orders, invoices, and inventory documents previously transmitted on paper. Because EDI uses many standard formats, including ANSI, EDIFACT, TRADACOMS, and ebXML, businesses must use the same format when communicating via EDI. EDI enables much faster and less expensive document transmission. Although each format is intended to be easily processed and understood by machines, the data contained within each transmission is unstructured.