DB Schema
Key Design Decisions
IDs
All entities use MongoDB ObjectId (auto-generated, stored as String via @db.ObjectId).
Soft Deletes
All user-facing models carry deletedAt DateTime?. Active records have deletedAt IS NULL. This enables undo/recovery and audit trails without permanent data loss.
Asset Folder Integration
Video, Audio, LabelTrack, and TextTrack each have:
| Field | Description |
|---|---|
folderId | → Node.id (null = project root level) |
filename | Basename only (e.g. "run01.mp4") |
name | Full path (e.g. "/camera/front/run01.mp4") — kept for backward compatibility |
On asset creation, the server parses name into folder path + filename, auto-creates the folder hierarchy via ensureFolderHierarchy, and sets both folderId and filename.
Track Scoping
Tracks can be episode-scoped (raw recorded data) or space-scoped (generated/processed).
Track.episodeId = null→ space-level trackTrack.episodeId = "..."→ episode-scoped track- S3 paths differ accordingly: space-root-relative vs. under
episodes/{id}/
Track Chunk Manifest
Each track stores its chunks as Json on the record itself (no satellite chunk table):
[
{ "path": "00001", "src": "abc123def456" },
{ "path": "00002", "src": "789abc012def" }
]| Key | Description |
|---|---|
path | Local sequential key (ordering/identity) |
src | Content-addressed blob reference (S3 key) |
Parameters
Flat key-value store with dot-separated keys. Nested dicts are flattened:
{ "model": { "lr": 0.001 } } → { "model.lr": 0.001 }Each write is journaled as a ParameterEntry for audit trail. The data field on Parameters holds the current merged snapshot.
Storage Layer
All binary storage is delegated to BSS (Big Streaming Server). DreamLake Server is purely a metadata index — it does not manage S3 credentials, buckets, or storage backends. When multi-backend support is needed (S3, GCS, OSS), it will be implemented in BSS via a StorageAdapter interface.