pse2010 rel storage

20
sixfeetup.com/deploy2010 open source nowhere to go but Plone Symposium East 2010 Plone on RelStorage Lars R. Noldan

Upload: lars-noldan

Post on 10-May-2015

1.799 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Pse2010 rel storage

sixfeetup.com/deploy2010

open sourcenowhere to go but

Plone Symposium East 2010

Plone on RelStorageLars R. Noldan

Page 2: Pse2010 rel storage

sixfeetup.com/deploy2010

Overview

• How does Zope store data

• Why RelStorage?

• How to implement RelStorage

• Some reasons not to use RelStorage

Page 3: Pse2010 rel storage

sixfeetup.com/deploy2010

Zope Storage Methods

Page 4: Pse2010 rel storage

sixfeetup.com/deploy2010

What is the ZODB?

• Object oriented database

• Used by Zope to hold everything from contentto scripts, to service configurations

Page 5: Pse2010 rel storage

sixfeetup.com/deploy2010

What is Filestorage?

• The default backend for Zope/ZEO

• var/filestorage/Data.fs

• Does an in-memory index at startup

• Data appends to the end

• Back-up utility is Repozo

Page 6: Pse2010 rel storage

sixfeetup.com/deploy2010

What is RelStorage?• Drop in replacement

• Replaces ZEO

• Eliminates Data.fs

• Stores pickles

• Is still ZODB

• Uses relational databases

Page 7: Pse2010 rel storage

sixfeetup.com/deploy2010

Why Change?

Page 8: Pse2010 rel storage

sixfeetup.com/deploy2010

Advantages of RelStorage

• Existing infrastructure

• Existing expertise

• Wide range of management tools

• High availability, high performance clusters

• No in-memory index at startup

• Scales well as your database grows

Page 9: Pse2010 rel storage

sixfeetup.com/deploy2010

Databases Supported• MySQL 5.0.32 or better

• MySQLdb >= 1.2.2

• PostgreSQL 8.1 or better

• psycopg2

• Oracle 10g

• cx_Oracle

Page 10: Pse2010 rel storage

sixfeetup.com/deploy2010

How Do I Install It?

• For MySQL add the following to buildout.cfg:eggs = RelStorage MySQL-Python

fake-eggs = ZODB3 = 3.7.1

[instance] type mysql db plone user plone host localhost password terriblepassword

Page 11: Pse2010 rel storage

sixfeetup.com/deploy2010

How Do I Install It? Cont.

• For PostgreSQL add the following to buildout.cfg:eggs = RelStorage

fake-eggs = ZODB3 = 3.7.1 psycopg2

[instance] type postgresql dbname plone user plone host localhost password terriblepassword

Page 12: Pse2010 rel storage

sixfeetup.com/deploy2010

Available Tools

• zodbconvert

• Converts from filestorage to {mysql/pgsql/oracle}

• Convert from {mysql/pgsql/oracle} to filestorage

• Convert from one Database to another (ie: mysql to oracle)

Page 13: Pse2010 rel storage

sixfeetup.com/deploy2010

zodbconvert.conf

<filestorage source> path /opt/default/zinstance/var/filestorage/Data.fs</filestorage>

<relstorage destination> <mysql> db plone user plone passwd terriblepassword </mysql></relstorage>

Converting from filestorage to MySQL

Page 14: Pse2010 rel storage

sixfeetup.com/deploy2010

Running zodbconvert

lnoldan$ sudo /opt/mysql/zinstance/bin/zodbconvert --clear zodbconvert.conf

Storages opened successfully.All transactions copied successfully.

Page 15: Pse2010 rel storage

sixfeetup.com/deploy2010

What’s the Catch?

Page 16: Pse2010 rel storage

sixfeetup.com/deploy2010

There Are Pitfalls

• Added complexity

• Additional server load

• Additional memory utilization

• The database is full of pickles, not plain text

• Your database still needs to be packed

Page 17: Pse2010 rel storage

sixfeetup.com/deploy2010

What We Talked About

• Zope storage engines: ZEO and RelStorage

• Why you might choose RelStorage

• How to install RelStorage

• Tools for RelStorage

• Why you might not use RelStorage

Page 18: Pse2010 rel storage

sixfeetup.com/deploy2010

Links

• http://pypi.python.org/pypi/RelStorage/1.4.0b3

• http://shane.willowrise.com/archives/relstorage-1-4-0b1-and-zodbshootout

Page 20: Pse2010 rel storage

More info at:sixfeetup.com/deploy2010

sixfeetup.com/deploy2010