How to Save Data to Generate a PDF?

Asked

Viewed 112 times

0

There is a part of the system where the user will fill a lot of information just choosing between options selects, those selects are fed information I have registered in my database.

When I am storing this information in its proper table, is it better that I save the text directly or is it better that I save the ID of the elements that were selected? And why?

This information will be used later to generate a PDF that will display all the data that has been saved.

I think it would be faster at the time to generate the PDF if I store the texts, because if I store the ID I will have to make other queries to generate the PDF right? But would that be wrong in any way? It will cause problems if you choose to store this amount of text instead of only storing the element ID?

1 answer

1


Boa Raylan,

That depends, will it generate a lot of network traffic? Because ordering from the server long strings, or too much "text" can overload your network, isn’t it interesting you save the ids and generate when requested? Another detail, the database manages better indices and columns of the longtext type is not accepted under conditions of Where ( at least in Mysql ). My suggestion is to save the ids and generate everything when requested.

I hope I’ve helped.

  • Thanks @Pauloflesch, I will keep the option to store the msm Ids.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.