CMS template data: Database vs file system?
-
25-02-2021 - |
Pregunta
For a PHP CMS (wolfCMS in this case, but I imagine the question is relevant for any PHP CMS), and from a performance and backup point of view, where is better to store template data (layout files)?
In a database entry, or in a .php file in the file system. Or even somewhere else all together?
Solución
In general, databases will win everytime you need to find data in a flexible way. Filesystems will work anytime you need to find something in a fixed way (i.e., a pathname).
Would you be using the analogue of a file name as the index in your database? Or do you need to filter it in various ways based on a number of criteria in order to pick the appropriate template?
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow