-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Where to store persistent storage files? #6095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is a difference. The Symfony structure defines But I would not make it an official recommendation either. Storage is better done outside of the application itself. Otherwise, you will face issues as soon as you scale horizontally behind a load-balancer (unless you replicate stored files on all servers, which would probably be even more complex than separating the storage itself from the app). And you would also face issues when using disposable infrastructure, where the server can be replaced entirely with a new one (see Heroku or Platform.sh for instance), as the replacement server would not have the stored files (and you can replicate to a non-existent server) |
If we read this : http://symfony.com/doc/current/quick_tour/the_architecture.html , /var is explicitly designed to hold generated files. Moreover, the possibility to use SQLite, therefore with a local database file, leads to a recurrent case of people asking (understandably) "Where should I put my sqlite file ?", and variations, on Internet. |
@Pazns the discussion about creating the new structure was talking about putting things needing writable permissions in A stock image is a read-only file which is part of the codebase AFAICT, so it does not belong to |
In this case it would be helpful to change the Symfony documentation to explain this better. It would be helpful to write something like "things needing writable permissions" if this is really the philosophy of the Symfony directory structure. |
See #6132 for updating doc in regards to permissions for For eZ Platform we have similar needs as reporter by @JHGitty, and we plan to adopt 3.0 structure later this year so mentioning it:
* In single server mode, we use Flysystem, so won't write to local folder if setup is in cluster mode, however we may still need a public folder in both cases for caching files persisted to NFS/GridFS/.. to allow web server to directly serve the file if already there. |
@andrerom Great idea! I agree with you. The directories |
From my perspective, it sounds clear that I'm with @JHGitty about covering the recommendations of generated, persistent data, both public (e.g. exposed via HTTP) or private (streamed or internal). |
Closing it as fixed by #6136. |
In another issue (sabre-io/Baikal#427) we discussed if there should be an own directory
/data/
for persistent files, which differ from each installation, like a user database.I thought it would be better to add
/var/data/
for such files. But then somebody explained me that/var/
is just for temporary installation-based files like log files, cache files, etc.The Linux Filesystem Hierarchy also use the
/var/
directory only for such temporary installation-based files and not for persistent installation-based files.Currently the file
app/config/parameters.yml
, which differs from each installation, is inapp/config/
and not in something like/var/
or/data/
.I think the Symfony documentation should contain some tips or Best Practices how you should storage persistent installation-based files. The
parameters.yml
file is a good example because it differs from each installation but is not temporary like log files or cache files.The text was updated successfully, but these errors were encountered: