The Perl You Need to Know Part 18: Personalization Methods Part 2: Databases and Cookies
October 23, 2000
|
Last month we touched on the tantalizing topic of using client-side cookies as
the basis for a personalization architecture on the web. Personalization on the
web has moved beyond snail mail spam invitations that read "You, Mrs.
Robinson, may be a million dollar winner!". Nowadays, sophisticated web
sites let users create accounts, to which information and preferences can be
tied. For example, e-commerce sites often let you save shipping information to
ease repeat purchases, and some search engines offer the visitor a chance to
tailor appearance and sorting of results. Users can access and modify their
accounts at any time, and the web site "remembers" a user between
visits. This month we'll begin a personalization architecture that uses both a
backend database and cookies to manage user accounts in a flexible manner.
|
They say there are many ways to skin a cat, and although I've never tried any
of them (despite provocation, until she bats her cute little eyes), the same
can be said for architecting a personalization back-end. The "best"
architecture for one system may be different than the ideal for another, where
a system is the whole combination of machine, network connectivity, operating
system, and web server software. To mix metaphors, we might think of the
mixture of hardware and software as a recipe of sorts. And like a typical
recipe, you might modify some of the ingredients we've used and achieve similar
(or better) results. That said, the specific technologies used in this
personalization series involve a recipe including:
- 1 x86 (Pentium
or Athlon) based
server (add CPU's to taste)
- 1
Linux operating system
(RedHat 6.1, but you may
substitute another distribution for a spicier flavor, or even
Windows NT for
those with weaker palates)
- more than 256MB
RAM
(like place settings, depending on how many guests you need to serve)
- Perl 5.005+
(sure there are substitutes, but they all taste funny)
-
Apache 1.3.9+ web server
(any web server that can execute CGI scripts should do in a
pinch)
- mod_perl
1.24+(like cayenne pepper, optimizes the dish but not required)
- Embperl
(embed Perl code within HTML -- think of a Cuisinart, not mandatory
but makes the job a whole lot easier)
-
MySQL 3.23.x (like pasta, cheap and healthy, but more exotic variants -
Oracle,
DB2, Informix,
etc. - will work just the same)
You can certainly prepare similar dishes with the fancy china and truffles and
caviar (in other words, expensive), but one of the nice things about this
hearty recipe is that the only hard cost in dollars is the machine itself.
Everything other than the server hardware is free software, which makes us
warm, fuzzy and frugal, not to mention functional and fast. Unlike a typical
recipe, though, this is not the part where we tell how to mix, stir, and blend
it all together. Nope, we're concerned with programming here, so we'll have to
assume that you've already rolled, pinched, and "BAM!"'d your way
into a working system (the links on each ingredient above lead to sites with
copious support information).
Contents:
Databases and Cookies
The Personalization Database
Baking with Julia
Fresh Out of the Oven
The Perl You Need to Know
Databases and Cookies
|