
Summary
Key points of this document
- Where are the design challenges?
- How to define the boundaries
- Details that matter in implementation
Overview
Developing file upload functionality using only local disks can lead to issues with permissions and URL differences when migrating to production S3 or GCS. An environment that allows verifying S3-compatible behavior locally is useful. The value of incorporating MinIO is not just running an S3-compatible API locally, but being able to reproduce file processing failures during development.
Where are the design challenges?
If you use local file storage in the development environment and only S3-compatible storage in production, differences in URL generation, permissions, MIME types, and deletion processes will emerge later. Signed URLs, in particular, are a feature you'll want to verify in an environment close to production.
If all developers directly use production cloud storage, there will be issues with costs, permissions, and accidental deletions. While reproducing similar behavior locally, production-specific IAM and lifecycle settings must be verified separately.
If you use S3-compatible storage in production but save to the file system locally, the behavior of signed URLs, permissions, object keys, and deletions will not be visible during development. This discrepancy will become a problem just before production.
How to define the boundaries
Integrate MinIO into Docker Compose and connect from the application as an S3-compatible API. For storage abstraction, use the same code path as production, only switching environment variables.
In the design, both local and production environments will use the same storage interface, only changing the driver. By integrating MinIO into Docker Compose and initializing bucket creation and test users, developers can verify using the same procedure.
Details that matter in implementation
Automate bucket creation on local startup and restrict access keys to development use. In the application, do not directly save public URLs; instead, save object keys. When previewing, follow the flow of issuing signed URLs even locally.
On the Laravel or Node.js side, switch the S3 client's endpoint, region, and forcePathStyle using environment variables. In tests, create actual objects on MinIO and verify uploads, retrievals, deletions, and signed URL expirations.
- Name buckets and prefixes similarly to production and separate them by purpose.
- Automate bucket creation on local startup to avoid manual dependencies.
- Save
storage_keyto the DB instead of the filename, and treat the original filename as metadata.
Observe how it breaks
During verification, check uploads, downloads, expired URLs, deletions, non-existent files, and invalid MIME types. If MinIO can be started in CI, integration tests for file processing can also be automated.
During verification, reproduce MinIO stoppage, uncreated buckets, incorrect credentials, size overruns, and references to deleted files. Seeing these locally makes it easier to handle failures around production storage.
Discarded options and trade-offs
MinIO is S3-compatible but not cloud storage itself. IAM, regions, lifecycles, and CDN integration must be verified separately in a production-equivalent environment. Nevertheless, its effect of reducing discrepancies in daily development is significant.
Adding MinIO increases the number of containers in the development environment, but it reduces the differences with production. For small features, you can start with local file storage, but if you handle signed URLs or private files, it's safer to set it up early.
Decision criteria to leave for the team
It's dangerous to verify file functionality for the first time only in production. By incorporating MinIO locally and using the same storage abstraction as production, you can find upload-related bugs earlier.
The later storage discrepancies between local and production are found, the more expensive they become. Creating an environment with MinIO that can reproduce failure patterns stabilizes the quality of file functionality.


