# eXtremeDB Database Control

> All databases, whether all-in-memory, persistent or hybrid (with both `transient` and `persistent` classes) occupy main memory in the application’s memory space. For in-memory databases, a single memory device specifies the type of memory (`conventional` or `shared`) and its size. For persistent databases at least four memory devices are required. The memory is then allocated dynamically and passed to the eXtremeDB runtime to open or create the database. From this point until the runtime is shutdown this memory is exclusively managed by the runtime, though it can be extended later (by allocating more dynamic memory) if necessary.

> Each database application process, and each thread in a multi-threaded application, must first connect to the database to perform any database operations. All database transactions are managed within the context of this connection. Before terminating, the application disconnects and closes the database before shutting down the runtime.

> Please use the following links to view details of the relevant APIs:

> Devices | Defining database devices
> Database Open/Close | Creating/Opening and closing databases
> Database Connect/Disconnect | Connecting to and disconnecting from databases
> Extending Memory | Extending device memory