Skip to main content

Warning

Work in Progress - This document is currently being updated. Some sections may be incomplete or subject to change.


Storage Providers

SOLID supports multiple storage providers for media files, offering flexibility in how and where your media assets are stored.

Supported Providers

Local Filesystem

  • Description: Store files directly on the server's filesystem
  • Use Case: Development environments, small applications
  • Configuration:
{
"provider": "local",
"config": {
"rootPath": "/path/to/uploads",
"baseUrl": "http://your-domain.com/uploads"
}
}

Amazon S3

  • Description: Store files in Amazon S3 buckets
  • Use Case: Production environments, scalable applications
  • Configuration:
{
"provider": "s3",
"config": {
"accessKeyId": "YOUR_ACCESS_KEY",
"secretAccessKey": "YOUR_SECRET_KEY",
"region": "us-west-2",
"bucket": "your-bucket-name",
"baseUrl": "https://your-bucket.s3.amazonaws.com"
}
}

Upcoming Providers

  • Azure Blob Storage
  • Google Cloud Storage
  • SFTP
  • Custom providers

Provider Features

Common Features

  • File upload/download
  • Directory operations
  • Access control
  • Metadata management

Provider-Specific Features

Local Filesystem

  • Direct file access
  • System-level permissions
  • Local caching
  • Path customization

Amazon S3

  • Bucket policies
  • CloudFront integration
  • Lifecycle rules
  • Versioning
  • Cross-region replication

Configuration

Global Settings

{
"defaultProvider": "s3",
"uploadLimits": {
"maxFileSize": "100MB",
"allowedTypes": ["image/*", "application/pdf"]
},
"imageProcessing": {
"thumbnails": true,
"maxWidth": 2000,
"maxHeight": 2000
}
}

Provider Selection

Files can be routed to different providers based on:

  • File type
  • File size
  • User role
  • Custom rules

Implementation Guide

Adding a New Provider

  1. Install Dependencies
npm install @solid/storage-provider-name
  1. Configure Provider
{
"providers": {
"custom-provider": {
"implementation": "@solid/storage-provider-name",
"config": {
// Provider-specific configuration
}
}
}
}

3 Set Up Permissions

  • Configure access credentials
  • Set up network access
  • Define security policies

4 Test Configuration

  • Upload test file
  • Verify access
  • Check permissions
  • Validate features

Migration Between Providers

1 Preparation

  • Inventory existing files
  • Plan migration schedule
  • Test migration process
  • Prepare rollback plan

2 Execution

  • Copy files to new provider
  • Verify file integrity
  • Update references
  • Switch provider settings

3 Verification

  • Test file access
  • Verify permissions
  • Check performance
  • Monitor errors

Best Practices

Provider Selection

  • Consider scalability needs
  • Evaluate cost implications
  • Assess performance requirements
  • Plan for redundancy

Security

  • Use secure credentials
  • Implement proper ACLs
  • Enable encryption
  • Regular security audits

Performance

  • Configure caching
  • Optimize file sizes
  • Use CDN when possible
  • Monitor usage patterns

Maintenance

  • Regular backups
  • Monitor storage usage
  • Clean up unused files
  • Update configurations