> ## Documentation Index
> Fetch the complete documentation index at: https://syncmaven.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# State

In order to implement [Incremental Sync](/fundametal/incremental-sync), Syncmaven need
to persist state between sync runs. State also can be used by connectors internally to
cache some data for optimization purposes.

<Note>
  State is always optional, and syncs can work without it. You can run every sync in a full refresh mode,
  which means state will be ignored. Also, you can not provide state at all.

  The internal structure of state can be found on [Protocol](/fundamentals/protocol) page.
</Note>

Syncmaven provides a several ways to store state

# Local files

By default, Syncmaven stores state in bunch of local files in `<project-dir>/.state` directory. This is convenient
for local debugging.

To change the default location, you can use `--state <dir> ` option with `sync` command.

However, to preserve state between different machines, the other options should be used.

# Postgres

Syncmaven can store state in Postgres database. To enable this, you need to provide a connection string to the database.
Provide the connection string using `--state postgres://<user>:<password>@<host>:<port>/<database>` option with `sync` command.
