?

Log in

No account? Create an account
Data::ObjectDriver - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Data::ObjectDriver [Jun. 7th, 2005|09:11 pm]
Brad Fitzpatrick
[Tags|, , , , ]

Ben somehow tricked me into working on yet another project ... he wants me to adapt their MT ObjectDriver code into something more generic that abstracts away database partitioning, memcaching, etc. And then filtering/joins/etc too.

The end result, as pseudo-planned, will look like a mix of MT/TypePad's ObjectDriver code, plus kinda like Class::DBI, but layered...

Data::ObjectDriver
Data::ObjectDriver::Driver
Data::ObjectDriver::Driver::Cache
Data::ObjectDriver::Driver::DBI
Data::ObjectDriver::Driver::DBI::mysql
Data::ObjectDriver::Driver::DBI::postgres
Data::ObjectDriver::Driver::Paritions
Data::ObjectDriver::Proxy
Data::ObjectDriver::CachePolicy
Data::ObjectDriver::Schema

The Cache one lets you define a cache callbacks for loading/setting/deleting primary keys. (for e.g. memcached). So loads come from cache, else get passed down to a lower-level driver. Sets delete from cache, then get proxied to lower-level driver. The DBI ones lets you connect to databases and do range queries and such, the partition one lets you define a callback that given an object, returns a new driver.

etc. etc.

I've wanted something like for a long time but have been too scared to try. Given that people successfully use Class::DBI and MT/TypePad run on MT's ObjectDriver stuff, it should be fine.... it'll be an interesting project.

The plan is to open source it all (terms of Perl itself), so if it works out, LiveJournal will use it too, and clean up a lot of our data-handling code, hopefully.

But this is like 5 projects down the road. I keep bouncing back and forth. I've recently started working on Gearman again, now that OpenID is settling a bit.
LinkReply

Comments:
[User Picture]From: hughe
2005-06-08 09:09 am (UTC)
ah thats what i'm missing... the coffee.

and the air conditioning.
(Reply) (Parent) (Thread)