19

I have come across many relational database management systems (RDBMS). But recently I used hibernate which made me start wondering why Object Oriented databases aren't more popular.

If object oriented languages like Java or C# are so popular, then why aren't object-oriented database management systems (OODBMS) more popular too?

Rachel
  • 23,979
  • 16
  • 91
  • 159
  • 1
    "NoSQL" approach is extremely popular now. RDBMSes are limited and limiting, and, fortunately, they're loosing their ground now quickly. – SK-logic Dec 03 '12 at 11:03
  • What do you refer as oodb? hibernate is just a framework to communicate with rdbms with an oo interface. – Simon Bergot Dec 03 '12 at 11:23
  • 2
    Similar question was asked 2009 on SO, see http://stackoverflow.com/questions/1350044/why-arent-oodbms-as-widespread-as-rdbms IMHO almost every answer given there is still valid today. – Doc Brown Dec 03 '12 at 11:44
  • @Simon by oodb , I mean object oriented databases –  Dec 03 '12 at 11:54
  • @tito I get that... Can you give an example? – Simon Bergot Dec 03 '12 at 12:03
  • 1
    @Simon: Versant is an oodb (I have seen in production in two different companies). – Giorgio Dec 03 '12 at 12:06
  • @SK-logic Relational DBs have and will always have a place if you have RELATIONAL DATA. They are definitely not the best answer for everything but very large relational sets are best handled by SQL, not a document store. – JNK Dec 03 '12 at 15:08
  • @JNK, of course, but most of the real-world data is not relational. It is either a stream data (i.e., a time-indexed stream of tuples) or hierarchical, tree-like data. It is an exceptionally rare case when a relational representation is truly adequate and the most natural. – SK-logic Dec 03 '12 at 15:24
  • @SK-logic I guess we will have to agree to disagree. I think you are confusing how data is RECEIVED with the most efficient way to store it. To me how it comes in is irrelevant to what the data means, and a lot of times (especially in business) that data is relational. – JNK Dec 03 '12 at 15:26
  • @JNK, yes, of course, when you're wielding a hammer everything looks like a nail. But I have never seen an efficient relational storage for naturally hierarchical data (which is the most usual case in business and scientific worlds). Depth-first tree walking with SQL is one of the most pathetic things I've ever seen. – SK-logic Dec 03 '12 at 16:28
  • There's probably no single reason, but another one worth mentioning is that relational databases are better _integration_ technology than OODBs are, since all practical OODBs force a particular language and library on you. RDBMSes are much more agnostic and have much better overall data visibility (which includes ad-hoc reporting), partly because the data model you interface with is simpler. – Daniel Lyons Feb 12 '15 at 18:28
  • See [this](http://stackoverflow.com/a/34468968/3404097) alternate take. – philipxy Dec 29 '15 at 07:52
  • @DanielLyons I'm not sure this is true. RDBMSes force a particular language (SQL, T-SQL, PL-SQL, etc) and library on you as well. The only reason we think it's more agnostic, visible, and simple is because we've been drinking the kool-aid for decades. –  Apr 07 '16 at 16:05
  • @lunchmeat317 If that is true, tell me how to use [ZODB](http://www.zodb.org/en/latest/) from Ruby, or [Objectivity](http://www.objectivity.com/products/objectivitydb/) from Pharo, or [Magma](http://wiki.squeak.org/squeak/2665) from C++. You can't, because you're conflating query language with programming language. OTOH I can access just about any relational database from just about any programming language. Non-OOP, non-relational databases like [RethinkDB](http://rethinkdb.com/) get this right without using SQL: you need a separate query language to be language-agnostic. – Daniel Lyons Apr 07 '16 at 18:26

3 Answers3

11

There are multiple reasons.

  1. Many developers are only experienced in relational data modeling. To use OO databases, they would need to learn completely different way to model and think about data. This is either really hard or quite time consuming.
  2. Relational DBs had lot of time to mature. Even free relational DBs have advanced optimization and indexing techniques. Also, relational data is easy to store and index. Same thing cannot be said about OO databases.
  3. When relational and OO models started to emerge. Relational had huge edge that it was mathematically "correct" and it had it's standard for saving and querying data. OO had nothing of sort.
  4. [speculation]Many big players put lots of resources into making their relational DBs. It would be counterproductive to support OO DBs instead. So many of them instead invested into integrating OO principles into relational model, making most current DBs so-called object-relational. IMO these models are worst than pure relational or pure OO.[/speculation]
  5. [rant]Last thing to note is that many developers don't really understand OO way to model data. This usually results in suboptimal, anemic models. So many development companies, that rely on cheap and inexperienced developers would rather choose simple, relational model, that is taught in all CS colleges than pick hard and unproven OO aproach.[/rant]
Euphoric
  • 36,735
  • 6
  • 78
  • 110
  • 5
    I agree with all your points except the last. I think its way easier for developers to mess up relational databases than object databases. Composite keys and broken relationships are very common, but it seems to me at least a little harder to mess up a class hierarchy. – Tjaart Dec 03 '12 at 11:24
  • @Tjaart messing up class hierarchies seems to be the norm for most developers in OO. – Bent Jul 06 '18 at 08:16
  • Your first point is not correct. If you are using OOP paradigm as a developer, you know how to model data. The whole point is that you don't need relational modeling, you just use the modeling you have been using in your code, i.e. your data structures – Benjamin Erichsen Feb 02 '20 at 18:08
  • Another issue is if multiple applications share a database. They are all coupled to the data model. If one app wants to change it, then this could break the other applications. Martin Fowler talks about this. Yeah changes in the schema can happen in relational databases, but the schema is definitely not as fragile in the average case. – Benjamin Erichsen Feb 02 '20 at 18:10
  • I am not sure that an object database is superior to a relational database and ORM combination. One common use case of SQL database is ad-hoc queries - questions we want to ask that we may not have considered before e.g. for marketing or business intelligence. A lot of times this is done by non-developers who just know sql. Sure you could add some SQL engine on top of the object database, but this would not be as performant on large data sets, and would just be more code in the end, as opposed to having an ORM and a relational db – Benjamin Erichsen Feb 02 '20 at 18:13
11

When databases first appeared, OOP still wasn't the way to program. Relational databases, on the other hand, gained a lot of traction. And SQL introduced in the 80's by IBM quickly became lingua franca of all databases.

When OOP become popular there were some attempts, but there are some problems. First, true OODBMS is really hard to implement. In case of a relational database, a table and related indexes are fairly simple structures (eg. B-trees). Another reason is that there is a lot of theory behind relational model, it's directly derived from mathematical set theory. There are known ways to correctly design a relational database (think normalization etc). And last but not least, people already got used to SQL a lot.

Modern-day NoSQL solutions in most cases aren't really a step towards OODBMS. Many of them are still relational, only stripped of JOINs. Few of them are in fact object stores but are not truly OODBMS, as they are not aware of relations between the objects.

Yet another reason why there is not such a strong push for OODBMS is that there is "poor man's OODBMS" solution — ORMs. This has gained huge popularity, as they are backed by well known, stable and tested DB engines, yet they provide the mapping to objects. Of course, these are not true OODBs.

esoterik
  • 3,879
  • 3
  • 13
  • 22
vartec
  • 20,760
  • 1
  • 52
  • 98
  • "Yet another reason why there is not such a strong push for OODBMS is that there is "poor-man's OODBMS" solution — ORMs.": Very good point! +1. – Giorgio Dec 04 '12 at 16:35
  • That's not true. MUMPS was designed in 1966 and only by 1974, the first research project was started by IBM to develop the System R, the world first RDBMS. Oracle only released their world-first commercial-grade RDBMs in 1979, the same year when InterSystems M came to light. The question is what happened after that. The answer is probably that ODBMSes weren't optimised for reporting, while the majority of use-cases of LOB applications have a heavy read-write disbalance towards reads. – Alexey Zimarev Nov 04 '18 at 14:33
-2

OODBMS are good at storing complex data. However, most of the time, even when using OO languages, the needed data is relatively simple. So traditional RDBMS are more suited.

Pieter B
  • 12,867
  • 1
  • 40
  • 65
  • 2
    Data is almost never simple, and I think you fail to explain why OODB is not more popular because after all ORM is doing very well. – Tjaart Dec 03 '12 at 11:20