home contents changes options help subscribe edit (external edit)

Configuration of ZEO and ZODB with ZConfig

ZConfig is a format and API for configuration information. It can load configuration data from any resource addressable via URL and loadable using Python's urllib2 module. The format of the configuration files is roughly similar to that of Apache configuration files, supporting nested sections and key-value pairs. The ZConfig package is designed for extensibility should we need it down the road.

The ZConfig package on the Zope 2 trunk is a preliminary version and will not be used for this task. A substantial revision to ZConfig is being developed on the zconfig-schema-devel-branch of that package, and the effort to integrate with ZEO and ZODB is occurring in the branch of that package by the same name. Documentation is in the doc/ directory inside the package.

This proposal is to integrate Shane's DBTab into standard ZODB, but using ZConfig syntax and API for configuration.

Open Issues

No relevant ZConfig limitations are known.

Integration with ZEO/runsvr.py is still in progress.


chrism (Nov 5, 2002 3:07 pm; Comment #1) --

I've got config-file configurable ZODB information in the chrism-install-branch now. Here's what database configuration information looks like in the config file now:

  <zodb_databases>

    <database / >
      <storage>
        class              ZODB.FileStorage.FileStorage
        args               filename='var/Data.fs', name='Local Filestorage',\
                           create=0, read_only=0, stop=0, quota=0
      </storage>
      <connection>
        class              ZODB.Connection.Connection
      </connection>

      class                ZODB.DB.DB
      cache_size           5000
      pool_size            7
      quota_size           0
      read_only            off
    </database>

    <database /gub>
      <storage>
        class              ZEO.ClientStorage.ClientStorage
        args               addr='zeo://127.0.0.1:8001/', name='1',\
                           cache_size=20000000, wait=1, client_name='1',\
                           cachefile_dir='var'
      </storage>
        class              ZODB.DB.DB
        cache_size         5000
        pool_size          7
        quota_size         0
        read_only          off
    </database>

  </zodb_database>

The custom_zodb.py file is no longer necessary.

The name of a database section indicates its mount point.

I received several comments from Shane that have an effect on the current config strategy. These are outlined below:

  • databases may have more than one storage (ZRS). This requires that we allow multiple storages per database section.
  • the same database may need to be mounted in different places. This requires that the storage section name not be the mount point.
  • The use of Python syntax in the config file is suboptimal.

I intend to change the syntax to allow for the first two points.

With respect to Python syntax in config file, I think that without something like this , we're going to need to write argument converters for every possible kind of storage and keep them current in Zope itself, which seems wrong. It should be the responsibility of storage maintainers to keep the config argument conversion current, and for new storage creators to configure their storages via the config file without needing to change Zope to do so.



subject:
  ( 11 subscribers )