13 Anti-pattern: orthogonal persistence
Unnecessary persistence is an anti-pattern. Taking this to its extreme is called "orthogonal persistence" - everything persists, including all the finite state machines. This raises the question of how to find a consistent cut.
Sometimes it's called transparent persistence, or persistence ignorance.
The wikipedia article on persistence has a section on orthogonal persistence and claims:
The advantage of orthogonal persistence environments is simpler and less error-prone programs
Unfortunately there is no mention of all the serious, inherent problems with orthogonal persistence. For example, it almost certainly involves the Inadequate persistence system anti-pattern.
Nevertheless there's an enormous amount of literature and products trying to achieve it:
- Orthogonal Persistence from CLiki for the TUNES project
- Orthogonal Persistence Revisited Alan Dearle, Graham N.C. Kirby and Ron Morrison, 2010
- Transparent Persistence
- Implementing Orthogonal Persistence: A Simple Optimization Based on Replicating Collection Scott Nettles and James O'Toole, 1993
- Critique of orthogonal persistence Cooper and Wise 1996
- Orthogonal Persistence for the Java™ Platform: Specification and Rationale Mick Jordan and Malcolm Atkinson, 2000
- Implementing Orthogonally Persistent Java Alonso Marquez, Stephen M Blackburn, Gavin Mercer and John Zigman
- Orthogonal Persistence in a Heterogeneous Distributed Object-Oriented Environment Pedro Sousa, André Zúquete, Nuno Neves, José Alves Marques, 1994
- Providing Persistent Objects in Distributed Systems Barbara Liskov, Miguel Castro, Liuba Shrira and Atul Adya, 1999
- Orthogonally Persistent Object Systems Malcolm Atkinson and Ronald Morrison, 1995
- Providing orthogonal persistence for Java Malcolm Atkinson and Mick Jordan, 1998
- Orthogonal persistence and Ada Stephen Crawley and Michael Oudshoorn, 1994
The following quote is by Robert Di Falco
I've never seen a transparent Persistence Mechanism that performs adequately - unless that is, it was hand coded to the domain it was serving. The problem with transparent persistence is that you usually lose all the cool things about relational calculus that makes data queries fast - out left joins, searching, and such. The worst thing about transparent persistence is the traffic between the data engine and the application model. For example, you either end up retrieving objects one row at a time or retrieving the entire set of objects - when you are dealing with millions of records, that is a drag.
There have even attempts at making an OS support it: