On the web, every page is a text document. The text documents are interpreted and displayed by browsers according to a standard contract – HTML.
The classic client-server programming model works very differently – a Visual Basic application, for example, will contain all manner of binary files and libraries that directly call operating system functions. It’s like writing a new browser for each website!
The choice of model has far-reaching consequences – for example in security, in user interface design, in software distribution, and in application integration. But, surprisingly, one part of the classic model remains – the relational database. Mixing a relational database with online text documents should really not work:
- Database tables are not documents, so they can’t be referenced by URLs or appear in hyperlinks in a standard way
- There is no standard file format for database tables, so they can’t be transported in a standard way across HTTP
- Cacheing models for databases and web servers are inconsistent
- Relational database best practice is for data normalization, whereas HTML documents are naturally un-normalized and hierarchical
- Security works differently in the database layer to the web server layer, leading to potential inconsistencies and gaps
- Systems integration for databases is much more difficult, due to the lack of a common extensible approach to table structures and their transformations
Since the biggest use of relational databases nowadays is to supply HTML documents, their massive take-up is something of a mystery. It’s explained by three factors – they are fast, they are stable, and they haven’t had much competition!
Apart from data access, the key advantage of Ajax is that it returns data in the same text document format as HTML. So it can be readily inserted without any intermediate layer – in fact sometimes with pretty much no code, using something like < div src="database.xml" >
Of course, you would never use Ajax to download an XML file with a million rows. But you could do some pre-processing on the server, and return a brief XML results file via Ajax. And this pre-processing step is becoming one of the main functions of relational databases – they are being relegated to storing data and returning query results in XML via HTTP, which his not their natural position.
My contrarian prediction for 2007 is that Ajax will take over from ADO.net and JDBC as the middle ground between web pages and data sources. The Atom Publishing Protocol will become a popular way to manage data sources – taking over even more of the relational database scope.
Relational databases will get decoupled from web application development. They will be increasingly relegated to XML storage and output, plus their traditional role in the declining client-server world. After more than 20 years, this is the start of their demise as the all-conquering database technology.