Introduction
Databases are primarily collections of Records and Indexes along with the associated metadata and objects required for processing the data.
Configuration is typically done in a single file, with all of the dependent components included within it and stored in a directory devoted to just that database. The file is normally called, simply, 'config.xml'.
Example
An example database configuration:
01 <config type="database" id="db_ead">
02 <objectType>database.SimpleDatabase</objectType>
03
04 <paths>
05 <path type="defaultPath">dbs/ead</path>
06 <path type="metadataPath">metadata.bdb</path>
07 <object type="recordStore" ref="eadRecordStore"/>
08 </paths>
09 <subConfigs>
10 ...
11 </subConfigs>
12 <objects>
13 ...
14 </objects>
15 </config>
Explanation
In line 1 we open a new object, of type 'database' with an identifier of 'db_ead'. You should replace 'db_ead' with the identifier you want for your database.
The second line defines the type of database. There is currently only one type, so this line should be copied in verbatim.
Between lines 4 and 8 we define 2 paths and one reference to an object. To explain each in turn:
- defaultPath is the path to the directory where the database is being stored. It will be prepended to any further paths in the database or in any subsidiary object.
- metadataPath is the path to a datastore in which the database will keep its metadata. This includes things like the number of records, the average size or the records and so forth. As it's a file path, it would end up being dbs/ead/metdata.bdb -- in other words, in the same directory as the rest of the database files.
- The object reference is to an object called 'eadRecordStore' which is an instance of a 'recordStore'. This is important for future workflows, so that the database knows which recordStore it should put records into by default.
Lines 9-11 will contain a series of subConfig elements, each of which is the configuration for a subsidiary object such as the recordStore and the indexes.
Lines 12-14 will contain a series of path elements, each of which has a reference to an object that has been previously configured. This lines instruct the server to actually instantiate the object. This means that the objects can be configured globally but only built when required.