databaseimagesvgversioningdocument-storage

How save text, svg, html, css all together efficiently


In an application, I am using Fabric.js, which lets users write text, draw SVG's, insert images etc.
I want to know, what is the best way to store this data.

Requirements are:

  1. Ability to query the data(text), which tells me that i should store it in DB (MySQL as of now)

  2. I have images, and I am targeting IPad as well, so the images are important, as to how they are stored.

  3. SVG's and HTML/CSS to be saved as well.

  4. I also want to do versioning of the content, as Quora does it, so that a user can see the changes from the past version to the current version. This also includes the versioning of images and SVG's.

I am wondering how Google Docs does it, because they also store our documents, drawings etc.

What is the best way of doing this?


Solution

  • I manage a webapp where users generate reports, and found it more efficient to store images and binary files in the filesystem, and link to them from the database. Elements that are in xml or text are kept in the database for easier searching - in your case this would include css/html and svg (which is xml). Use the database for managing revisions.

    Might also check out this thread on storing images in a database.

    It looks like Frabic.js is using the node.js javascript webserver on the backend - haven't used this before, but you might investigate which databases are easiest to use with node.js: