Persistence (computer science)

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Persistence in computer science refers to the characteristic of data that outlives the execution of the program that created it. Without this capability, data only exists in RAM, and will be lost when the memory loses power, such as on computer shutdown.

Contents

[edit] Overview

In programming, persistence refers specifically to the ability to retain data structures between program executions, such as, for example, an image editing program or a word processor saving their documents to avoid data loss in the event of power failures.

This is achieved in practice by storing the data in non-volatile storage such as a hard drive or flash memory. When first introduced, the idea was that persistence should be an intrinsic property of the data, in contrast with the current approach where data is read and written to disk using imperative verbs in a programming language. This emphasis has largely disappeared, resulting in the use of persist as a transitive verb: On completion, the program persists the data.

[edit] Persistence topics

[edit] Built-in to operating systems and programming languages

Orthogonal persistence refers to either

  • 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

[edit] User interface

Most software applications include persistence as a minimum required feature in order for the software to be considered complete. In this context, persistence operations are usually separated into well-recognized categories, based on the types of data entries stored by the software. These categories are:

  • the ability to add (or create) new entries;
  • the ability to view (or retrieve) existing entries;
  • the ability to edit (or update) existing entries;
  • the ability to undo / redo the last modifications;
  • the ability to cut / copy / paste / delete existing entries.

Moreover, although not necessarily a minimum required standard for software, the following operations are also commonly associated with persistence, whenever a large number of entries must be maintained:

  • the ability to search for entries;
  • the ability to sort entries;
  • the ability to filter entries.

[edit] Storage devices

A persistent storage device (PSD) has the ability to maintain data even when it is turned off. Devices that provide persistent storage capabilities are called non-volatile memory devices. Examples are a hard drive, flash memory and CD.

Devices that need power to store data, as does random access memory (RAM), are called volatile memory devices and do not provide persistent storage.

On many early personal data assistants (PDAs), all data was stored in RAM. When the batteries ran out of power, all data was lost. Most newer PDA designs provide persistent storage to prevent the user from losing all data on the device.

[edit] Incremental persistence

Incremental persistence is simply writing each change to an in-memory-datastructure immediately to disk or other non volatile storage device. When used with object-oriented languages, this is known as object prevalence.

[edit] See also

[edit] References

Personal tools