durusmail: durus-users: Sqlite and Postgres Storages
Sqlite and Postgres Storages
2007-08-24
Re: Sqlite and Postgres Storages
2007-08-24
Sqlite and Postgres Storages
Michael Watkins
2007-08-24
Thanks to Peter Wilkinson I developed an itch to scratch - I've
always wanted to implement a DBAPI compatible Storage for
experimentation. Attached is an abstract DBAPIStorage and two
concrete implementations, one for Sqlite (using native Python
sqlite3 DBAPI module or pysqlite2) and one for Postgresql (via
psycopg2).

I've done a little (very little) performance testing mostly to prove
out some ideas and I must say I'm very impressed with the Sqlite
behaviour - in limited testing its not much slower overall than
native FileStorage2 or ShelfStorage but has the great advantage of
almost instant start up time.

Postgresql is somewhat slower but at the client side consumes less
RAM with large object databases; it is noticeably slower for large
numbers of object commits however.

Itch scratched now; I didn't intend these to be production ready but
may add to them in time.

Cheers all,
Mike

reply