Skip to content

1.6 Modes of operation

gabordemooij edited this page Sep 13, 2010 · 1 revision

RedBean has two modes of operation: development and freeze. In development mode the database is constantly molded after your code, ensuring all your database needs are met. Believe me, you do NOT want RedBean to run in ‘development’ mode on your production server; it will just burn your cpu-cores to ashes. Before shipping your code to a production server you have to put RedBean in ‘frozen’ mode; this can be done easily, it requires just one simple change in the RedBean file ‘$freeze=true’, that’s all.

In development mode RedBean requires MySQL and MyISAM to work. In production mode, RedBean can work with almost any database. The idea is that normally you don’t want to work with a production database on your development workstation because of license costs and system requirements. In most cases developers (my experience) work with MySQL on their development workstations and the tables are then loaded into Oracle or Postgres databases when distributing to production. While there is still some work to do to make production mode suitable for all database systems, this should not pose significant issues because RedBean’s production mode tries not to rely on database specific behaviours while RedBean’s development mode tries to use as much MySQL functions as possible.

RedBean only supports MySQL but comes with an adapter to fit other enterprise database systems. This adapter called ‘RedBean DB Adapter’ works out-of-the-box with ADO DB, you can download an ADO DB wrapper that works directly with ADO from the RedBean site.

Besides development mode and production mode (freeze), you can turn on debugging. This is not exactly a mode and it should of course only be used in development mode. To turn on debugging; open the RedBean oodb.php file and set ‘$debugmode’ to true. In debug mode RedBean will show you all MySQL SQL queries, MySQL resultset counts and MySQL errors.

Clone this wiki locally