Persistence Store

Stores data in a key-value disk store.

Usage

The Persistence Store Node allows you to store any arbitrary data on the disk of the Runtime in a key/value fashion. Unlike the Memory Store Node, data stored with the Persistence Store Node is stored on the disk of the Runtime, and doesn't disappear when the Runtime shuts down.

You should not use the Persistence Store system when the Runtime is to run in a Docker Container.

Using the Persistence Store Node and the Persistence Retrieve Node is a great way to quickly get set up with a primitive persistence layer for your App/API in Sanbox with no configuration - allowing you to forgo the trouble of setting up a database to store your data.

Internally, the Persistence Store system uses a SQLite database. The database is stored in a file persistenceStore.db located in the Runtime's working directory and can be switched out or deleted (the Runtime must be shut down first). This file is created the first time the store system is used.

Advanced Users: We recommend DB Browser for SQLite to open the persistenceStore.dbfile for browsing and editing.

Performance

The persistence store system should perform well and very quickly for APIs and Web Apps in Sanbox that receive less than 100k hits/day. That is to say - most web applications in the world. However, this is a very conservative estimate, and varies greatly with factors such as server hardware and use of the system. Writes have more of a performance penalty than reads with this system.

Configuration

Configuring Persistence Store Node

Category: A string value indicating the category of the store.

Key: A string value indicating the id of the store. When you recall the store with the Persistence Retrieve Node, you use the key / category configured to get the value you stored.‌

Value: The data you wish to store. You can store nothing, which effectively clears any persistence store under the configured Key.

If you store raw bytes as a value, the Runtime will optimize storage for bytes. Otherwise, your data is stored as a JSON string.