[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Application Design
- From: Michael Rys <mrys@microsoft.com>
- To: Al Snell <alaric@alaric-snell.com>, fpgomez@rockwellcollins.com
- Date: Thu, 09 Aug 2001 18:51:32 -0700
Our own tests with SQLServer 2000, its XML support and having MSXML 3.0
or later on the midtier, we get up to an order of magnitude better
performance (measured in req/s) than ASP based solutions for serving
data-driven webpages where business logic is not required on the midtier
by using the XML support of the database and have the XSLT applied on it
on the server. Not to count the simpler maintenance, faster development
cycle and less bugs.
Best regards
Michael
--
Program Manager, SQL Server XML Technologies
mrys@microsoft.com, rys@acm.org
We store the Web and more...
> -----Original Message-----
> From: Al Snell [mailto:alaric@alaric-snell.com]
> Sent: Thursday, August 09, 2001 5:53 PM
> To: fpgomez@rockwellcollins.com
> Cc: xml-dev@lists.xml.org
> Subject: Re: Application Design
>
>
> On Thu, 9 Aug 2001 fpgomez@rockwellcollins.com wrote:
>
> > I am looking at using XML for this.
>
> > 3) Does anybody see any potential problems with this approach?
>
> Yes... I'm not sure it's worth using XML here. What will it
> gain you as opposed to a set of PHP pages that talk directly
> to the database? Unless you have particular programming
> experience with XSLT and not PHP/ASP/CGIs/whatever, I find it
> easier to set up PHP under Apache than to set up an XSLT
> engine and put things in place to make a web server invoke it
> against XML pulled from an SQL database.
>
> <table>
> <tr>
> <th>Name</th>
> <th>Description</th>
> </tr>
> <?
>
> mysql_connect(...);
> $q = mysql_query(
> "SELECT * FROM Documents WHERE name LIKE '" .
> addslashes($HTTP_GET_VARS["id"]) .
> "'");
>
> while($row = mysql_fetch_row($q)) {
> ?>
> <tr>
> <td><a href="/documents/<?=
> $row["filename"] ?>"><?= $row["name"] ?></a></td>
> <td><?= $row["description"] ?></td>
> </tr>
> <?
> }
> ?>
> </table>
>
> One neat feature of PHP/ASP/whatever over XSLT is that:
>
> 1) It's a real programming language. It can access databases,
> the filesystem, various networking APIs, .dbm files, etc
>
> 2) It's imperative, which means that it can not only format
> data into an output, but it can update the database too.
>
> If you're planning on writing PHP/ASP/whatever that outputs
> XML elements and then transforms them with XSLT to produce
> HTML, that's a bit more sensible, but a lot more work than
> just emitting HTML in the first place. Seperate content from
> formatting by putting all the SQL calls in a PHP function
> library in a seperate file, and have .php files in the web
> space directory that are just HTML templates with holes cut
> in them to call the database functions.
>
> This is a lot simpler to set up (only one language is needed,
> you don't need to install an XML parser and an XSLT engine,
> and all the data flow from back end to front end is done via
> function call interfaces rather than an XML document with a
> DTD/schema/informal prose description). And the resulting
> programming model is just the difference between:
>
> <html><head><title>
> <xsl:value-of select="/page/title" />
> </title>...
> <xsl:for-each select="/page/results">
> <tr>...</tr>
> </xsl:for-each>
>
> and:
>
> <? include "../backend.inc" ?>
> <title><?= $title ?></title>...
> <? while($row=nextResult()) { ?>
> <tr>...</tr>
> <? } ?>
>
> ...there's no real difference between the two, you just use
> different sequences of magic symbols.
>
> > Fred Gomez
>
> ABS
>
> --
> Alaric B. Snell
> http://www.alaric-snell.com/ http://RFC.net/
http://www.warhead.org.uk/
Any sufficiently advanced technology can be emulated in software
------------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>
The list archives are at http://lists.xml.org/archives/xml-dev/
To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: xml-dev-request@lists.xml.org