zat.dev/zds
atproto pds · mirror of https://tangled.org/zat.dev/zds
zds 0.25.1 Latest 2 packages, all images
0
0
# Record size enforcement
ZDS limits public repository records to 1,000,000 DAG-CBOR bytes, inclusive.
The check applies to createRecord, putRecord, and each create/update in
applyWrites, including validate=false. Oversized writes return HTTP 400
InvalidRequest before storing blocks, changing the repository, or publishing
an event. A batch containing an oversized record is rejected atomically.
Import checks MST-referenced record blocks before replacing the repository;
unreferenced CAR blocks are not treated as records. Existing records can still
be read and deleted.
The [sync specification](https://atproto.com/specs/sync#commit-events) sets
one million bytes per record block. Its two-million-byte CAR limit is a
separate aggregate limit. The informal guide's 1 MiB recommendation and the
HTTP request-body cap do not override the encoded record limit. The limit
does not alter batch-to-sync behavior or relay reconnect policy.
## commit limits
A write's `#commit` event can carry at most 200 ops and 2,000,000 bytes of
blocks, the limits the
[subscribeRepos lexicon](https://github.com/bluesky-social/atproto/blob/main/lexicons/com/atproto/sync/subscribeRepos.json)
puts on `ops` and `blocks`; relays drop larger frames. ZDS refuses an
applyWrites with more than 200 writes, and any createRecord, putRecord or
applyWrites whose event CAR (commit, record and changed MST blocks) would
exceed 2,000,000 bytes, with HTTP 400 InvalidRequest and the reference PDS's
messages, "Too many writes. Max: 200" and "Too many writes. Max event size:
2MB". The check runs before anything is stored. The reference measures the
sum of block bytes; ZDS measures the CAR itself, the field the lexicon limits,
which adds a few dozen bytes per block. importRepo is not limited this way.
The reference comparison and verification from when the limit was added are
in [history](https://tangled.org/zat.dev/zds/blob/main/docs/history/record-size-limits-2026-10.md).