0

I've to store a static pdf with an user guide of my application. I'm using Spring boot and Angular 12, what is the best way to store it?

  • Put the file on resource folder of Spring boot?
  • Put the file on asset folder of Angular? (I'm not so skilled in Angular, I don't really know if this is a valid option).
  • Create a brand new table for static file (at the moment only for this one) and put the file on the database?

The file need to be public, the download will not happen often (come on, who read the user manual? :D ), the file will not change often and it can't be stored to some external storage (this would be the best solution but I can't use it).

4
  • 1
    The "best way" depends on your requirements. This question is too broad to be answered, because any of your proposed solutions would work. You will need to analyze the requirements of storing this file, how the user will use it, how often it needs to be updated, and who is authorized to view this information before deciding on the "best" way to store it. Oct 26, 2022 at 15:43
  • I edited the post with more details. Oct 26, 2022 at 15:53
  • Where do you keep other downloadable assets like images or static HTML pages?
    – Doc Brown
    Oct 27, 2022 at 9:41
  • @DocBrown on the frontend Nov 2, 2022 at 15:34

2 Answers 2

2

I would include it in a resource folder and include it in source control - it's a document that explains how your application works, so it makes sense that its version history is maintained along with the source code as well.

As for your concern that a change to only the document would necessitate a CI build... How often does that actually happen? Because, come one, who actually reads the user manual? ;)

0

I personally wouldn't store it with the source code or in a DB. I would put it in a remote file store like AWS S3 or some kind of file server or CDN, and link to it from the web app that way.

Means it can be updated independently of the application code. I wouldn't wanna have to do a new release to prod just to fix a typo in a user guide.

6
  • Yes, I agree that this is absolutely the best choice, but I can't do this. So which is the best option left to me? Oct 26, 2022 at 15:46
  • 1
    I would question why you can't do it. In my opinion none of the other options are good. Putting it with the code means you need to build/deploy every time a change is made, and a PDF does not belong in a relational DB table. Oct 26, 2022 at 15:49
  • Because my client don't have a remote file store and don't want to buy it. I added some details to my question. Oct 26, 2022 at 15:51
  • The OP wrote "resource folder", not "source code folder".
    – Doc Brown
    Oct 27, 2022 at 9:43
  • @DocBrown yes which in a Spring Boot project is under src/main/resources typically. But the actual file path doesn't particularly matter here. I'm saying I wouldn't want to have it in the same repository as the code even. It's a user guide for the application, not related to the underlying code. And it means that any change to the document needs to be checked in and a CI build needs to be run to get the updated document into the production environment. This is undesirable as the document may change independently of the source code. Oct 27, 2022 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.