Databases may store relational tables/indexes in memory or on hard disk in one of many forms:
ordered/unordered flat files
The most commonly used are B+ trees and ISAM.
Object databases use a range of storage mechanisms. Some use virtual memory-mapped files to make the native language (C++, Java etc.) objects persistent. This can be highly efficient but it can make multi-language access more difficult. Others disassemble objects into fixed- and varying-length components that are then clustered in fixed sized blocks on disk and reassembled into the appropriate format on either the client or server address space. Another popular technique involves storing the objects in tuples (much like a relational database) which the database server then reassembles into objects for the client.
Other techniques include clustering by category (such as grouping data by month, or location), storing pre-computed query results, known asmaterialized views, partitioning data by range (e.g., a data range) or by hash.
Memory management and storage topology can be important design choices for database designers as well. Just as normalization is used to reduce storage requirements and improve database designs, conversely denormalization is often used to reduce join complexity and reduce query execution time.