{"id":170,"date":"2009-10-08T17:50:17","date_gmt":"2009-10-09T00:50:17","guid":{"rendered":"http:\/\/www.jacksonleung.com\/blog\/?p=170"},"modified":"2009-10-12T10:49:00","modified_gmt":"2009-10-12T17:49:00","slug":"handling-file-storage","status":"publish","type":"post","link":"http:\/\/www.jacksonleung.com\/blog\/handling-file-storage\/","title":{"rendered":"Handling File Storage"},"content":{"rendered":"<p>When you&#8217;re writing a massive application, if given a choice to use a file manager to manage files or to allow the application to manage the files on its own, it&#8217;s much preferable that allow the application to handle the file placement logic. This way, the application&#8217;s database can be put in charge of maintaining the file locations ensuring that there are no conflicts and that there is a centralized location to find everything. When an application is maintaining the files, there isn&#8217;t even a need for a descriptive name to a file, since all relevance will be maintained by the database. Since you&#8217;re only interacting with the files through the application, the application can ensure that the file exists, the file won&#8217;t be overwritten, and upon deletion, there are no dependencies on this file.<\/p>\n<p>In the case of major applications, where it&#8217;s possible for many components to have access to the same files, I recommend that all these interactions be performed through a centralized file management core. This way, if we were to change the file management logic, it can be easily performed at a single location.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;re writing a massive application, if given a choice to use a file manager to manage files or to allow the application to manage the files on its own, it&#8217;s much preferable that allow the application to handle the file placement logic. This way, the application&#8217;s database can be put in charge of maintaining &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.jacksonleung.com\/blog\/handling-file-storage\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Handling File Storage&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-programming","entry"],"_links":{"self":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":7,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":177,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/170\/revisions\/177"}],"wp:attachment":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}