How to save text, svg, html, css efficiently

In the application, I use Fabric.js , which allows users to write text, draw SVG, insert images, etc.
I want to know what is the best way to store this data.

Requirements:

  • The ability to request data (text) that tells me that I should store it in the database (MySQL at the moment)

  • I have images, and I also target the iPad, so the images matter how they are stored.

  • SVG and HTML / CSS are also saved.

  • I also want to perform version control of the content, as Quora does, so that the user can see the changes from the previous version to the current version. This also includes image versioning and SVG.

Iโ€™m wondering how Google Docs do this, as they also store our documents, pictures, etc.

What is the best way to do this?

+4
source share
4 answers

I run a webapp where users create reports, and I find it more efficient to store images and binary files in the file system and link to them from the database. Elements that are in xml or text are stored in the database to simplify the search - in your case it will be css / html and svg (which is xml). Use the database for version control.

You can also check this stream by storing images in a database .

It seems that Frabic.js uses the node.js javascript web server for the backend - you havenโ€™t used it before, but you can explore which databases are easiest to use with node.js:

+1
source

I donโ€™t know if this helps, but the Opera browser offers the ability to save web pages in a unique file {mht extension}, which stores all the files {css, images, scripts, etc.} in base64 encoded text for a later version {when opening a document} ... maybe this could be a way to store data: P

+2
source

If you want to effectively request the text, then, perhaps, the placement of all bits of information in the database separately is the most effective. You may need to play with OOXML or ODF , which can serve as a container for all the required information, and then an XML store (e.g. eXist ) to save and query it (e.g. text). Since these standards are based on XML, you can convert them to HTML (for example, here or here ), but writing an online editor for this is what a monster like Google can do.

+1
source

You can look at NoSQL databases like MongoDB or CouchDB

See also Saving Images in NoSQL Stores

+1
source

All Articles