Monday, February 4, 2008

Family Tech Support

Did you know that you can build an entire database-driven website using only SQL Anywhere? No other programming language, not even a web server is required, just the database?

That's because SQL Anywhere has a built-in HTTP server, plus web services and all the necessities for processing HTTP requests and returning HTML on-the-fly to the browser. That's how Foxhound works, for example.

Yabbut, yabbut... let's suppose you don't want to get that fancy. You don't want to learn about web services, and you don't want to (or can't) install a database server where your website sits... You just want to automate the creation of simple static HTML files for an ordinary web server like IIS.

You can still do that with SQL Anywhere... It's even simpler, and still no other programming language is required. Here's how it works for the RuralFinds web store:

  • Links to PayPal are used to implement the shopping cart and payment features. This allows the customer to use a credit card as well as PayPal while eliminating the expense and complexity of an in-house shopping cart and payment implementation.

  • Excel spreadsheets are used as an "EconoGUI" to enter and update the product information.

  • SQL Anywhere's proxy table feature is used to load the data from Excel into the item table.

  • Item photos are stored separately as JPG files, as befits a simple "static HTML" website.

  • Stored procedures create the home page index.html file, the individual item pages and the category "table of contents" pages, as well as special files for Google: the Google search results template and the Google sitemap file. Calls to xp_writefile() create the actual files.

  • Whenever the spreadsheets are changed, all the HTML files are regenerated from scratch and then copied to the web server. Currently, it takes about 5 seconds to create 200 files.

The decision to use PayPal isn't likely to change, it really does make everyone's life so much easier.

The Excel spreadsheets are another matter. Excel is a quick way to get a user interface up and running, but from a "Family Tech Support" point of view it's an administrative nightmare... I see a good old-fashioned client-server application in my future.

Add to Technorati Favorites

No comments: