Documents, Notifications & Support
3. Storage Backends: Local and S3
Document bytes are not written by the controller directly; they pass through a storage abstraction in the pkg/storage/ package. This package supports two concrete backends: the local filesystem and S3 object storage. The abstraction means the rest of the application treats document storage uniformly regardless of where the bytes physically reside.
The two backends suit different deployment shapes. The local filesystem backend fits a single self-contained installation where files live on the same host as the binary. The S3 backend fits deployments that want durable, off-host object storage, or that run where local disk is ephemeral.
How it fits the architecture
- The
document_management_controller.gohandles folder and attachment metadata. - The
pkg/storage/layer handles the physical persistence of file content. - Choosing local versus S3 is a storage-backend decision, not a change to how users interact with documents.
This same storage concept appears elsewhere in the platform: backup destinations also offer local and S3 targets, reflecting a consistent approach to where the product keeps large or binary data. For an operator, the practical consequence is that document handling can scale from a laptop-style single-host install to a cloud deployment backed by object storage, without the Documents module itself needing to change behaviour. The separation of metadata from byte storage is a deliberate design that keeps the module portable across the platform's supported deployment targets.