Tramline ======== This presentation is based on a lightning talk at the Plone Conference 2005 in Vienna by Martijn Faassen. It has since been updated. Introduction ------------ * Upload and download accelerator for Zope (2 or 3) * Plugs into the Apache HTTP server. * Large file data not stored in the ZODB * Railroad's little sister Why tramline? ------------- * railroad powerful repository * WebDAV, metadata, multi-CMS, search * but complicated integration with applications Tramline Goals -------------- * Deliberately limited goals * Fast uploads and downloads of files * Store large file data in filesystem, not ZODB * Easy to integrate with any application * No need to cut down forests for a tramline Design ------ * Plugs into Apache with mod_python * Simple setup in Apache * Works with any form that uploads files * Need two one-liners in your applications to make it work Upload one-liner ---------------- In response header to upload form, send out 'tramline_ok' header (no contents):: response.addHeader('tramline_ok', '') If that's not sent, tramline throws away the file. So, if application raises error, user is unauthored, etc, file is thrown away. Upload continued ---------------- * File received by the server is just an id string, very short, ZODB can scale to store these easily. :) * Can store this just as any other file Download -------- * serve up file (the id) by returning the content, just like any other file * Add a response header 'tramline_file' (another oneliner) Performance ----------- * Tested with chandler tarball, 26 megs of file * This is really fast Drawbacks --------- * Needs latest stable Apache (2.0.55) (mod_proxy inputfilter bugfixes needed) * Needs 1 line patch to mod_python * Reported inputfilter problem to mod_python developers Interesting benefit ------------------- * You can now do ridiculously unscalable things, scalably * Can stuff files in sessions! * Can base64 encode files on page! * hurry.file makes use of this property of tramline Conclusion ---------- * Tramline is fast and easy * Use it when you need fast upload and download and filesystem storage of large files