Developing a content management system Part 1


This site is currently implemented using MODX, and not very well on my end as I wanted something fast. It is also residing on a basic Linode running Debian Linux. I was always intending on creating a new site, but was most likely going to use an existing CMS, like Drupal.

I'm not a fan of PHP and have starting wanting to redevelop this site using Ada, Linode lets me rexecute binaries directly as it is a virtual system. I could use the Common Gateway Interface, but this is old technology and every invocation of an URL would mean that an application will have to be spawned from the web server, this is rather slow. Enhancements to CGI are Simple Common Gateway Interface (SCGI) and FastCGI; the former is simple to implement (hence the name), the other is actually quite difficult. I had previously implemented code to handle the SCGI protocol for Jesse Lang's Solid framework, so I'll use this.

I'll also require a Unicode library, so I'll utilise the League library in Vadim Godunko's Matreshka framework. This does have a FastCGI implementation, but I won't be using that.

Also required is template parsing, so that the document style can be replaced easily. There is a template parser library in the AWS project I can use for this.

Key concepts

The design of this CMS is fulfill the following requirements.

High level design

First we need to think about how this CMS is going to be structured at a high-level, the following diagram shows this using the client-server model.

High level structure of the CMS

The CMS runs as a daemon process in the background on the operating system, the HTTPD (the web server) will be configured to send certain requests over sockets to the CMS server, the CMS will then send a response which in turn gets passed back to the client that requested it.

You'll notice in the diagram that there is an External box. This basically means that there could be other servers that the CMS daemon needs to access.

System structure

The next diagram shows how the CMS fits in with the operating system. The CMS communicates with the web server via SCGI, it also interfaces to a database server and the filesystem. Very few OS specifics will be required:

  1. running the CMS as a daemon, and
  2. modules architecture.
System structure of the CMS and the OS

I have chosen PostgreSQL as the Database for storage of the various content within the CMS. I have heard very good things about the quality of this software from other Ada developers. There exists a number of bindings to libpq, I shall try the one in Matreshka as it also provides a common abstraction over other databases.


The following diagram shows the general abstractions that will be included in the CMS.

Abstractions required for the CMS


Documents are what the CMS is managing. Documents can be extended to create new types of documents, for example a site could have a blog document, an article document, a product document.

Each document has a number of fields that the user can complete when entering the content:

But the administrator can add new fields to the document type to give it more structure. For example, a site for a newspaper could add a photo field to a story document which could be shown at the top of the page and have it float to the right so the text flows around it.

As stated in the key concepts from the beginning of this article, each document has revision information. The database will essentially store a new version as new revision of the document, unless explicitly set by the user. It should be possible to roll back to a previous revision, thus deleting any subsequent revisions.


As mentioned in the previous section, Fields provide a mechanism for adding fields to the input forms on the documents. These fields can be anything and will provide extra features that an administrator wants to add to a site.


API's are added to the system and can be used by other modules to build extra features or content. These API's can provide admin interfaces if one is required.


These are the human's who use the site built with the CMS. Usernames and passwords, profile information can be built up separately.


Roles are given to specific users, such as Administrator, Editor, Writer, etc.


Permissions define what a user's role can do within the CMS, e.g. deleting content.


Modules provide a mechanism to extend the CMS with new Documents, Fields or API's to enhance the CMS. An example could be an online shopping system.


The cache is where pages are stored after they've been taken from the database, parsed, tuck together with the other template fragments and sent back to the client.

N.B: I have just had a thought about this, say you have advertising on a page, this could end up getting stuck with the same ad on every page request.


The database is where the content is stored.

Skip to Part 2 of this project.

If you have any comments or any ideas that I've missed out, please use the form below.

Showing comments 1 to 10 of 41 | Next | Last
pipe st claude
Reply #41 on : Wed September 17, 2014, 09:06:56
These days inside the world of party and exciting the Hookahs have come to be Really well known. Anyplace you move your self can watch a parlor of Bongs. But they are not simply just utilised for taking in enjoyment inside some locations Smoking Pipes are also applied in direction of deliver a specific healthy and comprehensively in shape again.
pipe st claude
cheap jordans
Reply #40 on : Fri September 05, 2014, 11:55:08
This is lacking in number of function and thus iphone 3gs did.. still the hotselling unit.. Constantly hang on to acquire my very own hands on apple ipad tablet... <br />. -= Hard Agrawal's continue weblog... 3 Free of charge ipad tablet Apps regarding People =-.
cheap jordans
cheap jordans
Reply #39 on : Thu September 04, 2014, 23:09:49
I use go through some nutrients here. Absolutely worth book-marking intended for revisiting. We surprise precisely how a great deal test you add for making this type of great useful website.
cheap jordans
louis vuitton outlet
Reply #38 on : Tue September 02, 2014, 18:04:43
Thieving is usually poor... millimeters kay! RIAA around says damages... Spend on your own songs, don't take the idea.
louis vuitton outlet
louis vuitton outlet
Reply #37 on : Sun August 31, 2014, 03:12:44
Which is a very sweet update John. Going to pic this specific out and adhere about the Motorized by simply Lookup business office wall structure.
louis vuitton outlet
Louis Vuitton usa outlet
Reply #36 on : Sat August 30, 2014, 19:15:14
Hello everybody, just do it-- listen as well as upload on grooveshark. com, you feel 100 % trusted if they ever before go to court about it.
Louis Vuitton usa outlet
Authentic Louis Vuitton Outlet Online
Reply #35 on : Sat August 30, 2014, 07:39:51
1 ) In the "about" menu, this states the version is actually 5. minimal payments 6 (8E200) if that helps.
Authentic Louis Vuitton Outlet Online
louis vuitton outlet online
Reply #34 on : Fri August 29, 2014, 12:49:47
Many thanks this kind of posting, it was very helpful. <br />downloaded 40D a while ago in addition to noticed the way slow anything had been. subsequently just now possessed cyberhawk tell me about a system logging me and also researched kservice along with kontiki... <br />Have deleted the nearly worthless 4oD which did not offer you me personally anything i needed to watch except if i became paying for it and after that acquired typically the quarter in order to continuously work along with absorb the storage! <br />boo for you to 4od
louis vuitton outlet online
louis vuitton outlet
Reply #33 on : Fri August 29, 2014, 07:15:48
acknowledge the apology just for this mistake the best web link is definitely:
louis vuitton outlet
Louis Vuitton Outlet 80
Reply #32 on : Thu August 28, 2014, 23:31:41
Thank you quite a lot to get discussing that with those of you that you know very well what you aren't discussing about! Bookmarked as their favorite. Please additionally review with my web site =). We're able to possess a web page different written agreement in between you hey!, I love your personal writing very much! proportion all of us keep up a correspondence much more your current post on AMERICA ONLINE? I would like a professional about this living space to solve this trouble. Probably which is a person! Looking toward expert a person.
Louis Vuitton Outlet 80
buy cigarettes online cheap fast ship to america