In-memory databases are created in Python by the eXtremeDB wrapper (exdb) method
open_database(). For example:db = exdb.open_database("myopendb", dict)This uses default argument values to create an in-memory database with the name “myopendb” using 128Mb of RAM. The variable
dbis a handle to the open database. Other arguments can be specified, such asmem_page_sizeanddb_max_connections.The complete set of arguments to
open_database()are as follows: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, iot_agent_id = 0):Note the default value for
is_disk = Falsewhich is appropriate for an in-memory database. For an in-memory database the relevant parameters are described below. For persistent databases there are additional considerations. Please use the following link to view detailed instructions for creating or opening persistent databases.Memory page size
The
mem_page_sizeargument defines the size of memory pages for conventional memory. Themem_page_sizecan be calculated to optimize performance and will vary depending on the application dynamics, but as a rule of thumb, page size should be between 80 and 512 bytes; a 128 byte page size is good in most situations.(Note that for all-in-memory databases
disk_page_sizewill be ignored whenis_disk = False.)(Also note that
rtreeindexes require larger page sizes. If error codesMCO_ERR_RTREEorMCO_E_DISK_PAGE_POOL_EXHAUSTEDare encountered during database transactions, increase the page size in increments until these error codes are remedied.)Max database connections
The
db_max_connectionargument specifies the maximum number of connections that will be managed for this database.Persistent Databases
Please use the following link to view detailed instructions for creating or opening persistent databases.