Stowaway

on 28 February 2008 at about 18:37

Flexible structures

Not being a Com Sci graduate has never worried me before, despite the fact that a lot of my work revolves around code: I build web-based applications such as content management systems and learning support tools, and I teach coding skills to students learning to create Interactive Media projects. These projects all live in a domain fairly high up the hardware stack, and sure, it's a domain which is looked on as a poor relative by 'real' programmers who think of Flash and PHP and the like as the place where 'script-kiddies' hang out. And we kiddies rely on the hardcore skills of those 'real' programmers who interface with the chips, manage the hardware, and protect us from the buffer overrun. We're not likely to induce a BSOD (blue screen of death) from our AJAX fluff, and when the consequences of our code expands like gas because we don't care whether we're making copies or passing references, the admin-God just kills our allocated processes and all is well.

However, the lack of a formal grounding in some of the computing paradigms does rear its ugly head from time to time, such as when you first discover that your code doesn't work because you don't know that you're creating copies, rather than passing references, or you have no idea why your floating point number is different every time. It's recently reared its head in a project I've been working on, because I'd never really thought very deeply about databases before. I mean, if you want to store something, what more do you need than a filesystem and a RDBMS?

I've been working on a data management system, which I've been hoping will make my life a great deal easier. The idea follows from the repetitive tasks I carry out in each project: reusing very similar pieces of code every time I work on a project, but needing to make small adjustments in every case. For example, websites where users add content require code which matches input to a database schema and makes the transaction. Structurally these objects are almost identical, but in each scenario the nature of the information stored is always slightly different. So in each project, some time needs to be spent designing the schema, and repurposing code to fit the nature of the information stored, how it is accessed, etc. So the idea is that if I build a data management layer, I can keep reusing the same code to manage the validation, form creation, retrieval and transactions. All that needs to change in each project is some set of templates which define what kind of information will be stored. This is all so far, so good.

So, in the case of a blogging tool, the definition of what a blog post consists of is being moved from the functional code to a templating system. This system can then be reused in projects where the data entities are things other than blog posts - learning objects, for example, or journal articles, or images with metadata, etc. This all seems so fine, that the awesome idea occurred to me that if I were to make the templating system flexible enough that users could define their own templates, then the whole layer could become an open source software project which others might find useful for creating their own web applications, whether they were creating communal blogs, data repositories, picture galleries, indeed - anything which would require users to input data as defined by the owners of the site.

This is the point at which my inexperience began to unravel my progress. In principle, there is nothing wrong with the notion of introducing this much flexibility into the data layer. However, I hadn't really considered the consequence that such flexibility would have on my idea of structure. Relational databases are the only way I really know how to store data on a server in a form that is quickly retrieved. Relational databases are designed for highly structured data (and of course, a 'template' is effectively a way of describing highly structured data). So I set about thinking about how I could make database schemas and transactions flexible enough to allow multiple templates with a potentially infinite number of component parts (titles, authors, links, pictures, locations, tags, pet-names, ids, descriptions, paragraphs, dates, geo-tags, semantic-web-entities, files, bibliographical data, the list is of course potentially infinite). The solutions which presented themselves all seemed to increase complexity exponentially, and I feared creating a monster system which would hog resources, whether it was due to joining countless tables in the RDBMS, or accessing multiple flat XML files in each page request, or simply filling memory with endless bloat. Maybe all of these potential problems would be not be an issue. But given that I was trying to create a system for many possible uses, how could I possibly know? Here's part of the problem I've found in terms of taking code you use to do one thing, and trying to make it flexible enough for others to use for other purposes: is it possible to write code that does one thing well, and then make it do anything well?

A moment of clarity occurred recently: I'd been following Damian Katz's updates on CouchDB for a while and finally got round to reading the wiki documentation for his system, and a sentence leapt out at me, and made me realise why I was having so much trouble:

"Unlike SQL databases which are designed to store and report on highly structured, interrelated data, CouchDB is designed to store and report on large amounts of semi-structured, document oriented data. CouchDB greatly simplifies the development of document oriented applications, which make up the bulk of collaborative web applications.

