I'm writing a code for a web application that has an option for uploading pdf files. I have to store the metadata of the pdf file in MySQL database because later some of that metadata such as author or year will be search criteria. What would be the simplest way to do something like that?
Asked
Active
Viewed 206 times
0
-
You might want to consider something like [Solr](https://stackoverflow.com/questions/6694327/indexing-pdf-with-solr#25384770) that can support text and metadata searching a lot better than MySQL. Or any other full text search engine supporting metadata. – danblack Sep 14 '18 at 04:04
1 Answers
0
A simple way might be to store the pdf in a blob store (like AWS S3 or GCS). Those stores will return back a unique identifier for the stored object. In MySql, store any metadata you need as well as a reference to the stored object for fetch later.
If you don’t want to add an additional store, serialize the PDF to bytes and store it directly in the row in a column.

dolan
- 1,716
- 11
- 22
-
Should I use some library as TIKA or..? Because in my database pdf is stored in blob but other columns reserved for metadatas are blank. – Neo Cortex Sep 14 '18 at 03:52