bbsengine3 handbook: database

database overview

the "engine" schema has the following tables:





bbsengine uses a database to store session data instead of temporary files. this allows multiple VMs (virtual machines) to access the session data in distributed deployments.


a sig is a "special interest group" intended to contain things like 'links' and 'posts'. in recent versions, an item is allowed to be in multiple SIGs.


'mantras' are like 'fortunes' that appear in the page footer. it is included because it is a basic module that gives an example of what can be done with the bbsengine allowing basic functions like adding, editing, and deleting existing mantras.

database abstraction

written 2015-dec-22

MDB2 is a database abstraction layer that is part of PEAR and is used by bbsengine.

the 'stable' release of MDB2 (2.4.1 as of this writing) has a bug that does not correctly handle errors ("not null", "field not found", etc). it is not likely that 2.4.1 will be fixed. the release that does not have this issue is currently '2.5.0b5'.

install it with:

$ sudo pear upgrade mdb2-beta mdb2_driver_pgsql-beta

the MDB2 package and the relevant database driver must be the beta versions.

throughout bbsengine, care has been taken to protect against "sql injection" attacks. this is done by using bound parameters in all sql queries. this is unlike the first versions of bbsengine years ago (~2006) where I was using DB and not taking care of things properly causing several CVEs to be issued.