# Web DBI - Connect speed

- ## Databases can be slow to connect

  - Traditional CGI forces a new connect per request

- ## Move Perl and DBI into the web server

  - Apache with mod_perl and Apache::DBI module
  - Microsoft IIS with ActiveState's PerlEx

- ## Connections can then persist and be shared between requests

  - Apache::DBI automatically used by DBI if loaded
  - No CGI script changes required to get persistence

- ## Take care not to change the shared session behaviour

  - Leave the $dbh and db session in the same state you found it!

- ## Other alternatives include

  - FastCGI, CGI::SpeedyCGI and CGI::MiniSvr

Previous slide | Next slide | Back to first slide | View graphic version