Posted on

I decided to create a super simple blog engine using Silex and XML. I wanted a place that I owned and operated where I could post thoughts, links, and pictures. I did not need a big and heavy blog engine.

To keep things as simple as posible I am storing each post in a XML file as opposed to a row or document in a database. The file name is simply [unix epoch].xml. Each post contains a created timestamp, title, and body. The body is using Markdown. I am using a PHP Markdown library to process the bodies into HTML before I cache them in memory. Everytime I deploy the blog I refresh the cache. For now I am using APC's user cache to store all the posts as PHP objects.

There are a few benefits here that I see.

  1. My posts are versioned along with my codebase in git.
  2. Dev and prod have the same posts, no database to sync.
  3. Features are easy to add by simply adding to the XML tree.
  4. Markdown!

I'll report in after a few posts.