Menu

#3 Separate log tables into separate database

open
Core (2)
3
2005-05-26
2005-05-26
No

In order to support the operation of multiple instances
of the data portal (with MySQL shadowing), the log
tables (logSession, logRecord and gbifUser) need to be
moved into a separate database so that each instance
can have its own copy.

This will not solve the problem of merging
registrations from the different instances of the
gbifUser table, or of generating integrated reports
which include the data from all sets of log tables, but
it is the first step.

The key problem is that at present the Configuration
class establishes a single DataBeanFactory instance,
and the DataBeanFactory implementations are each
related to a single database.

The Configuration therefore needs to support the
definition of a second DataBeanFactory (with database,
user and password) and returning this through a method
such as getLogDataBeanFactory. This method can return
the standard DataBeanFactory if the log factory is not
defined.

All calls to DataBeanFactory operations to
retrieve/write records in these tables then need to use
the correct instance. Some changes are also likely to
be required in the report component.

(The other alternative, although a little harder, would
be to use the Configuration to define properties used
by the DataBeanFactory to switch automatically to
different databases for different tables.)

The goal here is to develop something simple to serve
as a short-term fix to allow additional portal
instances while the main redevelopment work takes place.

Discussion