On Mon, 29 Sep 2008 17:04:29 -0400 "Perrin Harkins" <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 29, 2008 at 3:00 PM, Mark Stosberg <[EMAIL PROTECTED]> wrote: > > We have a large, busy, database application that relates to millions of > > photos, which we also need to store and display. > > Have you read Cal Henderson's book about how Flickr works? It looks familiar, but I don't think I've read it. I've bookmarked it now. Thanks for the suggestion, Perrin! If I find anything "interesting" about our inconsistency, I'll report back. I was just reviewing the code flow of 'store_upload()' in CGI::Uploader: http://search.cpan.org/src/MARKSTOS/CGI-Uploader-2.15/lib/CGI/Uploader.pm The key part I see is for the 'update' case where we: 1. Delete old generated files (like Thumbnails) 2. Run the DB update 3. Regenerate the thumbnails. The DB update failed, we couldn't "undelete" the thumbnails. That design could perhaps could be improved. Also, I see that this code doesn't use transactions, I think because it expects that the outer application code may wrap this work in a larger action. With current DBD::Pg and PostgreSQL versions, I could add some "savepoints" here, to make some parts of this more transactional (like inserting a photo and all of it's thumbnails in the same in one transactions). The savepoint could would be specific to using the PostgreSQL driver, as I'm not aware that other DBs support the same syntax. Other ideas for improvements here are welcome. Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark Stosberg Principal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . .