A database for a WebTemplate website has the structure of a tree. Each node in the tree is of a certain Node Type. The Node Type defines which attributes can be stored for the node. eg, a node of type "Contact" can typically store the attributes "First Name", "Last Name", "Email Address".

The base node type is the "wtNode" node type. The "wtNode" node type has no attributes, but can be used to form the structure for the tree. "wtNode" nodes can act as "folders" for other nodes. Nodes of types other than "wtNode" can store attributes.
The underlying database for a WebTemplate website is a MySQL database. Fields used for WebTemplate will begin with a double underscore "__". The "wtNode" table is used to create the tree structure. The __parentGuid field in wtNode is used to indicate a node's parent.
Every node in the WebTemplate tree, no matter what node type will have an entry in the "wtNode" table. The __typeGuid field will indicate the type of the node. When a node type is created in WebTemplate, a corresponding table will be created in MySql. The table will have the same name as the Node Type. If a node in the tree is not of type "wtNode" the node will have an entry in the "wtNode" MySQL table and the Node Type's MySQL table. The entries will be linked through the __guid field in each of the tables.
The wtNode Table:
| __guid | A unique identifier for the node. |
| __key | A user settable key which can be used to identify the node |
| __nodeIsHolderForGuid | If this is different to __guid, then this node is just a placeholder for the node which has a __guid of __nodeIsHolderForGuid. This can be used so a node can exist in two places in the tree. |
| __parentGuid | The __guid of the parent node. The root of the tree has a __guid of 0, so if the value is 0, this is a top level node. |
| __typeGuid | This identifies the type for the node. It is the __guid of the wtType Node for the type. |
| __created | The date and time when the node was created |
| __createdByGuid | The __guid of the Contact who created the node |
| __name | The name of the node. This can be used to form a path to the nodes and its children. |
| __lockedForModeration | If this flag is set, then the node is currently undergoing moderation. |
| __hidden | If this flag is set, the node will exist, but not be visible in the node browser or through WebTemplate queries. |
| __deleted | If this flag is set, the node will not be accessible by anyone |
| __allList | If this flag is set, the node will be visible to all users in "list mode" queries. |
| __allRead | If this flag is set, the node will be visible to all users in normal queries |
| __allWrite | If this flag is set, the node will be writeable by all users (and all users can create children for the node). |
| __groupList | A __guid of a group (or group set) which can see this node in "list mode" queries. |
| __groupRead | A __guid of a group (or group set) which can see this node in normal queries |
| __groupWrite | A __guid of a group (or group set) which can write to this node (or create children for the node) |
| __moderationChainGuid | If moderation is enabled, this can be set to the __guid of a Moderation Chain for the node |
| __position | The position of the node relative to other nodes with the same parent |
| __modified | When the node was last modified |
| __languageID | If translations are available, this can be set to the __guid of the language for the node |
| __translationOfID | If the node is a translation, this will be the __guid of the node for which it is a translation for. |
An example table for the Contact Node Type. Note built in WebTemplate fields begin with a double underscore. User defined fields do not have a double underscore
| __guid | The __guid for the matching node in the wtNode table |
| __luid | An identifier which will be unique over the rows in the table |
| __active | Not used |
| __latest | If moderation or drafts are used, this flag will be set if the entry is the latest version of the node |
| __created | The date the node was created |
| First Name | A user defined field |
| Last Name | A user defined field |
| Email Address | A user defined field |