Users have the ability to enter and save text in a rich text editor which is eventually stored in a database and then rendered on a site.
Is it better to convert the RTF to HTML when it's stored to the database because there will be more reads than writes and converting it once will be more efficient?
Or would it be better to store the RTF directly in the database so the original data is always retained and there's more separation between data and display?
Convert to html on save to database:
Pros:
- More efficient when more there are more reads than writes
- Faster retrieval/rendering
Cons:
- Takes up more storage space
- Presentation and data mixed
- Original output from editor lost
Convert to html on retrieval from database:
Pros:
- Keeps original data in-tact
- Separates presentation from data
Cons:
- Inefficient/ must convert on every retrieval and render
Both seem options seem to come with costs/benefits so are there any established best practices or is it decision that needs to be made based on the specifics of each project?