Skip to main content

Event Storage & Retention

The Hub persists only finalized outgoing events — the same events exposed externally by the GraphQL API. Raw or intermediate internal events from Face Matcher, CIGS, CBS, or MCT are never stored. Persistence is handled by the DbWorker Service, a background service with no external interface.

What is stored​

TableWritten onContents
identification_eventsidentification.* topicsResult, clearance, member context snapshot, face crop, full frame
identitiesidentity.created, identity.updatedIdentity ID, first/last seen, linked identification if available
identity_facesidentity.updatedIndividual face detection associated with an identity
zone_eventszone.* topicsEvent type, unit, person count, occupancy context, timestamp

Face crops and full frames go to the image store configured in .env.hub — the shared S3 bucket on SeaweedFS in the default stack. Face Matcher management entities (cameras, watchlists, members) are never stored locally — they are proxied from Face Matcher on demand. Face Matcher keeps its own, separately configured history of detections and identifications; see Data Retention on the Face Matcher side.

Retention modes​

Storage behavior is configured per deployment:

ModeBehaviour
STORAGE_ENABLED=falseNo data written at all — recommended for GDPR-sensitive deployments where event data must not be stored at rest
STORAGE_ENABLED=trueEvents and images persisted; a scheduled retention job removes expired records

Retention periods apply independently per data type and are configurable: event records (identification, identity, zone) default to 48 hours, image data (face crops, full frames) to 24 hours.

STORAGE_ENABLED=true
RETENTION_TTL_EVENTS_HOURS=48
RETENTION_TTL_IMAGES_HOURS=24
RETENTION_JOB_INTERVAL_MINUTES=30

Querying​

Stored events are queryable through the GraphQL API by event type, time range, unit ID, correlation ID, and source system — paginated, in chronological order. This short rolling window serves audit, retrieval, and GUI state-restore needs without long-term data accumulation.