See it in action on the hev-shop demo store.

Overview

Document model

Layer reserves the _hevlayer_* attribute prefix for its own bookkeeping. The gateway manages these attributes: your writes and UDF completion patches must not set them, and editing them directly breaks Layer’s guarantees.

AttributeTypePurpose
_hevlayer_upserted_atinteger (epoch ms)Server-stamped on every write. The gateway filters queries to _hevlayer_upserted_at <= watermark to hold the read-consistency cut while the upstream index catches up.
_hevlayer_shardintegerHash bucket assigned at write time (xxh64(id) % shard_count), present only on sharded namespaces. Lets the gateway scatter/gather a query across the shards of one namespace.
_hevlayer_udf_<id>_vstringFunction completion marker. The gateway stamps the Function’s spec.version here when a worker completes a row. Hyphens in the Function id are normalized to underscores.
_hevlayer_udf_<id>_stale_afterinteger or nullFunction invalidation marker. Discovery reclaims rows once this epoch-ms timestamp expires; completion clears the marker.

The _hevlayer_ prefix also namespaces internal cache sets (snapshot field-values and search-history clickstream), but those are cache keys, not part of your document schema.

esc