If your application can land you on cloud nine, I mean your application will have a large number of users.This is also confirmed by a Microsoft study on their own Database & File System (MSSQL vs NTFS) which concludes that for files bigger than 264kb, the best approach is storing the files on a File System and not in a Database. If your application is liable to handle Large files of size more than 5MB and the massive number say thousands of file uploads.If the hacker gains access to your application or your application’s OS, there are very big changes he will get access to the database as well. So it is best to avoid saving in fs if you cannot afford to compromise in terms of security. Since your files can be saved in a folder where you should have provided write permissions, it is prone to safety issues and invites troubles like hacking. If we talk about database backup and replication/synchronization when it comes to databases, why shouldn’t we apply the same principles here as well? Not even involving the idea of hacking, the disk (thus the file) can be corrupted, files can be deleted “by mistake”, but this is a loop in the system’s design and not a problem for the Fyle System itself. Consider a scenario if your files are deleted from the location manually or by some hacking dudes, you might not know whether the file exists or not. No ACID (Atomicity, Consistency, Isolation, Durability) operations relational mapping which mean there is no guarantee. Easy to migrate it to Cloud storage like Amazon S3 or CDNs etc in the future.Cost-effective as It is Economical in most of the cases to expand your web server rather than paying for certain Databases.You can just copy and paste the folder to your desired destination while ensuring that write permissions are provided to your destination. Migrating the data is an easy process here.Downloading can be done by addressing an URL with the location of the saved file. Saving the files and downloading them in the file system is much simpler than database since a simple Save as function will help you out.No DB architect in his right mind would put the file blob in the same table with the file’s metadata, however, writing and reading from a database is tributary to SQL queries, which may become intensive over time. While Files system accessing a file is quite simple and lightweight. To justify this, If you store large files in DB then it may slow down the performance because a simple query to retrieve the list of files or filename will also load the file data if you used Select * in your query. Performance can be better than doing it in DB.The purpose of this research, as described in the title, comparing the idea of storing files using either a Database or the mere FileSystem of the operating system by studying the experience of other people’s or companies’ and learning as much as possible from their experience.Īlmost all analyses and discussions present on different speciality websites, as well as dedicated database companies, present almost the same answer, and the same principles in storing uploaded files.īut before that, let’s see some pros and cons for using each type of file storage (also, with additional comments, explaining or negating some of the affirmations): Pros of the File system:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |