Persistence Mechanism

    The persistence mechanism is essentially a “pause and resume” feature for your LocalStack application state. For instance, you may want to run consecutive integration tests where each test loads in a different context but depends on the state produced by a previous test. Commonly, you may simply have a local development server that relies on a non-ephemeral application state.

    While the persistence mechanism covers most services, not all of them are supported yet. Please make sure to check the feature coverage page to see whether your desired services are covered.

    In the past we supported a version of persistence – available in the Community version – based on a record-and-replay approach (basically, storing API calls and re-running them on restart), we discontinued this feature with . Therefore, please note that persistence in LocalStack, as currently intended, is a Pro only feature (more on that in the Technical Details section).

    To enable the persistence mechanism simply set the environment variable to .

    Once the application has been set and configured properly, the endpoint of LocalStack will indicate whether the persistence mechanism has been initialized successfully.

    Otherwise, the endpoint will inform you that the mechanism is disabled.

    Typically, each service has one state file for each region.

    Each serialization mechanism has its root folder. As of now, all supported services are serialized as pickle files. Particular services, in addition to their pickled files, can serialize additional artifacts. For instance, Kinesis persists some data in form of JSON while DynamoDB serializes a SQLite database. This is illustrated in the diagram below.