Persistence (computer science)

Persistence (computer science)

Persistence in computer science refers to the characteristic of state that outlives the process that created it. Without this capability, state would only exist in RAM, and would be lost when this RAM loses power, such as a computer shutdown.[citation needed]

This is achieved in practice by storing the state as data in non-volatile storage such as a hard drive or flash memory.

Picture editing programs or word processors, for example, achieve state persistence by saving their documents to files.

Contents

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.

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 [citation needed]. Research prototype languages such as PS-algol, Napier88, 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 [citation needed]. Perl 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 and VirtualBox for state saving.

Persistence techniques

System images

Using system images is the simplest persistence technique. Notebook hibernation 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 systems and database management systems 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 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. This results in code that is slower than native code and more complicated to debug.

Persistence layers

Any software layer 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 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 systems 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

See also


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Marshalling (computer science) — In computer science, marshalling (sometimes spelled marshaling, similar to serialization) is the process of transforming the memory representation of an object to a data format suitable for storage or transmission. It is typically used when data… …   Wikipedia

  • Aspect (computer science) — In computer science, an aspect is a part of a program that cross cuts its core concerns, therefore violating its separation of concerns. For example, logging code can cross cut many modules, yet the aspect of logging should be separate from the… …   Wikipedia

  • Persistence — may refer to: * Persistence (computer science), the characteristic of data that outlives the execution of the program that created it * Persistence (meteorology), the meteorological phenomenon by which weather remains relatively unchanged over… …   Wikipedia

  • Science fiction film — is a film genre that uses science fiction: speculative, science based depictions of phenomena that are not necessarily accepted by mainstream science, such as extraterrestrial life forms, alien worlds, extrasensory perception, and time travel,… …   Wikipedia

  • Object persistence — is an object oriented, in memory, language specific, persistent data storage and retrieval model used in computer programming. It is based on the techniques of system snapshotting and transaction journalling. The first usage of the term and… …   Wikipedia

  • Computer-mediated communication — For other uses, see CMC (disambiguation). Computer mediated communication (CMC) is defined as any communicative transaction that occurs through the use of two or more networked computers.[1] While the term has traditionally referred to those… …   Wikipedia

  • Science Fiction Achievement Award — Der Hugo Award (eigentlich: Science Fiction Achievement Award) ist ein seit 1953 verliehener, nach Hugo Gernsback, dem Begründer des Begriffs Science Fiction, benannter Leserpreis. Er gilt als einer der wichtigsten Preise in der SF Literatur und… …   Deutsch Wikipedia

  • List of atheists (science and technology) — cience and technology thumb|right|100px|Dirac * Peter Atkins (1940 ndash;): English chemist, Professor of chemistry at Lincoln College, Oxford in England. [When asked by Rod Liddle in the documentary The Trouble with Atheism Give me your views on …   Wikipedia

  • Indian Institute of Science — Infobox University name = Indian Institute of Science, Bengaluru established = 1909 type = Research Institution director = Dr. Padmanabhan Balaram city = Bangalore state = Karnataka country = India campus = students = undergrad = postgrad =… …   Wikipedia

  • Ontology library (information science) — Ontology Libraries are storage areas for ontologies. There is no one ontology language, therefore ontology libraries are usually restricted to plain text files or some XML storage format, mostly plain files again. Advanced solutions for ontology… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”