質問

I have been working on a project where user can create simple templates and develop his website pages.He can save them and also put it over the internet once completed.Now my problem

  1. When the user is working on his template he can save his copy of work done and come back to it later(Similar to drafting an email).
  2. This saved work by the user is saved in xml files currently by parsing the template pages.
  3. I was thinking of an alternative over this to store the entire page itself in a document database against a unique user id,so that there is no need of any parsing to be done and reduce the load and time.

Now my questions

  1. Is what I am thinking possible using a Document Database or nosql instead of xml?
  2. If yes which one would be more flexible to work on and easy to maintain?
  3. I am using php and mysql for other operations,so I need the doc DB just to store the html of the templates created by the user.
役に立ちましたか?

解決

I've written a custom CMS before. I created a table structure that allows me to store both metadata (author, publishing date, language e.t.c) and content (separately) because I also wanted to implement a search feature that would allow me to search them separately. I did mine in MySql, but I had to do a lot of html-encoding to prevent attacks possible in SQL, so for that reason, I'd recommend a NoSQL database (Mongo / Cassandra should be sufficient).

I've never really worked with Mongo before. You could also use Cassandra. I prefer it because it can be schema-less (well like many NoSQL data stores). So, you can store thousands (if necessary) of revisions in one row so that your user can be able to rollback to a previous version of the page if they need to. You would then clear all the backup data once they feel that they are satisfied with the current revision. This is just a suggestion. Check out http://cassandra.apache.org or http://www.datastax.com/technologies/cassandra

Hope it helps :-)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top