What one save has to keep
Start with a title, a body, a publication date and a stable entry ID. Add a category and the path to a photograph. In a file-backed engine the content may be grouped by entry or by day. The photograph can live in a separate media directory. Opening the XML in a text editor can show the title and path even when the web application is offline.
In a relational store, a post can occupy one row and its categories can occupy others. A query joins them for the category page. The public URL can stay exactly the same under either arrangement. Classic dasBlog and .Text illustrate the two approaches, and BlogEngine.NET offers a choice of providers.
The trade at the writing desk
| Job | Entry files | Database |
|---|---|---|
| Find a month | Read dated files or maintain an index. | Query a date field, often with an index. |
| Save an edit | Coordinate writers and replace a complete file safely. | Group related changes in a transaction. |
| Carry it away | Copy a consistent content tree and its media. | Export a consistent database and copy separately stored media. |
A backup a reader could use
Suppose yesterday’s entry opens after a move but the photograph is missing. The XML or database export may be complete while the directory it points into is empty. Make a list of the content store, uploaded files, theme and site settings. Record which path the application expects each to occupy. Keep private configuration outside the public files.
Choose a quiet point for a file copy, or arrange a consistent copy through the hosting system. A copy taken during two related writes can contain one new file and one old one. A database has its own backup facilities. SQLite’s Online Backup API, for example, can copy the contents of one database into another while the source remains in use.
