Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

Discovered the killer combo of Pysqlite and SQLObject

June 8th, 2006 · 2 Comments

Light BulbAt work, I’m doing a bunch of data acquisition on various machines outside the firewall. I think I’ve hit on an absolutely great combination of Python technologies to do this in a really manageable and scalable manner.

The design constraints:

  • No long-running processes. These are heavily loaded boxes. The data acquisition will run via scheduled cron jobs.
  • No new ports open. I can’t run Mysql on these boxes.
  • No drilling back from these servers into the corporate network. So I can’t run mysql inside and connect from the outside.

The plan

  • Each remote box will run a small python app on a scheduled basis, writing its data to a single file.
  • A "gatherer" system inside the firewall will retrieve the files from all remote machines on an hourly basis.
  • On acquisition, the remote files will be removed.
  • The gatherer process will then merge the remote data into a master Mysql database for reporting.

The technologies

  • PySqlite: will provide access to an on-the-fly generated database file on remote machines.
  • SQLObject: can talk to both PySqlite and Mysql. I simply define the object model using its scheme, and it will happily generate the tables for me in both Sqlite and Mysql. Writing the merge process was the trickiest bit, but it only took a few hours to write and test.

Conclusion

This was an extremely fast development path. I was all the way from concept to deployment in just three days, and I didn’t even know anything about SQLObject or Sqlite at the start.

Contrast that productivity to Java, where a similar project would take at the minimum a couple weeks, and you start to see why I think that Python has become the secret weapon in my developer toolbox.

Technorati Tags: , , ,

Tags: Design · Libraries · Python

Bookmark this article

del.icio.us:Discovered the killer combo of Pysqlite and SQLObject digg:Discovered the killer combo of Pysqlite and SQLObject spurl:Discovered the killer combo of Pysqlite and SQLObject wists:Discovered the killer combo of Pysqlite and SQLObject simpy:Discovered the killer combo of Pysqlite and SQLObject newsvine:Discovered the killer combo of Pysqlite and SQLObject blinklist:Discovered the killer combo of Pysqlite and SQLObject furl:Discovered the killer combo of Pysqlite and SQLObject reddit:Discovered the killer combo of Pysqlite and SQLObject fark:Discovered the killer combo of Pysqlite and SQLObject blogmarks:Discovered the killer combo of Pysqlite and SQLObject Y!:Discovered the killer combo of Pysqlite and SQLObject smarking:Discovered the killer combo of Pysqlite and SQLObject magnolia:Discovered the killer combo of Pysqlite and SQLObject segnalo:Discovered the killer combo of Pysqlite and SQLObject gifttagging:Discovered the killer combo of Pysqlite and SQLObject

2 responses so far ↓

  • 1 Andrew // Jun 9, 2006 at 8:56 pm

    I agree. I’ve used the pysqlite/SQLObject combination in many many things. It’s wonderful.

  • 2 Henry // Mar 11, 2008 at 5:54 pm

    You seem to have a typo in your blog’s banner. “Bruce Kroeze” (you missed the quote beside B).

    Apologies if this is on purpose and I’m not getting it :)

Leave a Comment