[ZODB-Dev] DBTab mounts

Shane Hathaway shane@zope.com
Wed, 19 Feb 2003 22:59:00 -0500


On 02/19/2003 06:28 PM, Adrian van den Dries wrote:
> On February 19, Shane Hathaway wrote:
> 
>>>But again, I feel it necessary to give you great thanks for making such an
>>>extremely flexible and powerful product.
>>
>>You're welcome.  Hopefully, Zope 2.7 will integrate DBTab's functionality.
> 
> 
> This would be fantastic, but I'd like to make a couple of suggestions.
> 
> Because there is a 1:1 relationship between [Storage] and [Database]
> clauses, why not just merge them into one clause?  These are really
> two parts of one configuration and you really want to enforce
> proximity.  Separating them would suggest that you can reuse a Storage
> for another Database or vice versa.  This would more closely follow
> the fstab analog, where the Storage options are like the
> filesystem-specific options:
> 
>   [MyDatabase: FileStorage]
>   Mounts: /Foobarbaz/Bazbarfoo;
>           /Foobarbaz/Barbazfrob
>   CacheSize: 5000
>   FileStoragePath: /path/to/data.fs
>   FileStorageCreate: yes

I separated them to meet the demands of ".ini" format, which is quite 
limiting.  Both ClientStorage and DB accept a cache_size argument, but 
the two arguments mean different things.  There may be more clashes.  So 
database and storage config had to be distinct.

Zope 2.7 will solve this: it provides the new ZConfig infrastructure, 
which uses Apache-format config files, allowing us to nest a <storage> 
section inside a <database> section.  Most of that work is already done, 
in fact.

Once we can configure databases using ZConfig, the only thing DBTab 
provides that Zope 2.7 will need is the new mounting code.  DBTab's 
mounting code is now simpler, safer, and faster than the mounting code 
in Zope, so I can't wait to get this done.

> Secondly, and more importantly, Storages should be modular, allowing
> the user to add her SooperDooperInhouseStorage without having to hack
> on the product, probably just by registering the storage:
> 
>   from Product.DBTab import StorageTypes
>   StorageTypes.addStorage('MyStorage',
>                            'MyStorage.MyStorage'
>                            convertMyStorageArgs)

ZConfig also provides a way to add new storage types using configuration 
instead of Python code.

Shane