Skip to main content
A workspace needs no services. A workspace you build in code keeps its state in memory. A workspace the server builds keeps it on disk under ~/.mirage/state. Each store below can move onto infrastructure you run, on its own or together with the others.

Workspace state

Mirage creates this data, so none of your mounts, such as S3 or GitHub, has a copy. The store key sets where Mirage saves it. To see command logs from many machines in one place, send them to an OpenTelemetry backend as traces.

Caches

Copies of files and listings Mirage read from your mounts, kept to make the next read faster. If a cache is lost, the next read is just slower. The cache and index keys sit next to store, not inside it. A mount can also set its own index, which replaces the workspace’s for that mount.

What each backend gives you

Every store keeps its state by workspace_id. Give the workspace a fixed id whenever its state should be found again, after a restart or by another process. In Python and TypeScript, SqlWorkspaceStateStore keeps the namespace, sessions and jobs in SQLite or Postgres, so every process on the database shares them. Command logs stay in each process’s memory. YAML has no sql type.

One store or several

store.type sets one backend for all four stores. This config keeps the workspace state on Redis. Redis holds no command logs, so they go to disk under root, ~/.mirage/state by default.
workspace.yaml
To move one store to a backend of its own, add its key under store: namespace, sessions, logs for command logs or execution for jobs. Here the command logs go to a disk path you choose:
workspace.yaml
Closing the workspace closes a store it owns, the stores under its keys included. stores.py and stores.ts place one store at a time on disk, build the workspace again and print what came back.

Where you set it

One config describes a workspace, the same YAML on every surface. Python and TypeScript also take each store as a constructor argument, as each store’s page shows.