BangDB Helper types, Java
DBParam helps set the various configuration for the BangDB. It has following configurable parameter;
host : sets the host ip of the server, not relevant for embedded
port : sets the port id of the server, not relevant for embedded
userid : BangDB uses default id as of now, will change in future
password : BangDB used default password as of now, will change in future
init_sock_conn : boolean to specify if we need to init the socket connection, not relevant for embedded
tls_conn : whether to use ssl/tls based secure channel or not, not relevant for BangDB embedded
tran_type : Whether the db should be opened in transaction mode or not, following trantypes are available;
config_path : path to the bangdb.config file
dbPath : path for db to keep files
dbLogPath : path for db to keep log files
dbArchivePath : in case of archival, this path should be used to keep archived data
Table environment defines the way table should be created. This is very important helper type and should be used carefully and in right manner to create a table
Here are the parameter for the table environment;
db_type : type of db, in-memory or persistent as well. Default is persistent.
It is selected from following enum;
idx_type : type of index for primary key, how primary keys would be stored.
It is driven from following enum;
key_sz : in case of string key, what’s the maximum size of the primary key. Please note large size is not good for performance reasons, typically it should be less than 64 bytes, but if it has to be more, please set it accordingly, but not good from efficiency perspective. Note than if key is tried to be inserted, and size of key is more than key_sz, then operation will be rejected, hence set it carefully. Default is 24 or 32 bytes
table_sz_hint : this is optional, and it helps tell the db how large this table is going to be in case it’s created. Good for db optimization. Please note this only affects the db in run time, therefore it could be reset while db restarts etc.
log_sz_mb : Usually default is good, however you may use to reset it. This tells what the size of a single log file is. This log file is write ahead log, where db writes metadata and/or data for atomicity, transction and data recovery perspective.
table_log_type : BangDB can create write ahead log in shared and in private mode. Shared mode will have a log structure shared by all tables, whereas private log will be created for each table. It’s always good to use shared (default) log type unless there is a security or other reason to use private.
Here are the options;
Autocommit : this is always on
sort_method : When BTREE for index is used then we have to define the sort method. Here are options;
sort_direction : user can define if sort is in increasing or decreasing order. Here are options;
key_type : user may override key type as well. Here are options;
table_sub_type : to set sub type of the table. Here are the options;
allow_duplicate : Sets if duplicate keys are allowed.
version_type : When duplicate keys are set for primary or secondary, then to have data version defined for proper retrieval of data, we should set this. The options are;
allow_rev_idx : set to allow reverse indexing. Note that it can only be done for WIDE_TABLE