Tech Tip: Accounts, Namespaces, and Databases in Caché

If you are migrating from another MultiValue system to Caché, an introduction to some key terminology differences would be useful.

Like all MultiValue systems, Caché understands the concept of an ACCOUNT. Each ACCOUNT contains a VOC or MD (the terms are used interchangeably). Users can be configured to automatically LOGTO an ACCOUNT when they login, and with permission, LOGTO other accounts. When they LOGTO an ACCOUNT, an optional user or LOGIN script can run.

Except in a few cases where traditional OS files are used, Caché stores most data, such as MultiValue FILEs, in OS files named cache.dat. These are referred to as databases, and can hold multiple FILEs. Databases automatically expand as needed and very efficiently store data in optimized B-trees.

Users typically access multiple databases simultaneously. For example, Caché ships with a database that contains our system code, another that contains the documentation, and a third for temporary data that may need to be written to disk. Developers typically store their code in one database and user data in another, or a few.

When you first import a MultiValue account into Caché, all data and code for the ACCOUNT are stored in one database (cache.dat). Separating your code and data into distinct databases is highly recommended and will make installation and upgrade of production applications easier. A Namespace is the Caché term for a collection of databases under one name. Using multiple databases this way achieves the same result as Q-pointers without having different ACCOUNTS. Please note that Q-pointers are supported as well. From a MultiValue perspective, a Namespace and an ACCOUNT are synonymous.

Since all database files are named cache.dat, they are distinguished by the folder they live in. The root folder for each Caché installation includes a folder named Mgr that contains our system code. Caché's root folder also contains a configuration file named cache.cpf. Among other things, this file defines where the system and user databases are stored.

Caché has always had a concept similar to MultiValue ACCOUNTs to help developers organize their programs and data. A cache.cpf file can define multiple Namespaces, each defining the system and user databases it references. Namespaces are a logical concept defined in the cache.cpf file.

So each MultiValue ACCOUNT is specified as a Caché Namespace that specifies all the databases for that ACCOUNT. MultiValue applications typically reference multiple ACCOUNTS. This is supported in Caché via Q-pointers and the Caché concept called mapping which can reference code and data from another Namespace/ACCOUNT.

Just as MultiValue users at The Command Line prompt are in an ACCOUNT, Caché users at a Terminal prompt are in a Namespace. When a Caché user types the command "MV" at a Terminal prompt, the MultiValue shell is started in that Namespace.

So for Caché, an ACCOUNT corresponds to a Namespace. The CREATE.ACCOUNT command has added an extra parameter indicating where to create the cache.dat file.

Do you have a Tech Tip to share? E-mail it to


View more articles