Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for autosaving drafts?

Tags:

autosave

What is the best strategy for applications that autosave an email before it is sent or save a blog post before it's finished or officially saved? Would it be best to use a separate table in the database for temporary drafts or to have a status column that marks a post as draft or published? I'm not looking for code, just methods, but any other related advice would be welcome as well, like how often to save, etc.

like image 530
VirtuosiMedia Avatar asked Mar 27 '09 20:03

VirtuosiMedia


People also ask

How do you save draft?

You can force a draft to save at any time by clicking the Save button in the top left menu bar of the email message or click File > Save.

What does it mean to save as a draft?

Drafts are separate entities form the current page, used for content that is incomplete or needs review before officially saving over (submitting) the current page's content.


2 Answers

Considering that separate tables for drafts and published articles would be essentially duplicates of each other, I would lean towards just one table with a status column to differentiate between the two.

like image 123
Bill the Lizard Avatar answered Sep 28 '22 20:09

Bill the Lizard


I do drafting on the Wikipedia way: I save the first version, and all modification's saved (based on time or explicit user command) as a next version. After ie. publication you can delete the draft-graph - or not.

If you save data in database I think it's good to use the same table (you can avoid schema conflicts), and use version/status to track drafts lifecycle.

like image 33
boj Avatar answered Sep 28 '22 20:09

boj