next up previous contents
Next: Implementation Up: MySQL occam- API Previous: The occam- programming language   Contents

Design

The main design criteria for the interface to MySQL is that it should be safe and easy to use. The main difficulty in the design lies in the fact that communication with the database is inherently sequential.

Safety is provided by encapsulating access to the database in a process. Communication with the database is then carried out by passing messages to and from the MySQL process. The communication will follow a request-answer model: For each message passed to the process, there will be at least one message received. For safety, there will be separate protocols for incoming and outgoing messages.

The reason for providing access via. a process and not simply as ordinary library calls is that we want to avoid having to expose handles to the database to the application programmer. All state information should be handled internally in the process. For the same reason, each connection to the database will be a separate process. That way, we avoid handles to connections.

The standard way of retrieving data from the database is one row at a time. The basic retrieving method of MoA will work in the same way, but for convenience we will also provide a way of retrieving all rows of data with a single command.


next up previous contents
Next: Implementation Up: MySQL occam- API Previous: The occam- programming language   Contents
Espen Suenson 2006-07-07