The database directory A database is stored in files that live in a directory of the same name as the database. Database directories typically live in system directories. log directorydescription seg0 directoryservice.properties filedescription tmp directorydescriptionjar directorydescriptionsize limitations in Derbytablesdatabase size limitations indexestable size limitations columnstable size limitations rowstable size limitations An in-memory database does not use the file system, but the size limits listed in the table later in this topic still apply. For some limits, the maximum value is determined by the available main memory instead of the available disk space and file system limitations.

A database directory contains the following, as shown in the following figure.

Read-only database directories can be archived (and compressed, if desired) into jar or zip files. For more information, see .

The following figure shows the files and directories in the database directories that are used by the software.

An example of a <ph conref="../conrefs.dita#prod/productshortname"></ph> database directory and file structure This figure shows the files and directories that might be found in the main directory of a Derby database called Sales: the service.properties file, and the log, seg0, tmp, and jar directories.

imposes relatively few limitations on the number and size of databases and database objects. The following table shows some size limitations of databases and database objects.

Size limits for <ph conref="../conrefs.dita#prod/productshortname"></ph> database objects Type of Object Limit Tables in each database java.lang.Long.MAX_VALUE

Some operating systems impose a limit to the number of files allowed in a single directory.

Indexes in each table 32,767 or storage Columns in each table 1,012 Number of columns on an index key 16 Rows in each table No limit. Size of table No limit. Some operating systems impose a limit on the size of a single file. Size of row No limit. Rows can span pages. Rows cannot span tables so some operating systems impose a limit on the size of a single file, which results in limiting the size of a table and size of a row in that table.

For a complete list of restrictions on databases and database objects, see the .