samedi 5 décembre 2020

Best rich content format to store data for web, mobile and native apps

I'm developing a web application where users can post rich content with headers, lists, etc. At some point in the future, I need to create a native desktop application and mobile application for users.

Currently, I used HTML to save content in the Database. This is properly sanitized and works well. But in the future, I feel that there will be a problem when we develop the Mobile application. To render HTML will need to use a web view and it may feel odd for end users. I want to use native elements to rebuild the UI with much control. HTML works for the web well. But in this case, I doubt it.

So first I decided to go for Markdown format to store rich data as we see in the SO, Reddit, etc. This gave me some flexibility as I can easily parse and render it with many helpful libraries. But when looking into this matter I saw it's recommended to store both HTML and markdown in the database. But this approach makes me have a large database.

As of now, we target a non-technical userbase. So we did go for a WYSIWYG editor and convert the result HTML to markdown and sent to the server. Server stores Markdown. Then the web app renders markdown on demand. This seems also a performance hit.

What are other approaches to this problem? What is the most optimal way to store rich documents for multiple devices and application platforms.




Aucun commentaire:

Enregistrer un commentaire