Skip to main content
All posts
engineering
storage
platform

Push Twice, Store Once

Swale Team

Swale repositories hold the heavy inputs and outputs of your workflows — datasets, models, results. Which means swale push is often moving a lot of bytes. Here is what actually happens when it does, and why pushing the same data twice costs you almost nothing.

Files become chunks

On push, the CLI splits every file into small chunks. The split points are derived from the content itself, not from fixed offsets — so a chunk boundary lands in the same place even when the data around it moves. Insert a row in the middle of a large file and only the chunks around the edit change; everything after it still lines up.

Each chunk is hashed, and the hash becomes its identity.

The server is asked before anything is sent

Before uploading, the CLI asks the platform what the account already stores. It sends a sample of the chunk hashes in batches, and the platform points it at the stored content they match. Only data it cannot match to stored content is compressed and uploaded. Push the same dataset twice and the second push transfers next to nothing — the CLI confirms the content exists and moves on.

The same applies to the edited-file case above: a push after a small change uploads the handful of new chunks, not the file.

Tags are references, not copies

A tag — a named snapshot your workflows pull by name — stores no file data at all. It is a manifest: filenames pointing at chunk hashes. Ten tags of a repository that shares most of its content are ten small manifests referencing one set of chunks, stored once. Creating a tag from an existing tag copies references, not bytes.

Deletion respects the sharing: removing a tag only deletes chunks that no other tag still references, reclaimed shortly after during scheduled cleanup.

This is also why history is cheap on the bill. Storage is metered on the bytes your account actually holds — not on the number of tags you keep.

Pull only fetches what you’re missing

The CLI keeps a local chunk cache. On pull, chunks you already have are read from disk; only the rest are downloaded. An interrupted pull resumes where it stopped — the cache survives across runs — and every chunk’s hash is its integrity check.

Why it matters

The point of all of this is that you should never ration snapshots or dread a re-push. Version your datasets as often as your experiments change them; push each run’s results under a tag of its own so they stay reproducible. The storage layer is built so that the honest workflow — push everything, tag everything — is also the cheap one.

Details on repositories, tags, and the deletion lifecycle live in the storage documentation.

When your workflows need more — start with the getting-started guide or create an account.

Back to all posts