databases outlive both pages and sessions because data is kept explicitlythere is no need to embed it within the query parameters or hidden form fields of reply pages because the data is kept on the serverthere is no need to store it on the client in cookies and because such schemes employ general-purpose databasesthey are not subject to the size constraints or optional nature of cookies in exchange for their added utilityfull-blown databases require more in terms of installationadministrationand coding as we'll see in luckily the extra coding part of that trade-off is remarkably simple in python moreoverpython' database interfaces may be used in any applicationweb-based or otherwise extensions to the cgi model finallythere are more advanced protocols and frameworks for retaining state on the serverwhich we won' cover in this book for instancethe zope web application frameworkdiscussed briefly in provides product interfacewhich allows for the construction of web-based objects that are automatically persistent other schemessuch as fastcgias well as server-specific extensions such as mod_python for apachemay attempt to work around the autonomousone-shot nature of cgi scriptsor otherwise extend the basic cgi model to support long-lived memory stores for examplefastcgi allows web applications to run as persistent processeswhich receive input data from and send reply streams to the http web server over inter-process communication (ipcmechanisms such as sockets this differs from normal cgiwhich communicates inputs and outputs with environment variablesstandard streamsand command-line argumentsand assumes scripts run to completion on each request because fastcgi process may outlive single pageit can retain state information from page to pageand avoids startup performance costs mod_python extends the open source apache web server by embedding the python interpreter within apache python code is executed directly within the apache servereliminating the need to spawn external processes this package also supports the concept of sessionswhich can be used to store data between pages session data is locked for concurrent access and can be stored in files or in memorydepending on whether apache is running in multiprocess or multithreaded mode mod_python also includes web development toolssuch as the python server pages (pspserver-side templating language for html generation mentioned in and earlier in this such models are not universally supportedthoughand may come with some added cost in complexity--for exampleto synchronize access to persistent data with locks moreovera failure in fastcgi-style web application impacts the entire application server-side scripting