You are not logged in Log in Join
You are here: Home » Members » adytumsolutions » How To Love ZODB and Forget RDBMS - Part V

Log in
Name

Password

 

How To Love ZODB and Forget RDBMS - Part V

 

Created by adytumsolutions . Last modified 2004-03-17 04:19:19.

So, We Can Look at Transactions 'n' Stuff?
  1. Introduction
  2. Creating/Opening a Stand-alone ZODB
  3. Adding Data to a ZODB
  4. Retrieving Data from a ZODB
  5. Using the ZODB Tools to inspect the ZODB
  6. Using the ZODB Tools to Backup and Recover the ZODB
  7. Using Stand-alone ZEO to Allow Many Connections
  8. Acknowledgements

-== Note: Work in progres ==-

I am publishing this page as a notice similar to "Road Closed Ahead", so that people following this tutorial don't come crashing into a brick wall at the end of Part IV. I am hoping to finish this series up soon - I do truly understand the need for the material to be explained in a lucid, friendly fashion and don't see this merely as a luxury.

For now, this "road block" is little more than very unfriendly, as I am publishing this unfinished work. It's been stubbed out with commands and the output from the database we created together in the previous parts. The intention is to fill these stubs out with eplanatory comments and deep, meaningful comments ;-)

What I encourage you to do is the following:

  1. use the tools as shown below, against your newly created database
  2. open up your database in python and make some more changes to it
  3. run the tools again to see the differences
  4. make a copy of your Zope Data.fs file (or use an old one) and run the tools against that... this will be very educational; it's like getting a glass-bottom boat tour of the ZODB and Zope :-)
  5. enjoy :-)

-== End of Caveat ;-) ==-

Let's use some tools that come with ZODB to peer inside the FileStorage Database file we created in Parts II to IV. Where

This command:

 cd ZODB/Tools
 python analyze.py /tmp/pymonitor.fs

gives the following output:

    Processed 3 records in 2 transactions
    Average record size is  198.67 bytes
    Average transaction size is  298.00 bytes
    Types used:
    Class Name                                       Count    TBytes    Pct AvgSize
    ---------------------------------------------- ------- ---------  ----- -------
    ...PersistentMapping at 76a020>                      2       189  31.7%   94.50
    BTrees.OOBTree.OOBTree                               1       407  68.3%  407.00
    ============================================== ======= =========  ===== =======
                                Total Transactions       2                    0.29k
                                     Total Records       3        0k 100.0%  198.67
                                   Current Objects       2        0k  90.1%  268.50
                                       Old Objects       1        0k   9.9%   59.00

This command:

 python checkbtrees.py /tmp/pymonitor.fs

gives the following output:

    <root> {'monitoring_db': <OOBTree object at 0x1129ad8>}
    ['monitoring_db'] <OOBTree object at 0x1129ad8>
    total 2 found 2

This command:

 python fsdump.py /tmp/pymonitor.fs

gives the following output:

    Trans #00000 tid=03535bbb7ea34444 time=2004-02-28 06:19:29.680725 offset=52
            status=' ' user= description=initial database creation
      data #00000 oid=0000000000000000 class=Persistence.PersistentMapping 

    Trans #00001 tid=03535bbb7eda33bb time=2004-02-28 06:19:29.731020 offset=184
            status=' ' user= description=
      data #00000 oid=0000000000000000 class=Persistence.PersistentMapping 
      data #00001 oid=0000000000000001 class=BTrees.OOBTree.OOBTree 

This command:

 python fstail.py /tmp/pymonitor.fs

gives the following output:

    2004-02-28 06:19:29.731020: hash=ac5f648667fcf05c491b26976ed62dc8e700cfb3
    user='' description='' length=644

    2004-02-28 06:19:29.680725: hash=dd324326a5424573716c7155be1f88f99cc96bba
    user='' description='initial database creation' length=149

This command:

 python netspace.py /tmp/pymonitor.fs

gives the following output:

       1   407      407 monitoring_db BTrees.OOBTree.OOBTree

This command:

 python space.py /tmp/pymonitor.fs

gives the following output:

 Totals per object class:
       1      407 BTrees.OOBTree.OOBTree
       1      130 Persistence.PersistentMapping

On to Part VI

Comment

Discussion icon namespace.py raises ImportError on referencesf

Posted by: jsack at 2006-08-31

per suggestion found at http://comments.gmane.org/gmane.comp.web.zope.plone.versioning/275

blindly changing the import to "from ZODB.serialize import referencesf" seems to make it work again

Regards ..jim