Persistence (computer science)
Encyclopedia
Persistence in computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

 refers to the characteristic of state
State (computer science)
In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers....

 that outlives the process
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 that created it. Without this capability, state
State (computer science)
In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers....

 would only exist in RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

, and would be lost when this RAM loses power, such as a computer shutdown.

This is achieved in practice by storing the state
State (computer science)
In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers....

 as data in non-volatile storage such as a hard drive or flash memory
Flash memory
Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed. It was developed from EEPROM and must be erased in fairly large blocks before these can be rewritten with new data...

.

Picture editing programs or word processors, for example, achieve state
State (computer science)
In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers....

 persistence by saving their documents to files.

Orthogonal or transparent persistence

Persistence is said to be "orthogonal" or "transparent" when it is implemented as an intrinsic property of the execution environment of a program. An orthogonal persistence environment does not require any specific actions by programs running in it to retrieve or save their state
State (computer science)
In computer science and automata theory, a state is a unique configuration of information in a program or machine. It is a concept that occasionally extends into some forms of systems programming such as lexers and parsers....

.

Non-orthogonal persistence requires data to be written and read to and from storage using specific instructions in a program, resulting in the use of persist as a transitive verb: On completion, the program persists the data.

The advantage of orthogonal persistence environments is simpler and less error-prone programs.

Adoption

Orthogonal persistence is unusual in commercially used programming languages. Research prototype languages such as PS-algol
PS-algol
PS-algol is an orthogonally persistent programming language.PS-algol was an extension of the language S-algol implemented by the Universities of St Andrews and Edinburgh, Scotland...

, Napier88
Napier88
Napier88 is an orthogonally persistent programming language.Napier88 was designed and implemented at the University of St Andrews, Scotland. The primary designer was Ron Morrison, whose initial designs were extended and implemented by Fred Brown, Richard Connor, and Al Dearle...

, Fibonacci and pJama, successfully demonstrated the concepts along with the advantages to programmers. As Java developed, the more traditional mechanism of serialization and, later, JAXB bindings, gave similar functionality to programmers and orthogonal persistence failed to flourish. Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

 has two well-defined interfaces for providing alternate semantics to fetches and stores on its basic data types, "tie" and "overload," both of which are often used to provide orthogonal interfaces to persistent storage methods.
Orthogonal persistence is widely adopted in operating systems for hibernation and in platform virtualization systems such as VMWare
VMware
VMware, Inc. is a company providing virtualization software founded in 1998 and based in Palo Alto, California, USA. The company was acquired by EMC Corporation in 2004, and operates as a separate software subsidiary ....

 and VirtualBox
VirtualBox
Oracle VM VirtualBox is an x86 virtualization software package, originally created by software company Innotek GmbH, purchased by Sun Microsystems, and now developed by Oracle Corporation as part of its family of virtualization products...

 for state saving.

System images

Using system images
System image
A system image in computing is a copy of the entire state of a computer system stored in some non-volatile form such as a file. A system is said to be capable of using system images if it can be shut down and later restored to exactly the same state...

 is the simplest persistence technique. Notebook hibernation
Hibernate (OS feature)
Hibernation in computing is powering down a computer while retaining its state.Upon hibernation, the computer saves the contents of its random access memory to a hard disk or other non-volatile storage...

 is an example of orthogonal persistence using a system image because it does not require any actions by the programs running on the machine. An example of non-orthogonal persistence using a system image is a simple text editing program executing specific instructions to save an entire document to a file.

Shortcomings: State changes made to a system after its last image was saved are lost in the case of a system failure or shutdown. Saving an image for every single change would be too time-consuming for most systems, so images are not used as the single persistence technique for critical systems.

Journals

Using journals is the second simplest persistence technique. Journaling is the process of storing events in a log before each one is applied to a system. Such logs are called journals.

On startup, the journal is read and each event is reapplied to the system, avoiding data loss in the case of system failure or shutdown.

The entire "Undo/Redo" history of user commands in a picture editing program, for example, when written to a file, constitutes a journal capable of recovering the state of an edited picture at any point in time.

Journals are used by journaling file system
Journaling file system
A journaling file system is a file system that keeps track of the changes that will be made in a journal before committing them to the main file system...

s and database management system
Database management system
A database management system is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators and other specialists. A database is an integrated...

