To understand the terminology used on this page, it might be helpful to read through the architecture reference.
Overview
A Restate cluster maintains three essential types of state:- Metadata: cluster membership as well as log and partition configuration
- Logs: The Bifrost log disseminates all events and state changes to partition workers
- Partition store: Stores ongoing invocations and their journals, persisted state, timers, deployments and more, for each partition
Snapshots
Internal mechanism for cluster operations and state sharing between nodes:- Goal: Enable fast bootstrap of new nodes and support log trimming in clusters
- Scope: A snapshot of the most recent state of a specific partition, produced by a fully caught up partition processor
- When: Essential for multi-node clusters; optional for single-node deployments
Data Backups
Full copies of all data stored by Restate for disaster recovery:- Goal: Restore a Restate Server to a previous point in time
- Scope: Complete copy of the
restate-datadirectory or storage volumes - When: Currently only for single-node deployments due to timing coordination challenges
Multi-node backup challenges
Multi-node backup challenges
Coordinating simultaneous backups across multiple nodes presents significant timing precision requirements. Even millisecond differences in backup timing can result in one node capturing state that’s progressed further than another, creating inconsistent snapshots across the cluster. This timing skew leads to data inconsistencies that prevent successful cluster restoration from backup.While atomically snapshotting restate-data at the volume level is still very useful as part of a broader disaster recovery and backup strategy, some manual repair work may be required to restore from such backups. There will also be some expected data loss between the latest LSN/point in time captured by the snapshot and the latest accepted/processed transaction by the cluster before it lost availability.Since tooling for automated cluster restoration is not yet available, cluster-wide full node snapshots would currently require manual intervention to repair the system back into a workable state.
When to Use Each
Use Snapshots When:
- Operating a multi-node cluster (required)
- Adding or removing nodes from a cluster
- Enabling log trimming to manage storage
- Supporting fast partition processor failover (having warm standbys ready for near-instant takeover)
- Growing the cluster or replacing completely failed nodes (newly added nodes can bootstrap from snapshots)
Use Backups When:
- Doing point-in-time recovery of a single-node deployment
Snapshots
Snapshots are essential for multi-node cluster operations, enabling efficient state sharing and log management. Snapshots are essential to support safe log trimming and fast partition fail-over to a different cluster node. Snapshots are optional for single-node deployments and required for multi-node clusters. Restate Partition Processors can be configured to periodically publish snapshots of their partition state to a shared object store. Snapshots serve to allow nodes that do not have an up-to-date local copy of a partition’s state to quickly start a processor for the given partition. Without snapshots, trimming the log could lead to data loss if all the nodes replicating a particular partition are lost. Additionally, starting new partition processors would require the full replay of that partition’s log which might take a long time. When partition processors successfully publish a snapshot, this is reflected in the archived log sequence number (LSN). This value is the safe point up to which Restate can trim the Bifrost log.Configuring Automatic Snapshotting
Restate clusters should always be configured with a snapshot repository to allow nodes to efficiently share partition state, and for new nodes to be added to the cluster in the future. Restate supports Amazon S3 (or S3-compatible stores), Google Cloud Storage, and Azure Blob Storage as shared snapshot repositories. To set up a snapshot destination, update your server configuration as follows:snapshot-intervalalone triggers time-based snapshots unconditionallysnapshot-interval-num-recordsalone triggers snapshots based on record count only
restatectl:
latest.json file pointing to the most recent snapshot.
No additional configuration is required to enable restoring snapshots.
When partition processors first start up, and no local partition state is found, the processor will attempt to restore the latest snapshot from the repository.
This allows for efficient bootstrapping of additional partition workers.
For local development without cloud access, you can use emulators like Azurite for Azure or fake-gcs-server for GCS. See the Minio example below for S3-compatible local development.
Object Store endpoint and access credentials
Restate supports Amazon S3 (and S3-compatible stores), Google Cloud Storage, and Azure Blob Storage. Object store locations are specified as a URL where the scheme indicates the provider and the authority is the bucket name:| Provider | URL Scheme | Example |
|---|---|---|
| Amazon S3 | s3:// | s3://bucket/prefix |
| Google Cloud Storage | gs:// | gs://bucket/prefix |
| Azure Blob Storage | az:// | az://container/prefix |
- Amazon S3: Uses AWS SDK credential discovery. For S3-compatible stores, override the endpoint with
aws-endpoint-url. - Google Cloud Storage: Uses Application Default Credentials. Set
GOOGLE_SERVICE_ACCOUNT_PATHto use a specific service account JSON file. - Azure Blob Storage: Uses the Azure credential chain. Set
AZURE_STORAGE_ACCOUNT_NAMEandAZURE_STORAGE_ACCESS_KEYfor explicit credentials.
Local development with Minio
Minio is a common target while developing locally. You can configure it as follows:Local development with S3
Assuming you have a profile set up to assume a specific role granted access to your bucket, you can work with S3 directly using a configuration like:~/.aws/config you have a profile similar to:
Log Trimming and Durability
In a distributed environment, the Bifrost log is the mechanism for replicating partition state among nodes. Partition processors apply records from Bifrost to build and maintain their local partition store (a materialized view of the partition state in RocksDB). This partition store enables fast reads and efficient processing, but it’s derived from the log and can always be rebuilt by replaying log records. The challenge is that all cluster members need access to the relevant log records, including newly added nodes that will join the cluster in the future. This requirement is at odds with an immutable log growing unboundedly. Log trimming is the process of removing older segments of the log that are no longer needed.Why Snapshots Matter for Log Trimming
When the log is trimmed, any partition processor that hasn’t yet applied those records loses the ability to catch up by replaying the log. Instead, it must:- Fetch a snapshot from the object store that covers the trimmed records
- Replay only the remaining log records after the snapshot’s LSN
Understanding Durability Modes
The durability mode defines the criteria that tell Restate when the partition store’s state has been durably persisted elsewhere, making it safe to trim the corresponding log records. In other words, it controls when Restate considers the materialized view “backed up” enough that the original log records can be discarded.Available durability modes
Available durability modes
| Mode | Description |
|---|---|
balanced | Partition store is durable when covered by a snapshot and at least one replica has flushed to local storage. This is the default when a snapshot repository is configured. |
snapshot-only | Partition store is durable only after a snapshot has been created, regardless of local replica state. |
snapshot-and-replica-set | Partition store is durable when all replicas have flushed locally and a snapshot exists. |
replica-set-only | Partition store is durable when all replicas have flushed locally, regardless of snapshot state. This is the default when no snapshot repository is configured. Often used in Single-node setups or for testing. |
none | Disables automatic durability tracking and trimming entirely. |
Delayed Log Trimming
In some scenarios, you may want to delay log trimming even after the durability condition is met. This is particularly useful for geo-replicated deployments where snapshots need time to replicate across regions (e.g., S3 Cross-Region Replication).How Trimming Works
Each partition leader runs a durability tracker that monitors:- Durable LSN: The log position that has been flushed to local storage on each replica (partition store flush)
- Archived LSN: The log position of the latest published snapshot in the object store (or the oldest retained snapshot if
worker.snapshots.experimental-num-retainedis configured)
- The partition reports its durability point
- If
trim-delay-intervalis configured, the actual trim is delayed by that duration - Log records up to the durability point are trimmed
If you observe repeated
Shutting partition processor down because it encountered a trim gap in the log. errors in the Restate server log, it indicates that a processor cannot start because log records it needs have been trimmed. This happens when the processor’s local partition store is behind the log’s trim point and no snapshot is available to bridge the gap.To recover, ensure a snapshot repository is correctly configured and accessible from the node reporting errors. You can still recover even if no snapshots were taken previously, as long as there is at least one healthy node with a copy of the partition data. In that case, first configure the existing node(s) to publish snapshots for the affected partition(s) to a shared destination. See the Handling missing snapshots section for detailed recovery steps.Observing processor persisted state
You can userestatectl to see the progress of partition processors with the list subcommand:
restatectl’s partition list output:
- Applied LSN - the latest log record record applied by this processor
- Durable LSN - the log position of the latest partition store flushed to local node storage; by default processors optimize performance by relying on Bifrost for durability and only periodically flush partition store to disk
- Archived LSN - if a snapshot repository is configured, this LSN represents the latest published snapshot (or the oldest retained snapshot if
worker.snapshots.experimental-num-retainedis configured); this determines the log safe trim point in multi-node clusters
Snapshot retention
By default, Restate adds new snapshots without removing old ones. You can configure automatic pruning using the experimentalexperimental-num-retained option:
This feature is only available in Restate v1.6 and newer. Only newly uploaded snapshots after the experimental feature was activated will be pruned. Existing snapshots predating the configuration change will not be affected.
Data Backups
Data backups are primarily used for single-node Restate deployments.What does a backup contain?
The Restate server persists both metadata (such as the details of deployed services, in-flight invocations) and data (e.g., virtual object and workflow state keys) in its data store, which is located in its base directory (by default, therestate-data path relative to the startup working directory). Restate is configured to perform write-ahead logging with fsync enabled to ensure that effects are fully persisted before being acknowledged to participating services.
Backing up the full contents of the Restate base directory will ensure that you can recover this state in the event of a server failure. We recommend placing the data directory on fast block storage that supports atomic snapshots, such as Amazon EBS volume snapshots. Alternatively, you can stop the restate-server process, archive the base directory contents, and then restart the process. This ensures that the backup contains an atomic view of the persisted state.
In addition to the data store, you should also make sure you have a back up of the effective Restate server configuration. Be aware that this may be spread across command line arguments, environment variables, and the server configuration file.
Restoring Backups
To restore from backup, ensure the following:- Use a Restate server release that is compatible with the version that produced the data store snapshot. See the Upgrading section.
- Use an equivalent Restate server configuration. In particular, ensure that the
cluster-nameandnode-nameattributes match those of the previous Restate server operating on this data store. - Exclusive access to a data store restored from the most recent atomic snapshot of the previous Restate installation.