Applicability of Object Oriented Database Systems for

advertisement
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
Applicability of Object Oriented Database
Systems for Dreamhome
Abstract
Dreamhome is a data driven company with a wide range of fluctuating data. Everyday there
will be new users which have to be registered. New properties will be created, rented,
commented and evaluated by customers and staff
On the basis of this data there have to be generated weekly reports about properties.
Through the rapid growth of Dreamhome the communication between the offices is very
poor. Now a database should help to improve the communication and keeping the overview
for the management.
A future proofed system is needed for an increasing among of data and the ability of
extending and modifying has to be included.
So comes up the question what will be the better system for Dreamhome? An object oriented
Database or a Relational Database System?
This report is addressed to the advantages and disadvantages of object oriented database
systems and contains conclusions on the applicability of OODBMS for Dreamhome.
Advantages
Modelling Capabilities
A look at the data model of Dreamhome shows that there will be entities with complex
references. An object oriented database is more appropriate to store this object and the
relationships between this object than a relational database. In relational databases every
object has to be mapped in flat tables.
Dare Obasanjo: “A data model typically should model entities and their relationships,
constraints and operations that change the states of the data in the system. With an RDBMS it
is not possible to model the dynamic operations or rules that change the state of the data in
the system because this is beyond the scope of the database. Thus applications that use
RDBMS systems usually have an Entity Relationship diagram to model the static parts of the
system and a seperate model for the operations and behaviors of entities in the application.
With an OODBMS there is no disconnect between the database model and the application
model because the entities are just other objects in the system. An entire application can thus
be comprehensively modelled in one UML diagram.”
So in object oriented database systems there is no need for an application layer which would
decrease performance. Changes in the model can be done simple because modifications in an
application layer are not needed.
We know that Dreamhome will grow in the next years and there are increasing requirements.
So the model will be extended permanently and the application will become to an intelligent
-1-
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
database System. An Object Oriented Database System supports this requirements in a better
way than relational database systems.
Rick Greham: “Complex Data Relationships or, more precisely, complex object relationships. In
such applications, classes define multiple crossreferences among themselves. Applications that include
networked data structures fall into this category. Why? Complex cross referencing among objects can
be difficult and error-prone to model in a relational database system. Relationships among objects are
often dealt with (in an RDBMS) using foreign keys. So, fetching an object -- and then fetching objects
it references, and then the objects they reference -- can result in complicated and difficult-to-maintain
code. Meanwhile, most ODBMSes implement reachability persistence. That means that any object
referenced by a persistent object is also persistent. (If Object A references Object B, and Object A is
persistent ... then Object B becomes persistent automatically.) Typically, the depth to which
reachability persistence extends in an object tree can be specified by the programmer. As a result,
whole "gobs" of objects can be stored or fetched with a single call; the ODBMS engine handles the
details of maintaining the references when objects are stored, and satisfying them when objects are
fetched.”
In an application for Dreamhome there will be complex data relationships. There are
hierarchy structured data with mangers, supervisors, assistances and other parts of staff.
Clients with the aim to rent properties will also be found.
Removal of Impedance Mismatch
One of the challenges in relational database systems is to map the relationships between
classes.
This makes the use of relational tables essential to map these relationships. The use of
relational database system would denote a use of an “OR – Mapper”. In object oriented
database systems there is no need to map relationships, because it is possible to store the
objects with there relationships in the database without any mapping.
Dare Obasanjo: “In a typical application that uses an object oriented programming language
and an RDBMS, a signifcant amount of time is usually spent mapping tables to objects and
back. There are also various problems that can occur when the atomic types in the database
do not map cleanly to the atomic types in the programming language and vice versa. This
"impedance mismatch" is completely avoided when using an OODBMS.”
If we take a look at the business Objects of Dreamhome, there comes up polymorphism and a
lot of other relationships. It would take a lot of resources to map these objects in a relational
database. So when these resources were used for an evaluation of an object oriented database
system, which cap this requirements it will be the cheaper way.
Extensibility
To extend a relational database you have to add a field to a table or adding whole tables. After
that you have to modify the applications and the application layer which are accessing these
tables. So if you have more applications which are using these tables, you have to modify all
of them. Maybe you will need “throw away applications” to convert data into the correct
form.
So when we take a look into the future, most applications will grow during the years and the
number of requirements will increase to the system. It is easier to modify and extend the data
model in object oriented systems, because there is no need to modify the application layer or
the “OR-Mapper”.
-2-
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
Dare Obasanjo: “Schema Changes: In an RDBMS modifying the database schema either by
creating, updating or deleting tables is typically independent of the actual application. In an
OODBMS based application modifying the schema by creating, updating or modifying a
persistent class typically means that changes have to be made to the other classes in the
application that interact with instances of that class. This typically means that all schema
changes in an OODBMS will involve a system wide recompile. Also updating all the instance
objects within the database can take an extended period of time depending on the size of the
database.”
If we adopt this conclusion to Dreamhome, it predicts that there will be difficulties by
extending and modifying the database system. So there have to be a high availability for such
a system, and a compilation of the whole system would take a lot of time.
A look at relational Databases in view of schema changes forecasts that the costs will be
higher than in an Object Oriented Database System.
Rick Greham: “An ODBMS will typically weather data structure changes more easily than an
RDBMS. If you use an RDBMS, you'll likely have to change the schema (to fit the new object
structure), then alter the query code to handle the changes. You may even have to write a onetime conversion application to update the tables to the new format (the sort of throw-away
application you only write when you must, and wish you didn't have to waste the time
doing).”
So there are costs to modify and extend the data model in both systems. These costs will be
lower in object oriented system because changes can be done more easily than in relational.
Performance
In object oriented database systems is no need of an Application Layer or an “OR Mapper”.
Trough a removal of these layers, which would be breaks for the whole system, an object
oriented system is faster than a relational database.
Robert Greene: “While RDB architectures are very similar ( server centric, index based,
relational algebra execution engines ) exhibiting performance and scalability characteristics
differentiated by small percentages, OODB architectures vary considerably and exhibit wildly
different characteristics. After so many years of conditioning that RDB's behave essentially
the same, it was rather natural to apply the same reasoning to the ODB and proclaim, they
are basically the same. In making that assumption, if by chance an early adopter choose an
ODB who's architecture was ill suited for their applications needs, the reasoning lead
immediately to the conclusion that no ODB was suited to solve their needs. From this illogical
thinking came the permeation of misconceptions regarding the OODB: they are too slow, they
don't handle high concurrency, they don't scale with large data, etc, etc. These are all
misconceptions and the reality is that you need to carefully consider your application
characteristics and understand which OODB architecture is best suited to fulfill them.”
The application of Dreamhome creates complex data and complex relationships. Object
oriented database systems can deal better with complex data. Object oriented system can
traverse much faster through these relationships than relational database systems.
A statistic of retrieval time in contrast to count of records shows, that a tuned Object Oriented
Database Systems is miles faster than a relational database system.
-3-
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
Source: A. Chaudhri: Object Databases in Practice – Tutorial from Choosing a Database Technology
from Jens Coldewey
So Dreamhome is a very fast growing company and the amount of data will increase. This
graphic show that a tuned object oriented database system is ready to deal with great amount
of data. A relational database would do his work also well until a certain point. When the
amount of data will exceed this point the costs for a relational system will increase
exponential. It shows that an Object Oriented System is the better way.
Disadvantages
Standards
Every developer of Object Oriented Database systems cooks his own soup and standards are
defined very poor.
There are some defined Standards from ODMG – “Object Database Management Group”
which have the approach to standardise the way how objects are stored in a database.
An exchange of the accessibility level of a software system is easier in relational dataset
Systems than in Object Oriented Systems, because for relational database systems the
standards are clear defined and there is a better support for different programming languages.
If there is the need to exchange the accessibility level in an object oriented database system, it
is better to exchange the whole database, because in most times they are not compatible.
The Dilemma of Encapsulations vs. Query Optimization
In object oriented database is very simple to encapsulate the objects which are in it. But
through this encapsulation comes up the difficulty of query optimization.
Mike Blaha: “A method must be able to traverse links to obtain its neighbor objects and must
be able to call methods on them, but it should not traverse a second link from a neighbor to
-4-
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
objects of a third class because the second link is not directly visible to it. Instead call a
method on the neighbor object to traverse nonconnected objects. Then if the association
network changes, there is reduced disruption to methods.”
Objects are encapsulated and have references to other objects. So we have a wonderful
Encapsulation at a design view, but because of performance reasons we need the ability to
optimize queries. So in relational Database the Query optimizer does this work. In object
oriented systems you have to walk from one object to another through their relations.
Mike Blaha: “Query optimization has a different purpose—freedom for the DBMS to
optimize. Many DBMSs—especially relational DBMSs (RDBMSs)—have sophisticated
optimizers and may use efficient algorithms that an application programmer may overlook. In
addition, many DBMSs can revise their choice of algorithms as tuning structures and data
distribution change over time. RDBMS performance will usually be best if you join multiple
tables together in a single SQL statement, rather than disperse the tables across multiple
statements. Note the contradiction to encapsulation! Encapsulation encourages developers to
minimize combinations of tables in queries; query optimization encourages exactly the
opposite— large combinations of tables. This conflict might seem to be between OO
languages and RDBMSs. However, it is really between OO languages and DBMSs (both
relational and OO). The conflict is prominent for RDBMSs because they emphasize
nonprocedurality with the SQL language. However, as OO databases become more advanced,
their query optimizers will improve and raise the same dilemma.”
Language Dependence
To get access to the data you will need an API. So you are depended of one API from one
contractor. Third party applications will use the OODBMS as Data Source.
Dare Obasanjo: ”An OODBMS is typically tied to a specific language via a specific API. This
means that data in an OODBMS is typically only accessible from a specific language using a
specific API, which is typically not the case with an RDBMS.”
An evaluation of an OODBMS should not ignore this aspect, because Dreamhome will need
the ability to extend the system. Third part applications will also need an access to the system.
Security
In Relational Database Systems there are very good security systems. There is a lot of
experience for Relational Database Systems. The goods of relational systems in view of
security are very well known.
Piotr Habela: “Moreover, some issues not addressed by the ODMG standard, like e.g.
security mechanisms or event notification, has been designed for Objectivity/DB as services
external to the core DBMS”
Object Oriented Database Systems doesn’t have this experience, and potential risks are not
well known.
Ad hoc Queries:
Dare Obasanjo: “In an RDBMS, the relational nature of the data allows one to construct adhoc queries where new tables are created from joining existing tables then querying them.
Since it is currently not possible to duplicate the semantics of joining two tables by "joining"
-5-
Applicability of OODBS for Dreamhome
05/12/2008
Peter Glaser
two classes then there is a loss of flexibility with an OODBMS. Thus the queries that can be
performed on the data in an OODBMS is highly dependent on the design of the system.”
When the data model of Dreamhome is designed, these aspects should be considered and
afterwards this disadvantage could be particularly neglected.
Conclusion
An object oriented database system will be a future proofed way for Dreamhome. The
increasing amount of data and the complexity of the data and relationships are matching for
such a System.
To improve the communication in Dreamhome, an object oriented system will be the better
way, because the existing objects and their relationships can be mapped very well in object
oriented databases.
Customers will also have improvements from this system. Users will have the ability to
register, comment and rank properties. Managers and other staff need the ability to assign
properties and make decisions based on the data of the system.
Dreamhome needs the opportunity to extend the System, because with the years the
requirements will increase and the system has to be modified. These modifications can be
done with lower costs as in a relational database system.
References
[1]
[2]
[3]
[4]
[5]
Mark LeBlanc 2007: Relational and Object-Oriented Solutions Are Here To Stay
Rick Grehem: When to Use an ODBMS
Dare Obasanjo: “An Exploration of Object Oriented Database Management Systems”
Michale Blaha: “The Dilemma of Encapsulation vs. Query Optimization”
Michael Blaha and William Premerlani 1998: “Object Oriented Modeling and Design
For Databse Applications”
[6] Michael Blaha and James Rumbaugh 2005: Object- Oriented Modeling and Design with
UML”
[7] Alexandra Schäfer 2003: Der Impedance Mismatch
[8] Dr. Serge Shumilov 2004: Persistenz von Objekten
[9] Adrian Marriott: OODBMS Architectures RevisitedOODBMS Architectures:
http://www.odbms.org/
[10] Jens Coldewey 1998: Choosing a Database Technology
[11] Chaudhri: Object Databases in Practice
[12] Robert Greene OODBMS ARCHITECTURES
[13] Versant Object Database Fundamental Manual - release 7.0.1.0, July 2005
http://www.versant.com/developer/resources/objectdatabase/documentation/database_
fund_man.pdf
[14] Objectivity Inc. Technical Overview, Release 9, January 2006.
http://www.objectivity.com/Misc/docs/oodb_techOverview.pdf
[15] Locking and Concurrency, Objectivity Inc, 1999
http://wwwasd.web.cern.ch/wwwasd/lhc++/Objectivity/V5.2/Java/guide/jgdLocking.f
m.html
[16] Caixue Lin: Object-Oriented Database Systems: A Survey
[17] Piotr Habela 2003: Metamodel for Object-Oriented Database Management
Systems
-6-
Download