Defines the interface for the Tuple Manager module, which is responsible for handling inserts, updates and deletes of tuples. A Tuple in SimpleDBM is a low-level construct, and is meant to be used to implement table rows. Unlike table rows, which are made up of columns, a tuple is a blob of data that can span multiple pages. The Tuple Manager does not care about the contents of a tuple.
When a tuple if first inserted, it is assigned a unique Location. The Location of a tuple is similar to the ROWID concept in other databases; it can be used in BTree indexes as a pointer to the Tuple.
The advantage of maintaining the Tuple as an opaque object is that it makes the Tuple Manager generic and allows flexibility in the implementation of table rows. The disadvantage is that the implementation cannot be optimised using knowledge about the tuple format. This is most obvious in the logging operations for tuple updates; without knowledge of the tuple structure, the entire before and after image of the tuple must be logged even if one column has changed. This can be avoided by using a binary diff algorithm.