The database directory

A Derby database is stored in files that live in a directory of the same name as the database. Database directories typically live in system directories.

A database directory contains the following, as shown in Derby database directories contain files and directories used by the software.:

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

Figure 1. Derby database directories contain files and directories used by the software.
A Derby database
directory containing files and directories.

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

Table 1. Size Limits to Derby Database Objects
Type of Object Limit
tables per database java.lang.Long.MAX_VALUE

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

indexes per table 32,767 or storage
columns per table 1,012
number of columns on an index key 16
rows per 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, and therefore limit the size of a table and size of a row in that table.

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

Related concepts
Creating, dropping, and backing up databases
Single database shutdown
Storage and recovery
Log on separate device
Database Pages
Database-wide properties
Database limitations