Setting Persistent Values

The Wolfram Language allows values to be set up to be persistent beyond a single invocation of the language. The persistent values can be stored in a variety of locations, locally or in the cloud. Values can either be retrieved from a single location or can be aggregated from multiple locations. Persistent values are used, for example, to support web sessions, and also for general system initialization.

Referencing Persistent Values

PersistentValue settable persistent value

PersistentObject an object representing a stored persistent value

Persistence Locations

PersistenceLocation symbolic specification of a persistence location

"KernelSession" current invocation of the Wolfram Language kernel

"FrontEndSession" current invocation of the Wolfram notebook front end

"Local" local to a computer, based on user home directory

"LocalShared" local to a computer, based on $BaseDirectory

"Cloud" in the cloud defined by the current $CloudBase

"Installation" built-in default settings for a given installation

$PersistenceBase default location at which to store newly defined persistent values

$PersistencePath default locations at which to look for requested persistent values

Managing Persistent Values

MergingFunction option to define how to merge values from different locations

PersistentObjects persistent objects with names matching a pattern