I have a web application that stores a lot of user generated files. Currently these are all stored on the server filesystem, which has several downsides for me.
So, my main questions are
Database provides a proper data recovery process while file system did not. In terms of security the database is more secure then the file system (usually).
A NoSQL document store does as the name suggests and stores documents in one or other format. Examples include Apache CouchDB and Couchbase Server, which store JSON documents, and MongoDB, which stores JSON-like documents.
Data sharing: The file system does not allow sharing of data or sharing is too complex. Whereas in DBMS, data can be shared easily due to a centralized system. Data concurrency: Concurrent access to data means more than one user is accessing the same data at the same time.
The main differences between the Database and File System storage is: The database is a software application used to insert, update and delete data while the file system is a software used to add, update and delete files.
When handling small data sets with arbitrary, probably unrelated data, file is more efficient than database. For simple operations, read, write, file operations are faster and simple. You can find n number of difference over internet. The only difference between database and file system is that the way and structure in which the data is stored.
That said, a database can represent its data on the filesystem however it likes in however many files it sees fit to use. The syscalls are generally on the level of open/read from/write to/close/memory-map/etc. a given file; the database program can do whatever it likes with that set of operations.
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. In a files ystem, accessing a file is quite simple and light weight.
Not a direct answer but some pointers to very interesting and somehow similar questions (yeah, they are about blobs and images but this is IMO comparable).
What are the downsides of storing files as BLOBs in MySQL?
Do the same problems exist with NoSQL systems like Cassandra?
PS: I don't want to be the killjoy but I don't think that any NoSQL solution is going to solve your problem (NoSQL is just irrelevant for most businesses).
maybe a hybrid solution.
Use a database to store metadata about each file - and use the file system to actually store the file.
any restructuring of 'folders' could be modelled in the DB and dereferenced from the actual OS location.
You can store files up to 2GB easily in Cassandra by splitting them into 1MB columns or so. This is pretty common.
You could store it as one big column too, but then you'd have to read the whole thing into memory when accessing it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With