Which will be the best design of an online folder system?
Use case is like this.
User can upload a folder(.zip as folder upload is not supported). Then he can add more files/folder or remove some files/folder.
Will it be a good design if i do this by copying directly to the server file system(am concerned of possible perfomance issue, though this approach is the simplest one).
Or should i save the files into the DB?
If DB is the case, which is the best design for this?
Note im using mysql, servlets and glass fish for the development
If the files are not sensitive and the disk space is not an issue the file system is better option than DB.
Regarding the performance, you got it exactly opposite. Just think about having to turn your your file contents to byte array and passing it through the network to the DB and have the DB handle it, and every time you want to just read it, it has to be done all the way from DB and then everything has to be loaded into memory, specially if you have to deal with a lot of large files, it might turn into a memory issue.
Other problem with choosing DB over file system is that you have to make your application do what the file system would do for you. e.g. duplicate folder names within a folder, duplicate file names within a folder, which file belong to which folder, …
If had the option to choose file system over DB then I would certainly do it.