JavaScript-Website Article historical version feature implementation

Source: Internet
Author: User
About the historical version of the article, a very common feature, such as, Jane, Segmentfault, have the relevant historical version of the storage, this how to implement, give a reference or URL is ok.

Reply content:

About the historical version of the article, a very common feature, such as, Jane, Segmentfault, have the relevant historical version of the storage, this how to implement, give a reference or URL is ok.

When a database stores content, one more version number field is available. Insert a new record every time you update

This is the simplest way to implement the same as the upstairs said, add a version number. Create a new piece of data when you update it.
This, of course, can lead to larger space usage.
Another way is to do the child node tag, need to do a data structure to store.
This is a small footprint, and using XML to do it is very convenient and fast. (Of course, it is also possible to do the structure with JSON).
However, it is not recommended, this method will be a big problem accidentally.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.