[CouchDB Documentation]


Thank you for showing me the wood! How do you create flexible structures? What is a flexible structure? The fact that I'd never considered there to be any possibility other than storing data in a RDBMS meant I didn't even know that was the question I was trying to answer. It's pure Hobbes vs Rousseau, in code. And btw, I don't yet know the answer.

Archive

  • The Power of Maps (26 August 2015)
  • Gaps in the digital fossil record (5 August 2015)
  • 'feedparser.py', Kurt McKee & Mark Pilgrim (11 May 2013)
  • 'Better Stakeholder Interviews', Chris Cashdollar, Happy Cog (10 May 2013)
  • Wordpress, menus and Suhosin (28 June 2011)
  • More on storing directions for google maps (9 May 2011)
  • Profile (7 May 2011)
  • GMaps and storing directions (6 May 2011)
  • gibbetware (14 July 2010)
  • fibbitware (13 July 2010)
  • some notes on sound (24 August 2009)
  • Hauntology: Intellectual development #1 (16 June 2009)
  • hauntology (19 May 2009)
  • On Atavism and Enlightenment (10 November 2008)
  • land's end closed bridge danger - [Flickr:Places-And-Non-Places] (11 September 2008)
  • Homo Googlens (11 September 2008)
  • land's end vacant picnic tables - [Flickr:Places-And-Non-Places] (11 September 2008)
  • land's end facade - [Flickr:Places-And-Non-Places] (9 September 2008)
  • land's end private welcome - [Flickr:Places-And-Non-Places] (9 September 2008)
  • beach at night - [Flickr:Places-And-Non-Places] (24 July 2008)
  • Pixel Pier (30 May 2008)
  • housman (30 May 2008)
  • Pixel Pier: BAIMP Grad Show 08 (26 May 2008)
  • Arcade - [Flickr:Places-And-Non-Places] (20 May 2008)
  • Atrium - [Flickr:Places-And-Non-Places] (18 May 2008)
  • Seats - [Flickr:Places-And-Non-Places] (18 May 2008)
  • Places and non-places (15 May 2008)
  • Pythonesque (5 May 2008)
  • Open Flash (30 April 2008)
  • Facebook Facework (27 April 2008)
  • Pixelate the world (23 April 2008)
  • Phenomenology, positivism, and prozac (19 March 2008)
  • Hello world, my imagination (15 March 2008)
  • Community of Scholarly Practice (14 March 2008)
  • Inflexible structures (29 February 2008)
  • Flexible structures (28 February 2008)
  • Foucauldian Confession (20 February 2008)
  • The Writerly Text: Part 1 (1 February 2008)
  • Musings on Plagiarism (6 November 2007)
  • Emancipatory Power of Online Spaces (20 October 2007)
  • Splat Pedagogy (12 July 2007)
  • New Blood awards for Media School finalists (29 June 2007)
  • iheartplay: BAIMP Grad Show (6 June 2007)
  • BBC still innovative, says Highfield (16 May 2007)
  • Transmediale.07, Berlin (6 February 2007)
  • Vive la revolution! (30 January 2007)
  • Vive la Revolution (30 January 2007)
  • Biblipedia beta site (27 January 2007)
  • Fornicate with your actual genitals (27 January 2007)
  • Fornicate with your actual genitals (23 January 2007)
  • Awesome 2007 (16 January 2007)
  • Awesome 2007 (16 January 2007)
  • The Paedo-net (11 December 2006)
  • unprofessional and without redress (4 December 2006)
  • unprofessional and without redress (4 December 2006)
  • Smartlynchmobs (27 November 2006)
  • Smartlynchmobs (27 November 2006)
  • This blog will fuel a crisis in politics (20 November 2006)
  • I am in ur website, writin ur nooz (13 November 2006)
  • I am in ur website, writin ur nooz (13 November 2006)
  • myNews (30 October 2006)
  • newsTube (22 October 2006)
  • GooNews (15 October 2006)
  • GooNews (15 October 2006)
  • Satan (Democrat - Florida) (9 October 2006)
  • The CEMPle News Project (8 October 2006)
  • newsPod (2 October 2006)
  • newsPod (1 October 2006)
  • The experimental wing of political philosophy (19 May 2006)
  • Hobbes and Rousseau and Digital Media (19 May 2006)
  • We Media and the great blogging hoax (3 May 2006)
  • Don Chihuahua (30 April 2006)
  • No Fact Zone (30 April 2006)
  • Beeb and us (25 April 2006)
  • My Virtual Money (25 April 2006)
  • SOA (6 April 2006)
  • postel's law and nicotine (30 March 2006)
  • This week: Retro Contrafabulation (26 March 2006)
  • Biblipedia consultation (22 March 2006)
  • This week: The Machine Gun of Reasoned Discussion (18 March 2006)
  • This week: Noah, the Logo Weenie (3 March 2006)
  • stowaway music update (27 February 2006)
  • This week: newsr (24 February 2006)
  • This week: There's More Than One Way to Eat a News (17 February 2006)
  • Web 2.0 is the new Marxism (16 February 2006)
  • Biblipedia Vision and Scope document (12 February 2006)
  • macs, samba and XP (11 February 2006)
  • This week: reintermediate leading-edge eyeballs (10 February 2006)
  • Blog aggregator (10 February 2006)
  • Biblipedia scope (8 February 2006)
  • This week: newsCoat (3 February 2006)
  • This week: xoxbox (27 January 2006)
  • User-contributed content and quality (23 January 2006)
  • Folksonomies and collaborative organisation (23 January 2006)
  • Annotatable Audio (23 January 2006)
  • SCORM (17 December 2005)
  • Edition disambiguation (17 December 2005)
  • Plagiarism issues (17 December 2005)
  • MAG Consultation (17 December 2005)
  • COPAC (17 December 2005)
  • CathBond.com design (12 December 2005)
  • Biblipedia Protoype (10 December 2005)
  • Bibliographical data integration (4 December 2005)
  • Biblipedia project updates (4 December 2005)
  • Social bibliography tool (27 November 2005)
  • Biblipedia (19 November 2005)
  • Welcome (18 November 2005)
  • Menticulture (30 May 2005)
  • okay, so no post for 3 years (5 April 2005)
  • New Documentary Media (27 October 2004)
  • LCF Multimedia Option Exhibition 04 (28 June 2004)
  • Room (4 August 2003)
  • 3D Solar System - part II (8 July 2003)
  • LCF Multimedia Option Exhibition 03 (19 June 2003)
  • Total Theatre Workshop Company (24 May 2003)
  • Horse (21 December 2002)
  • Dancing Joe (11 October 2002)
  • The Buroughs cut technique (11 October 2002)
  • Nature Girl (5 September 2002)
  • Villainess (11 August 2002)
  • LCF Multimedia Option Exhibition 02 (27 June 2002)
  • Cleggan Bay (13 June 2002)
  • Hierarchical Menu (2 June 2002)
  • threeDworld (25 May 2002)
  • Jack and the Polar Bear (22 May 2002)
  • Lough Corrib (17 May 2002)
  • This whole website is superb, as is the article ... (30 April 2002)
  • Another prolonged absence, I'm afraid (28 April 2002)
  • Sunset (9 April 2002)
  • Tapioca Balls (8 March 2002)
  • Dunguire Boat (6 March 2002)
  • bet you didn't know that road signs are also ... (20 February 2002)
  • 3D Solar System (9 February 2002)
  • Songs For Andrew (30 December 2001)
  • Dreamweaver Tutorial (8 October 2001)
  • Why blog the events unfolding in America myself ... (13 September 2001)
  • Well thanks to the pages of The Guardian's ... (29 August 2001)
  • Very pretty pictures of space ;) (15 August 2001)
  • Very cool stuff from FFF (8 August 2001)
  • I have to say I thoroughly approve of this ;) (7 August 2001)
  • "I made you some coffee" (26 July 2001)
  • LCP - Intro to web design (10 July 2001)
  • This has got to be one of the most wonderful ... (5 July 2001)
  • What more can you ask for than a site which links ... (4 July 2001)
  • Well, now I've become a late Flash convert (23 June 2001)
  • LCF Multimedia Option Exhibition (15 June 2001)
  • Sourced from the pages of the somewhat poncey web ... (13 June 2001)
  • Fucking superb (16 May 2001)
  • Okay the fight link listed below has disappeared ... (2 May 2001)
  • Okay (30 April 2001)
  • Sites like this almost make you want to pack up ... (15 April 2001)
  • Most amusing from the halfbakery (5 April 2001)
  • This is another cute site (16 March 2001)
  • I've no idea why, but I guess it's time to ... (16 March 2001)
  • Absolutelely fascinating article by Jon Ronson ... (10 March 2001)
  • Very, very groovy site playing with Shockwave toys (16 February 2001)
  • From Gilbert and George's site (16 February 2001)
  • Well hello February (16 February 2001)
  • This is a cute site with early photos capturing ... (8 February 2001)
  • Okay (5 January 2001)
  • Mmmm (14 December 2000)
  • "This is ridiculous" ... (14 December 2000)
  • Okay, suffice to say I bottled my prank at the end ... (11 December 2000)
  • Incidentally, this is the unspeakably shite ... (10 December 2000)
  • Ahh, Sunday afternoons (10 December 2000)
  • The new release of Netscape 6 is so much better ... (7 December 2000)
  • new life on Mars ... (7 December 2000)
  • Time for some geek links (7 December 2000)
  • Now this is a stowaway kind of site (30 November 2000)
  • This is where I work (30 November 2000)
  • EEEuuuuwwwrrrgggghhh (29 November 2000)
  • My absence has been due to my uncle Fred dying (28 November 2000)
  • Actually, the tribune page below is only cool in ... (28 November 2000)
  • Okay I have to agree with tom@plasticbag (23 November 2000)
  • An old joke but a good one, Ben (22 November 2000)
  • hey its turning into a good day for homepages (20 November 2000)
  • Absolutely superb website (20 November 2000)
  • And while I'm on it, wasn't 4AD the best ... (19 November 2000)
  • Recently rediscovered Throwing Muses after leaving ... (19 November 2000)
  • Went to see Simon Russell Beale in Hamlet at the ... (19 November 2000)
  • Many thanks to Peter who brought Untitled Document ... (17 November 2000)
  • It's been a good 24 hours for amazing natural ... (16 November 2000)
  • Oh God I'm disappearing under a mountain of ... (14 November 2000)
  • Now, I'm not a war kind of person (11 November 2000)
  • Laugh? I nearly lost it at a site I found while ... (10 November 2000)
  • Good grief ... (10 November 2000)
  • it has to be /usr/bin/girl that gets the ... (4 November 2000)
  • ok, so now i've got the damn thing running (4 November 2000)
  • So, if you're wondering how (31 October 2000)
  • Huzzah!! The next / previous tags are working!!! (31 October 2000)
  • Oh, and if you're still looking at ~/index (27 October 2000)
  • Okay, so this is number 13, and we're only ... (27 October 2000)
  • ummm (27 October 2000)
  • Now, this is number eleven (23 October 2000)
  • Okay, this is entry 10 (23 October 2000)
  • etc (23 October 2000)
  • This, of course, will be entry number 5 (23 October 2000)
  • This is entry four in the stowaway blog database (23 October 2000)
  • This is entry three in the stowaway blog database (13 October 2000)
  • This is entry two in the stowaway blog database (13 October 2000)
  • This is entry one in the stowaway blog database (13 October 2000)
  • Small Print

    Joe Flintham 2000 - 2015

    Long form: Menticulture

    Professional Services: Fathom Point