GET /api/v2/video/1332
HTTP 200 OK Vary: Accept Content-Type: text/html; charset=utf-8 Allow: GET, PUT, PATCH, HEAD, OPTIONS
{ "category": "EuroPython 2012", "language": null, "slug": "python-without-filesystem", "speakers": [ "Arnaud Fontaine" ], "tags": [], "id": 1332, "state": 1, "title": "Python without filesystem", "summary": "[EuroPython 2012] Arnaud Fontaine - 3 JULY 2012 in \"Track Lasagne\"\n\n", "description": "Recent cloud architecture are heavily based on key-value storage databases\nrather than distributed filesystems. While the data itself is usually stored\nin scalable database, the source code is mainly kept on the filesystem.\nHowever, having the source code on filesystem raises a lot of issues for cloud\napplications and more generally for transactional web applications supposed to\nbe deployed on a large number of servers: Everytime the source code is\nmodified, it has to be synchronized on all the nodes somehow and the\napplication server must be restarted, therefore implying downtime or\ninconsistency. Usually, the developer cannot directly modify the source code\nas this task is left to the administrator. This talk will show how source\ncode, including modules and their classes, can be migrated away from\nfilesystem, thanks to import hooks, meta classes, reflection and\nmetaprogramming provided by Python, and the different challenges involved:\nTechnical: modules and classes must be loaded and reset while carefully\nconsidering concurrency and database issues and ensuring that the system will\nstay usable whatever happens and without breaking existing class instances.\nAlso, developers must be efficient with the new system, including convenient\nsource code edition and meaningful backtraces. Performance: having dynamic\nmodules and classes involved a performance tradeoff which should be kept to\nthe minimum. Security: as the source code is dynamically loaded from the\ndatabase, extra care must be taken care of compared to filesystem source code\nwhere the source code is never supposed to change once the applications has\nbeen started. In order to give practical examples of how this migration can be\nachieved, two examples will be studied and explain thoroughly, based on the\nexperience I have acquired through the implementation for ERP5 I have worked\non during the past year: First, through a basic WSGI application based on a\nlightweight web application framework to explain the basics behind having\nPython source code available in a transactional key-value storage database and\nmore precisely how modules and their classes can be dynamically loaded and\nreset on-demand upon modifications while keeping good performances. This\nusually involved specific features from the database point of view which will\nalso be discussed. Secondly, through ERP5 which is mainly known as an open\nsource ERP based on Zope and thus ZODB, and as such it provides features an\nERP typically provides, but it is also used for a wide range of other\npurposes. Therefore, this will give a more real-world example on how this\nmigration has been performed on a complex web application where 90% of the\ncode is going to be moved away from filesystem into the ZODB.\n\n", "quality_notes": "", "copyright_text": "Standard YouTube License", "embed": "<object width=\"640\" height=\"390\"><param name=\"movie\" value=\"http://youtube.com/v/xWY0UQn3dcA?version=3&amp;hl=en_US\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://youtube.com/v/xWY0UQn3dcA?version=3&amp;hl=en_US\" type=\"application/x-shockwave-flash\" width=\"640\" height=\"390\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed></object>", "thumbnail_url": "http://i.ytimg.com/vi/xWY0UQn3dcA/hqdefault.jpg", "duration": null, "video_ogv_length": null, "video_ogv_url": null, "video_ogv_download_only": false, "video_mp4_length": null, "video_mp4_url": null, "video_mp4_download_only": false, "video_webm_length": null, "video_webm_url": null, "video_webm_download_only": false, "video_flv_length": null, "video_flv_url": null, "video_flv_download_only": false, "source_url": "http://www.youtube.com/watch?v=xWY0UQn3dcA", "whiteboard": "", "recorded": "2012-07-04", "added": "2012-09-06T22:33:26", "updated": "2014-04-08T20:28:27.299" }