DevShed Interviews the Developers of Project Midgard
September 30, 1999
The open-source Project Midgard is an innovative PHP/Apache-based API for creating and maintaining Web sites. DevShed inteviews its developers, Henri Bergius, Emiliano Heyns and Jukka Zitting, to discover the concept behind the code. You can see Midgard in action, or download the package for yourself at http://www.midgard-project.org/.
DevShed: Without getting technical, tell us what problem you are
seeking to
solve with Midgard.
Emile: That's a big one. Midgard in general is so darn flexible it
could very well become the Emacs of web serving, so listing what it
*can* solve would be a daunting task.
What Midgard brings me is power without hassle. The most important
things (access control, site maintenance, style system) are built-in
and easy to use from the standard maintenance site.
On the other hand, if I need something esoteric, the foundation is
there to build it. Midgard at its core an API: even the Midgard admin
site, which looks & feels like it's an integral part of Midgard, is
'just another' Midgard application.
Jukka: This project started from the need to create a dynamic
database-driven Web site using freely available components. Instead of
creating yet another ad hoc PHP/MySQL Web site, we decided to first
design a generic framework for building such Web services and then
implement our Web site using that framework. Midgard is the result of
this process.
Midgard allows one to create and maintain dynamic Web services without
a thorough understanding of database design methods and the
complexities of maintaining persistent database connections. On top of
that we added an intuitive and extensible style system, user accounts
and a generic content model based on articles in different topics.
DevShed: Zope has been gaining a lot of attention lately. How does the
scope and purpose of Midgard differ from that of Zope?
Jukka: Both application servers aim at easing and automating the
process of creating and maintaining dynamic Web services. The
approaches taken by these two projects are however quite different.
Zope uses python objects as the basic building blocks of the Web
services. This is a very dynamic and also quite code-oriented method
of web publishing. In Midgard the emphasis is on the different data
records that are automatically bound together to produce Web
content. PHP code is used in Midgard as an extra for adding dynamic
components to the Web sites, not as the basic building block.
You can use the Midgard's host and layout systems to easily create and
maintain Web services without any programming skills required. The
intuitive style and template system allows you to easily work and
experiment with multiple different site styles.
Henri: I think also an important difference between Zope and Midgard
is that Midgard is based on Apache, and can be easily plugged in to a
normal Web server configuration. This provides users with an easy
upgrade path from their old Web solutions to Midgard's dynamic
model.
DevShed: Explain the components of Midgard and how they work together.
Jukka: Midgard consists of four components, the database, the core
library, the mod_midgard translation module and the midgard-php
content generation module.
Midgard uses a relational database for storing all content. The
database consists of a set of tables that store Midgard records like
articles, persons, hosts and styles. Midgard uses the MySQL database
engine instead of an internal database format for handling the
records.
The core functionality of Midgard is hidden in the Midgard library. It
handles the basic tasks like database connectivity, user
authentication and authorization. The library is evolving to provide a
generic API for handling the objects in the Midgard database.
The mod_midgard translation module is the workhorse of a Midgard web
server. It is an Apache module that maps URLs to Midgard database
addresses and collects all the style elements needed for page
generation. The module also handles the initialization and termination
of the persistent Midgard database connections.
After the translation module has mapped an URL to a Midgard page
record and collected all the required style elements the Midgard-PHP
module takes control and generates the actual HTML page that is sent
to a browser. Midgard-PHP is a patched version of the official PHP. It
is fully compatible with normal PHP. The added features are the
functions for handling Midgard records and the Midgard template system
that allows the page to be generated from a collection of style and
page elements.
DevShed: Are you building Midgard for database independence? What are
the
ODBC plans?
Jukka: The Midgard database was initially designed to be used only
with MySQL and therefore contains a few MySQL dependencies. Those
dependencies can however quite easily be replaced with standard
constructs. The next major version of Midgard will work with any
standard SQL database.
A standard-conforming database layout is only the first part of true
database independence. Instead of writing separate code for each of
the numerous client APIs of the different database engines, we've
decided to use the ODBC generic database access mechanism. ODBC allows
us to write the database access code once and allow Midgard users to
plug in the database engine they like.
The Open Source ODBC packages iODBC and unixODBC have made it possible
for us to develop and experiment the Midgard ODBC code. The eager and
competent support from both the ODBC teams has helped us a lot.
DevShed: Talk to us about WebDAV.
Emile: While there aren't too many DAV aware clients at the moment, I
strongly feel WebDAV is going to be big. The DAV protocol is going to
enable clients and servers to cooperate better and easier for the site
maintainer, without getting tied up at either end. FrontPage done
right, you might say.
Any server offering DAV support is going to have a huge advantage, but
implementing DAV is a pretty large task. Most current implementations
act on the simplest case, the hierarchic filesystem(like) database,
assuming most content is static. This is not a paradigm very well
suited for a largely dynamic site. Midgard is going to have DAV, but
we're going to get it right, so this might take some time.
DevShed: As an open source project, Midgard relies on volunteer
contributors. What are your needs right now? How's the documentation
project going?
Emile: Better than one could hope for on our resources, not as good as
we'd like. Documentation is essential but rather low-profile, so many
view it as a non glamorous job. This needs more PR in general, I
think.
Another problem is that many people feel that they don't understand
the technology, and therefore can't document it. This is entirely
false: in my opinion, the people who understand the technology best
are the worst people to document it. Yes, you really, *really* need
the help from the techies, but you want the documentation readable for
non-techies. The only way to get this right is to have someone working
at it who needs to ask at every step "why did they do it this way? How
does this *work*".
Henri: While the documentation is still in a sorry state, I think
we've got our needs covered in other areas quite nicely. Jukka handles
the core libraries and some other people are doing research on
possible new features and additions (for example, Emile's work with
the DAV support). Of course, having more people in the project
wouldn't hurt.
We used to have on our site this list of things we need help with, but
I believe it is now quite outdated. I'll do something to it during the
weekend, and maybe post some information in the next MWS as well.
DevShed: Where would you like to see the Midgard project go in the next
6
months? Year?
Jukka: The short term goal is to make Midgard inter-operable with a
wide variety of environments. The forthcoming 2.0 release will use
open standards at all levels. New features include ODBC for database
connectivity, XML for packaging format, PAM for authentication, CORBA
and XML-RPC for desktop integration, and DAV for content management.
After the 2.0 release has laid the groundwork for extending Midgard
we'll concentrate on the end-user features of Midgard. Goals for the
year 2000 include support for mobile computing and PDA's, integration
with desktop software, better content management tools, and perhaps
work-flow and other advanced business features.
DevShed: I've got to ask. How do you come up with the project names
like
"Mad King"?
Henri: The Midgard releases are usually named after some real-world
event or object that has affected our development schedule.
For example, the "Mad King" release was named after a medieval comedy
play presented by the amateur theater group Hullu Hukka, which Jukka
is a member of. The Mad King is one of the most popular plays of the
theater group, and has been presented in many medieval fairs after its
initial performance on February 1998 in Epoo, Finland.
Jukka spent a weekend on stage playing the role of the Mad King when
we were finalizing the 1.2 release.
We keep a complete list of the release names and their explanations in
the Midgard FAQ.
DevShed: Thanks! I want to check up with you again in a few months.
Best
of luck!