Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Good book on programming large CGI applications?

by rom_de_plume (Acolyte)
on May 31, 2001 at 00:02 UTC ( [id://84360] : perlquestion . print w/replies, xml ) Need Help??

rom_de_plume has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone out there have any recommendations on a book (or website, or whatever) that talks about building large CGI applications?

I know there are a ton of books that provide a basic intro to writing and processing forms with CGI. What I haven't seen is any books that talk about putting together big, multiscreen, multiuser web based applications. Most CGI books hardly seem to even touch on subjects like session management, persistance, etc, etc.

I know there are people writing big web based applications. Are there any books talking about how it's done?

  • Comment on Good book on programming large CGI applications?

Replies are listed 'Best First'.
Re: Good book on programming large CGI applications?
by clintp (Curate) on May 31, 2001 at 00:06 UTC
    "Writing CGI Applications with Perl" by Kevin Meltzer and Brent Michalski is pretty good. Assumes you already know what you're doing with Perl and CGI and goes from there.
Re: Good book on programming large CGI applications?
by Starky (Chaplain) on May 31, 2001 at 04:29 UTC

    This is not a book recommendation, but a recommendation based on the big picture you seem to be asking about and can be taken as complementary advice.

    If you are writing a large web application in Perl, I would presume that the application will be developed by a team.

    Whether or not it will be developed by a team, but particularly if it will be developed by a team, you don't want your application to be simply a collection of CGI scripts. You'll want to explore putting it in an application server framework, which will

    • Save you time and money by allowing your developers to create the application in a framework that saves them from having to worry about such things as how to access the database, how to preserve user state and session information across page views, etc.
    • Save you time and money by providing a templating system that will allow your graphic designers to do graphic design that can be easily incorporated into the application by your developers and existing pages to be modified by those without development experience.
    • Improve performance and scalability by making proper use of mod_perl in a secure and reliable framework that supports multiple application servers.

    I would suggest

    • Looking into CPAN modules that accomplish this task (take a look at Template, which I've had great success with, and Apache::Template) and the links mentioned in a previous reply,
    • Looking into a commercial package such as Velocigen, and/or
    • Finding a consultant who has experience with writing large applications in Perl to get you off on the right foot. I've worked with one consultant, Moon Lee, who has developed a lightweight but extremely scalable application server which has reliably served out gajillions of web pages using both MySQL and Oracle as backends for load balanced server farms, and who I can personally vouch for.

    By the nature of your question, I would guess that you are starting from the perspective of someone who has not built large-scale web applications or doesn't have anyone on staff who has. So, based on my experience, I would highly recommend the second and/or third suggestions above. Spending some money up front on a knowledgable and experienced resource will save you loads of time, money, and heartache over the life of your project.

    Hope this helps!

      It's not being developed by a team, just by me. I agree with your recommendation of using Template Toolkit. I'm using it already and it rocks! I think it's saved me a lot of time, and I think the end product will be a lot more flexible because of TT.

      I like your idea about using an application framework, but I don't want to use a commercial packages, because I'm hoping I'll be able to release this as Free Software eventually.

      Your comment on the value of the application framework hit the nail pretty much on the head though. I've written small cgi scripts before, but this program will have lots of screens and some multi-step, multi-screen user operations. I'm getting kind of bogged down in the user/session management.

      I haven't found an open source application framework I feel comfortable with so far, but there are a several posted in this thread that I haven't heard of. I'll look at them and see if I like them. If nothing else, at least maybe I can get some inspiration! Using existing modules/frameworks is almost always a good idea (IMHO), but if I can't find one the works exactly for me, I'd rather re-write the wheel than completely re-invent it from scratch!

      Thanks for your help and recommendations!

Re: Good book on programming large CGI applications?
by Beatnik (Parson) on May 31, 2001 at 01:34 UTC
    I doubt there is a *good* book on CGI Programming (especially large applications), as there probably isn't a *good* book on perl (well, uhm besides Camel & Llama), but I can recommend CGI Programming with Perl 2nd Ed, the first edition is completly online here... Oudated but also pretty educational is Web client programming with Perl, completly available online at mentioned URL.

    Outside Links has a list of several good Perl (and other books)... You might wanna check that out.

    ... Quidquid perl dictum sit, altum viditur.
Re: Good book on programming large CGI applications?
by goldfish (Novice) on May 31, 2001 at 06:59 UTC
Re: Good book on programming large CGI applications?
by princepawn (Parson) on May 31, 2001 at 02:18 UTC
      Thanks for the link! I'll check those out and see if one of them will work for me. Your correct that I definately don't want to re-invent the wheel!
Re: Good book on programming large CGI applications?
by shotgunefx (Parson) on May 31, 2001 at 10:11 UTC
    I have a bit of experience with CGI applications. The largest one I have written was around 10,000 lines of Perl.

    It was a multi-user product database and order retrieval, tracking and reporting system for a big (now defunct) dot com. I can tell you it was a real trial by fire.

    In my experience your methodology will play a big part. Is your application screen based? (One screen does one function) or do certain functions require multiple steps?

    What's the nature of the data? What security concerns do you have? What performance concerns do you have?

    There's a lot of ways to do it and how will depend on your problem and how you like to approach the problem.

    Personally, I haven't found any good books on the subject. From my past experiece I am working on a solution for what I see are the big challenges of CGI without tying the user to rigidly too one way of coding. I posted a node in meditations recently. You may find some of the things I listed as requirements as helpful or at least something to consider.


    "To be civilized is to deny one's nature."