Should I store markdown instead of HTML into database fields?
8th September 2013
My answer to Should I store markdown instead of HTML into database fields? on Quora
You should store the exact format that was entered by the user.
- This lets you offer an “edit” feature without round-tripping between two formats.
- This makes debugging much easier
- Related: if you need to investigate a security bug, having the original input is essential.
If you’re worried about performance, you can cache the transformed HTML somewhere—or even denormalize it to an extra table column. Just make sure you always have the original input available.
More recent articles
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024