S3 & Cloud Storage
Supported Providers
| Provider | Config Key | Features |
|---|---|---|
| AWS S3 | s3 | Backups, exports, file storage |
| Google Cloud Storage | gcs | Backups, exports |
| Azure Blob Storage | azure | Backups, exports |
| MinIO | s3 (compatible) | Self-hosted S3 alternative |
AWS S3 Configuration
# nexusdb.yaml
storage:
provider: s3
bucket: my-nexusdb-backups
region: eu-central-1
prefix: production/
credentials:
access_key_id: ${AWS_ACCESS_KEY_ID}
secret_access_key: ${AWS_SECRET_ACCESS_KEY}Automated Backups to S3
nexusdb backup create \
--destination s3://my-nexusdb-backups/daily/ \
--compress zstd \
--encrypt aes-256File Attachments
Store binary files (images, PDFs, documents) in cloud storage:
const file = await db.files.upload({
collection: "documents",
documentId: "doc_abc123",
field: "attachment",
file: readableStream,
contentType: "application/pdf",
metadata: { originalName: "report.pdf" }
});
console.log(file.url);
// https://my-bucket.s3.amazonaws.com/documents/doc_abc123/report.pdfData Export
# Export a collection to S3 as JSON
nexusdb export \
--collection orders \
--format json \
--destination s3://my-exports/orders-2024.json
# Export as CSV
nexusdb export \
--collection orders \
--format csv \
--fields id,customer,total,status \
--destination s3://my-exports/orders-2024.csvMinIO (Self-Hosted)
storage:
provider: s3
endpoint: http://minio.internal:9000
bucket: nexusdb-backups
force_path_style: true
credentials:
access_key_id: minioadmin
secret_access_key: minioadmin