The databases index maintains are stored as simple lines of text. Each field of an entry is a line of text, and each entry in the database is made up of a fixed number of lines. For each database, you tell index what each field's (line's) name is. You can have multiple-line fields by leaving that field's name blank. There's no fancy storage algorithm, things are just stored sequentially.