[ZODB-Dev] A different sort of ZODB backend

Greg Ward gward@mems-exchange.org
Wed, 20 Nov 2002 08:40:42 -0500


On 20 November 2002, Itamar Shtull-Trauring said:
> Objects table has columns: oid, className, dictID [points to Dicts
> table]
> Lists table: lid, index, valueType, value
> Dicts table: did, attributeType, attribute, valueType, valuevalueType,
> value
> 
> The result is a ZODB storage that can be queried and updated using SQL.
> You can I think add indexes for specific attributes on specific object
> types as well, but it's too late for me to be sure.
> 
> A number of questions:
> 1. Does this make sense at all? (it's 2am :)

It looks like a fairly sensible/obvious way to map Python objects onto
SQL.  Some questions:

  * how are dictionary keys handled?  is that what attributeType and
    attribute are?  if your dicts table can handle arbitrary dicts,
    I think those columns are misnamed

  * it might be a useful optimization to have a table for dicts with
    string keys, ie instance dicts.  That's obviously a very common
    sort of dict in a graph of Python objects, so probably worth
    optimizing.  (OTOH, premature optimization is the root of all
    evil...) 

  * what precisely do you put in the 'attribute' and 'value' columns?
    eg. is the Python integer 1 stored as an SQL integer, or as
    the SQL string '1', or what?

  * what is valuevalueType?

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org