For Python applications using in-memory databases, a single conventional memory device is required for all database data, indexes and metadata and is automatically defined and initialized in the exdb.open_database() method when no device array is specified. For example:
db = exdb.open_database("myopendb", dict) db <exdb.Database object at 0x100827610>Here the database with the name “myopendb” is created. By default, it is opened as an in-memory database, using 128Mb of RAM. The variable
db
is a handle to the open database. To create a database with other parameters, other arguments can be specified:def open_database(dbname, dictionary, is_disk = False, db_segment_size = 128*1024*1024, cache_segment_size = 16*1024*1024, mem_page_size=256, disk_page_size=4096, db_log_type="REDO_LOG", disk_max_database_size = 0, file_extension_quantum = 4096*1024, db_max_connections = 10):(Note that the parameter
is_disk
must beFalse
(the default) for an in-memory database, and the parametersdisk_page_size
anddisk_max_database_size
are ignored.)Persistent Databases
For Python applications using persistent databases, at least four memory devices must be specified for:
- dictionary and metadata, and possible transient class data: a private or shared memory device
- persistent data storage: a file, multifile or raid device
- persistent data cache: a private or shared memory device
- transaction log: a file, multifile or raid device
The following classes (inherited from the Device class) are provided for this purpose:
privateMemoryDevice
sharedMemoryDevice
fileDevice
multiFileDevice
raidDevice