s where they are also called "transaction logs" or "redo logs".

Shortcomings: Journals are often combined with other persistence techniques so that the entire (potentially large) history of all system events does not have to be reapplied on system startup.

System prevalence

System prevalence is a technique that combines system images and transaction journals, mentioned above, to overcome their limitations.

Shortcomings: A prevalent system must have enough RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 to hold the entire system state.

Dirty writes

Dirty writes refer to the writing out to storage of only those portions of system state that have been modified (are dirty) since their last write. Sophisticated document editing applications, for example, will use dirty writes to save only those portions of a document that were actually changed since the last save.

Shortcomings: This technique requires state changes to be intercepted within a program. This is achieved in a non-transparent way by requiring specific storage-API calls or in a transparent way with automatic program transformation
Program transformation
A program transformation is any operation that takes a computer program and generates another program. In many cases the transformed program is required to be semantically equivalent to the original, relative to a particular formal semantics and in fewer cases the transformations result in programs...

. This results in code that is slower than native code and more complicated to debug.

Persistence layers

Any software layer
Layer (object-oriented design)
In object-oriented design, a layer is a group of classes that have the same set of link-time module dependencies to other modules. In other words, a layer is a group of reusable components that are reusable in similar circumstances...

 that makes it easier for a program to persist its state is generically called a persistence layer. Most persistence layers will not achieve persistence directly but will use an underlying database management system
Database management system
A database management system is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators and other specialists. A database is an integrated...

.

Database management systems (DBMSs)

DBMSs use a combination of the dirty writes and transaction journaling techniques mentioned above. They provide not only persistence but also other services such as queries, auditing and access control.

Persistent operating systems

Persistent operating systems are operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s that remain persistent even after a crash or unexpected shutdown. The computer stays in the same state even if you turn it off, behaving much like a TV or similar device. Operating systems that employ this ability include
  • CapROS
    CapROS
    CapROS is an open source operating system. It is a pure capability-based system that features automatic persistence of data and processes, even across system reboots. Capability systems naturally support the principle of least authority, which improves security and fault tolerance.CapROS is an...

    , revisions of EROS
  • Coyotos
    Coyotos
    Coyotos is a capability-based security-focused microkernel operating system developed by The EROS Group, LLC. It is a successor to the EROS system that was created at the University of Pennsylvania and Johns Hopkins University.- History :...

    , successor to EROS
  • EROS
    Extremely Reliable Operating System
    EROS is an operating system developed by The EROS Group, LLC., the Johns Hopkins University, and the University of Pennsylvania. Features include automatic data and process persistence, some preliminary real-time support, and capability-based security. EROS is purely a research operating system,...

    , the successor to KeyKOS
  • KeyKOS
    KeyKOS
    KeyKOS is a persistent, pure capability-based operating system for the IBM S/370 mainframe computers. It allows emulating the VM, MVS, and POSIX environments. It is a predecessor of the Extremely Reliable Operating System , and its successors, the CapROS and Coyotos operating systems...

  • Multics
    Multics
    Multics was an influential early time-sharing operating system. The project was started in 1964 in Cambridge, Massachusetts...

     with its single-level store
    Single-level store
    Single-level storage is a term most often associated with the IBM System i operating system, IBM i , although it was originally introduced in 1962 by the Atlas system at Cambridge...

  • Phantom
    Phantom OS
    Phantom OS is an operating system mostly made by Russian programmers.Phantom OS is based on a concept of persistent virtual memory, and is managed-code oriented. Phantom OS is one of a few OSes that are not based on classical concepts of UNIX-like systems...

  • IBM System/38

See also

  • CRUD
  • Java Data Objects
    Java Data Objects
    Java Data Objects is a specification of Java object persistence. One of its features is a transparency of the persistent services to the domain model. JDO persistent objects are ordinary Java programming language classes ; there's no requirement for them to implement certain interfaces or extend...

  • Java Persistence API
    Java Persistence API
    The Java Persistence API, sometimes referred to as JPA, is a Java programming language framework managing relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition....

  • System Prevalence
  • Orthogonality
  • Persistent data structure
    Persistent data structure
    In computing, a persistent data structure is a data structure which always preserves the previous version of itself when it is modified; such data structures are effectively immutable, as their operations do not update the structure in-place, but instead always yield a new updated structure...

  • Service Data Object
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK