# Transient or Persistent Database Objects

> A `transient` database object exists only as long as an application has an open connection to the database. All transient objects disappear when the application shuts down the database. An in-memory database will contain only `transient` objects, i.e. objects that reside in memory only for the duration of the application that creates the database, or, for shared memory databases, until the shared memory segment is removed. A `persistent` database object resides on a persistent storage device, usually a Hard Disk Drive (HDD) or Solid State Drive (SSD).

> The number of `transient` objects is limited by the memory space available. Actually the database uses the assigned memory area not only for the `transient` objects but also for the indexes and internal metadata structures. The number of `persistent` objects is limited by the persistent storage device so a `persistent` database may contain terabytes of data. It should be noted that the database storage (memory and persistent) can be extended at runtime to fit more data.

> Persistent databases can contain only `persistent` objects or it is possible to create hybrid databases which contain both `transient` and `persistent` objects. The `transient` objects have `transient` indexes and `persistent` objects have `persistent` indexes. This means that a `persistent` database does not need to be re-indexed after re-opening. Also the `persistent` objects and `persistent` indexes have different memory layouts (due to the nature of their implementation) so it should not be surprising that a `persistent` and a `transient` object of the same structure (in the schema) have different memory requirements.

> A `persistent` or hybrid database requires a special device named cache. This memory area is used by the eXtremeDB runtime as a buffer between the persistent storage media and the application where it loads the `persistent` objects data and indexes. In common practice, it is best to specify the cache size as large as possible to give the application maximum performance in data transactions. For a detailed description, please see the Persistent Database I/O page.

> The application determines the type and size of storage by defining storage devices for the database data, metadata, and for `persistent` objects the cache and transaction log.