> ## Documentation Index
> Fetch the complete documentation index at: https://powersync-storage-v4-ga.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage Version 4 with Sync Rules

> What storage version 4 and S3 object storage mean for instances that still use Sync Rules.

<Info>
  Sync Rules are deprecated. For the Sync Streams version of this page, see [Storage Version 4](/sync/advanced/storage-version-4).
</Info>

Storage version 4 is the format the PowerSync Service uses to store the data it syncs to clients. It is the default for MongoDB bucket storage since PowerSync Service v1.27.0.

With Sync Rules, storage version 4 provides:

* Faster sync and faster reprocessing after a deployment.
* [S3 object storage](/sync/advanced/storage-version-4#s3-object-storage): larger blocks of synced data move from the storage database to S3. This reduces load on the storage database when many clients sync at once or sync large amounts of data. On PowerSync Cloud, PowerSync enables it per instance on request, and plans to enable it on all instances automatically. Self-hosted instances follow the [S3 setup instructions](/sync/advanced/storage-version-4#self-hosted-s3-setup).

[Incremental reprocessing](/sync/advanced/storage-version-4#incremental-reprocessing) requires Sync Streams. With Sync Rules, every deployment still reprocesses all data, and clients download all their data again. To use incremental reprocessing, [migrate to Sync Streams](/sync/rules/migrate-to-sync-streams).

<span id="opt-in" />

## Switching Storage Versions

Since PowerSync Service v1.27.0, MongoDB bucket storage defaults to version 4. If `config.storage_version` is unset, the Service uses its default the next time you deploy your Sync Rules. Upgrading the Service alone does not change the storage version of existing Sync Rules. Like any other Sync Rules deployment, this reprocesses all data in the background.

Self-hosted instances must use MongoDB [bucket storage](/architecture/powersync-service#bucket-storage). Postgres bucket storage is not supported with version 4, so instances with Postgres bucket storage stay on version 2.

To use a different version, set `storage_version` in the `config` block and deploy. For example, to stay on version 2:

```yaml theme={null}
config:
  storage_version: 2

bucket_definitions:
  user_lists:
    parameters: SELECT request.user_id() AS user_id
    data:
      - SELECT * FROM lists WHERE owner_id = bucket.user_id
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.