Blob Records
Binary file storage with S3/MinIO integration
Overview
Blob Records store binary data such as images, documents, audio, video, and other files. They integrate with S3-compatible storage (AWS S3, MinIO) for efficient large file handling.
When to Use Blob Records
Use Blob Records for:
- Images and photos
- PDF documents
- Audio and video files
- Any binary data that needs to be stored and retrieved
Use Key-Value Records instead for:
- Text content
- JSON data
- Small metadata
Creating Blob Records
From a File Input
From a Blob Object
Using create()
In Blueprint Pattern
Currently not usable in the blueprint pattern. Must be created and linked separately.
Reading Blob Content
Displaying an Image
Updating Blob Content
Blob updates replace the entire file. There's no partial update mechanism for binary data.
Querying Blob Records
Find All Blobs
Find by Type
Find by Relationship
Common Patterns
Document with Attachments
Profile Picture
File Gallery
File Upload Component
Storage Configuration
Blob Records can be stored in:
- S3/MinIO (recommended for production)
- PostgreSQL (fallback, for small files)
Configure S3 storage via environment variables:
If S3 is not configured, blobs are stored in PostgreSQL. This works for development but is not recommended for production with large files.
Permissions
Blob Records use the same authorization model:
Quota Considerations
Blob record storage counts against storage quotas. Large files can quickly consume available storage.
Best Practices
-
Store metadata separately - Use Key-Value Records for searchable file metadata (name, type, size) and Blob for the actual content
-
Check quota before upload - Prevent failed uploads due to quota limits
-
Clean up object URLs - Call
URL.revokeObjectURL()when done displaying files to prevent memory leaks -
Use appropriate storage - Configure S3 for production deployments with large files
-
Consider file size limits - Set reasonable upload limits in your UI
-
Transfer accountability - For organization files, transfer accountability to the organization for proper quota management
Limitations
- No partial updates - Files must be replaced entirely
- No real-time collaboration - Unlike Long Text Records, blobs don't support OT
- Size limits - Very large files may be impractical depending on storage configuration