How DNA Works at the Server Level
The DNA system is based around a database server, a collection of web servers, and a number of application levels.
The specifications for the database and web servers at the date of publication, 2005, were as follows:
How DNA Serves Pages
Let's look at how each of the components works together to serve a DNA page to a visitor. It starts with a page request coming in to the BBC servers.
Proxy Passing and Cacheing
When a request comes in to the BBC for a DNA page (ie a URL that starts
The DNA application is written in C++. Its purpose is to create well-formed XML by querying the SQL database for the information that's required to build the requested page.
For example, if a request comes in for a non-cached article page, the DNA engine will have to query the database for things like the author's name and account number, the subject and contents of the article, the status of the article (ie Edited, Help Page etc), and so on. It might do this using an SQL query like the following:
Please note that this is only for illustrative purposes, and doesn't reflect reality - most pages require multiple queries, most of which are a lot more complicated than this simple example!
Construction of XML
Once all the SQL queries have been processed by the database, the DNA application then builds a well-formed XML tree containing all that data. For example, the XML fragment that describes the date when the article was created may look like this:
Similarly, if an article is written in GuideML, then the GuideML for the article will be pulled out of the database and wrapped up in an XML fragment like this:
The part between the
Once the DNA application has created a valid XML tree containing all the required data, it passes this through to the next stage in the process, the XSLT stylesheet. Each different skin on each DNA site has a different stylesheet, though there is a base stylesheet that contains most of the functionality required by DNA sites which is cascaded by local stylesheets.
XSLT is a language that takes XML and transforms it into another form, in this case HTML. The actual transformation is done by the MSXML module, which takes the XML produced by the DNA application and the XSLT stylesheet for the relevant skin, and produces HTML.
Once the HTML is produced, it's cached where applicable, and is sent back to the outside world, via the BBC proxy servers. And that's it!
Because the DNA application produces XML that contains all the required information but doesn't care about layout or presentation, the XSLT stylesheets can easily be changed to produce completely different types of layout, in totally different languages. An obvious consequence of this is the ability to support multiple skins in each DNA site, which simply display the relevant information in different ways. As an example, consider the following ways of viewing h2g2's Front Page:
Similarly, the XSLT stylesheets don't need to output HTML; they could just as easily output WML, markup for interactive TV, or any other applicable markup language.
Indeed, browsers like Internet Explorer 6 can process XML and XSLT locally, so it won't be long before DNA could serve pure XML to the public, and their browsers would then download our XSLT stylesheets for local storage, and their local computer would apply the XSLT to the XML to come up with the final HTML. The upshot would be the opening up of DNA skins to the public to design and to circulate, meaning the BBC would only have to maintain a small number of functional skins plus an XML feed.
It's an exciting thought, but don't hold your breath!