Downloaded files - database and file system when using Grails and MySQL

I know this is a bit of a “classic question”, but does mysql / grails (deployed on Tomcat) use a new approach to considering how to approach the storage of user-uploaded files.

I like to use the database for everything (simpler architecture, scaling is just scaling the database). But using the file system means that we do not store mysql with binary files. Some may also claim that apache (httpd) is faster than Tomcat for serving binary files, although I have seen numbers that actually show that just Tomcat on the front of your site can be faster than using the apache proxy (httpd).

How to choose where to place the files uploaded by the user?

Thank you for your attention, time and thoughts.

+3
source share
4 answers

I don’t know if it’s possible to make general comments about such a solution, since it really depends on what you are trying to do and how high priority NFR lists such as performance and response time apply to your application.

If you have many users downloading a large number of binary files with a system serving a large number of downloaded binary files, then you have a situation where the cost of storing files in a database includes:

  • Large Binary Files
  • Costly Inquiries

Benefits

  • Atomic fixation
  • ( w MySQL ..)
  • ..

, ,

  • ( ..)
  • ( , )
  • apache,

Grails, . , , , , (, , , ).

→ . (, , GSP ). Apache , . , , , , .

, , , , , .

, , . , , . , , yyyy/MM/dd/image.name.jpg, .

, , , , , BLOB, .

+5

: JCR ( Jackrabbit) - Java. . Grails , Jackrabbit API.

+3

, , , - , . , , , , . , , - , NFS.

0

, , , URL- ( ). , , , apache ( ). su root, . . , , , , , ? Spring ACL? ? url. - (chmod ), - ProcessBuilder ( ?). ?

0
source

Source: https://habr.com/ru/post/1702417/


All Articles