Saké has been designed from the very beginning to offer the most scalable web-based applications available. The Saké framework is entirely based around 100% pure Java servlets. This architecture is literally orders of magnitude faster and far more scalable than the traditional CGI approach to building web-based applications, for several reasons:


Memory resident architecture

Web-based applications that function via CGI must be initialized from the ground up every single time they are invoked. Every single time a web user clicks "submit", the web server must locate the application file, load it into memory in a heavyweight process, and initialize the application. (See Figure 1.)


Figure 1: A web-based application that uses CGI must create a new process on the host server for each page access from each user.

If the CGI application is written in Perl, the most common language for web application development, then the Perl interpreter must itself be loaded before the CGI application can be interpreted. The application must then load any initialization files that it needs, load any HTML interface template files that it needs, and then finally it can produce output via a pipe to the web server process. (See Figure 2.)


Figure 2: A Perl/CGI application must load and initialize the Perl interpreter, which must then load and initialize the actual CGI script.

This archaic mechanism puts tremendous strain on a web server's resources, even if the server only has a handful of users. Both CPU time and memory are consumed in inordinate amounts by this process.

A Saké application, on the other hand, is loaded a single time. Once the application has initialized, it becomes a part of the web server itself. Requests to Saké applications are spawned instantly in lightweight threads instead of heavy processes. Since the Saké application has performed all of its initialization long before the user accesses a page, the application can focus immediately on producing output. (See Figure 3.)


Figure 3: A Saké application acts as a part of the web server instead of as a separate process, and handles user requests in lightweight threads instead of heavy processes.

This streamlined approach cuts response times dramatically and lowers overall server load. Since far fewer resources are needed to service each individual user, Saké applications can service many times the number of users that traditional CGI applications can.


Cached Interface Templates
Traditional CGI applications struggle with a customization tradeoff: they can use template files to define the HTML interface of the application so that administrators can easily customize the interface. Since CGI applications must be loaded and initialized every single time a user requests output, template files can be extremely inefficient. (See Figure 4.)


Figure 4: A CGI application has to access the disk each time a template is needed. Disk access is a slow operation and this consumes huge amounts of valuable resources in busy environments.

Every single page access requires at least one template file to be accessed, parsed, and reformatted into output at runtime. The alternative is to hard-code the HTML interface into the application, making the user interface of a web-based application very difficult to modify or customize.

Saké transcends this tradeoff entirely since Saké applications are only loaded once. When a Saké application needs an interface template to produce HTML output, it locates the file and parses it into a pre-digested structure, and then it caches that structure for the next time that the template is needed. The next time the application needs the same template, it is instantly available. (See Figure 5.)


Figure 5: A Saké application caches only one copy of each template in memory and shares it for all connections, saving valuable memory resources and eliminating slow disk access latency.

The interface templates are so small that they require virtually no memory to store, and the performance increase over a traditional CGI application without the benefit of cached templates is astonishing.

Inherent Scalability
Saké takes advantage of the inherent scalabilty of Java Servlets. Many exciting options are available for scaling a servlet application, and the hyper-competitive application server market is creating new and exciting options every day. For example, for a description of how to set up load balancing between several application servers with Apache JServ, see this document.

Saké applications are not just faster and more scalable than CGI applications, they are also a dream to work with, for many reasons:


XML or HTML Templates

If your web-based email package uses 20 different HTML interface template files, then you will have to modify 20 different files if you want to make a simple change like swapping out a logo or a copyright notice. Saké applications can still use HTML templates if they are configured to do so, but they offer a new type of interface template for defining your interfaces: the powerful combination of XML and XSL. If you want to change the logo or the background image in your web-based email application, for instance, you can make a single change to an XSL style sheet file and restart your application. The Saké application will process each XML template file with your XSL file and the change will instantly be visible on every page in the entire application. It simply isn't possible to 'forget' to update one of the pages. (See Figure 6.)


Figure 6: Saké applications can use HTML templates, or they can read XML files and produce HTML on-the-fly with XSL templates so that global changes can be made to the entire site by editing only one file.

You still have complete control over how much or how little information is centralized in your XSL style sheet. Endymion provides a ready-made, easily modifiable, example template set that works out of the box, to eliminate the learning curve for your art staff.

If you prefer to use CSS technology for your style sheets, shifting the burden of styles from the server side to the client's browser, Saké applications will not get in the way. You can even mix server-side XSL style sheets and client-side CSS style sheets for very powerful control over styles.


Well-Documented XML Configuration Files

Saké applications do not use arcane or highly delicate formats for initialization files. We don't want to make configuring Saké applications a challenge, so each application is configured via a simple initialization file that is as simple as editing HTML. Each parameter in each file is clearly documented in simple English to make your life simple.

<!-- Top Frame                                                  -->
<!-- Some installations may need to be hosted within a specific -->
<!-- frame other than "_top".  Occasionally Sake applications   -->
<!-- need to aim contents at specific frames.  Use this to set  -->
<!-- the name of the frame that will be the top level for this  -->
<!-- installation.                                              -->
<entry name="sake.topframe" value="_top" />
Figure 7: An example of a simple, well-documented entry in a Saké configuration file.


XML Data Files

If you're getting the impression that we really like XML, then you're correct. XML is also an extremely simple, clear, and precise way of building data files. Since Saké application data like user options files or user messages is stored in XML files with the content marked up in plain English, your data is always available. In the event of a massive system failure of any kind, your data is still extremely comprehensible to a wide variety of different applications, as well as to the human eye. If you would like to build third-party utilities that access Saké application data directly, it is readily digested. If you need to be able to migrate data to or from Saké applications, the simple XML structured data formats makes it easy.

<options name="rap@orpheus">
  <entry name="sake.mail.options.sortstyle" value="date" />
  <entry name="sake.mail.options.messagesperpage" value="20" />
  <entry name="sake.mail.options.deleteproxy" value="true" />
</options>
Figure 8: An example of the simple XML format that Saké uses to store your data. This is a file that stores user options for a Saké Mail user.