The components that are specific to a multi-user system are the concurrency control modules. These include the transaction manager, lock manager, recovery manager and log manager. In addition to these four modules, operating system support is required. This can be provided by a client-server protocol, or as in the case of Minibase, a shared memory system.
In conventional multi-user client-server RDBMS systems, the server is a heavy process which performs all operations related to concurrency control. The client is a lightweight process which merely obtains the SQL input from the user and communicates this to a server (possibly through sockets or some other communication mechanism). Minibase works on a shared memory model. The server instantiates shared memory structures and performs periodic deadlock resolution and dead process detection. The clients are not lightweight, in that they perform many of the tasks associated with concurrency. This design was adopted largely to make the development of multi-user Minibase from single-user Minibase as straightforward as possible.
In multi-user Minibase, every process is a transaction. The Minibase server is process 0 and clients are numbered from 1 onwards. Thus the words transaction and process mean the same thing in Minibase.
After performing the restart operation, the server does three tasks in a loop.
Step 1 is required to take care of those processes that die but do not clean up on exit --- for example a transaction that has been killed by a 'ctrl-c'. These processes may still hold locks on resources and may be using shared memory and so, need to be aborted.
Deadlock detection and resolution is performed in the following manner. The server checks for deadlocks and picks a victim on finding a cycle. The victim's valid field is invalidated. Invalidation is equivalent to forcing the process to abort. The server then wakes up the victim process. Code in the Lock Manager ensures that a process always checks for its status after returning from a lock operation. The process will proceed after a request for a lock only if it is still a valid transaction.
The server keeps track of the number of clients in the system and needs to be explicitly shut down. At server shutdown, the buffer pool is flushed to disk, all semaphores and shared memory is destroyed and the database is left in a consistent state.
The query evaluation
path is the same in both single- and multi-user versions except
that in the multi-user version,
latches and locking are used to maintain the consistency
of the database.
Log records are written before any updates to disk,
and locking is used on write operations, in accordance with Strict 2PL.
Back to the List of Components
Back to the Minibase Home Page