Uberblog 1.0

1. April 2012 • edited 26. May 2020

Two weeks ago I announced that I’ll no longer use Wordpress but a more simple self programmed solution. Now I’m at the point that I can say: I’ve a version with all features I need. The version 1.0.

Why did I choose this way? As described in my former post I’ve used Wordpress quite a long time. And I don’t want to rant too much about Wordpress, PHP and the whole universe. But I thought about some fundamental things:

  1. Why should I pick documents into pieces so that I can store them in a heavy relational database monster? The whole Wordpress database from over the last five years never allocated more than roundabout eight mega bytes in MySQL.
  2. Why should I put this pieces of content dynamically together on each page request? The content in most cases do not change. Sometimes a typo is fixed. But all this work only for comment functionality? I have not that much comments on my blog.
  3. Why should I do 1. and 2. and then storing the result into a rendered HTML cache file to improve the performance?

Reaching point three I asked my self: Why not creating the HTML websites periodically and skip all three steps? For me it was the price worth to do not have any “social” functionality like rating or comments in the first step.

So, Where’s the Meat?

What is my architecture? It is not a full blown LAMP stack. There is no database. The content is stored in Markdown files inside the blog repository. From this files a periodically executed script generates the static HTML content which is simply served as static file via Apache. That sounds very simple, indeed. But there are some additions:

  • there is a create script which creates blog post files as a template
  • new blog posts are updated to twitter
  • it’s possible to create additional sites, not included in the blog posts list
  • atom feed XML and site map XML generation
  • draft mode for posts and sites
  • pagination between posts (previous/next)
  • versions of the markdown content I got for free by Git

And the Social Stuff?

I mentioned above that I accepted that I will not have ratings or comments in my blog solution. Also I mentioned there is no database. That’s both not one hundred percent true. There is an implementation for ratings and comments will come soon.

The implementation of the rating feature is completely decoupled from the blog. I implemented a simple REST API with Sinatra which can handle ratings for something with an id. This data is stored via DataMapper into a SQLite database. The glue between this REST server and the blog content are a few lines JavaScript and some jQuery plugins. After the blog post loaded the JavaScript asks the REST API for rating data and displays the rater. On clicking it the JavaScript updates the data on the REST API. The reference between the rating data and the blog post is done by the URI of a blog post. Which is by default unique.

Published under the THE BEER-WARE LICENSE.
If you like what I do you can subscribe my RSS feed or follow me on Twitter.

Chrome Dev Tools Reloaded

Keynes vs. Hayek