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

# Local first

> Why logging never waits for the network, and what happens later in the background.

A log must take seconds, offline or not. So VitaSync writes every entry to the phone first. Later, in the background, it copies the change to your account if cloud backup is on.

```mermaid theme={null}
sequenceDiagram
  actor You
  participant App as VitaSync
  participant Store as Local store
  participant Cloud as Your account
  You->>App: Log sleep, 7.4 h
  App->>Store: Save (instant)
  App-->>You: Done
  Note over App,Cloud: Later, in the background. Only if cloud backup is on.
  App->>Cloud: The fields that changed on this phone
  Cloud-->>App: Received
```

## What that means for you

* **No spinner on save.** Saving never waits for a network call.
* **Offline is normal.** Log for a week on a plane. Changes queue on the phone and go up when you are back online.
* **A failed upload is not a lost entry.** The entry is already on the phone. The upload is retried.

## Only what changed travels

When a day goes up, the phone sends only the fields that changed on this phone, not the whole day. If you logged mood on this phone and steps on another, each phone sends its own field. Your account ends up with both. See [Cloud backup](/how-it-works/cloud-backup).

## Encrypted on the phone

The local store is encrypted. The key is held in the phone's secure hardware and is created on install. Uninstalling destroys the store.

## Insights run here too

Correlations, weekday rhythms and the weekly report are calculated on the phone. No server needs to see your numbers for you to get them.


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