Categories
Archives
Tags
Apache Apple Backups bash Birds Blending Boats Buzz Cameras Campfires Computers Corniche CPAN DNS Editors Efficiency Emacs EXIF Fire Firefox Food Google Hand Tools HDR HTTP iPad iPhone Lenses Macs Masjid My Software Optics Perl Photoshop PostProcessing Productivity Programming Saws Service Shell TaskForest Testing Tools VI Websites
My Software
-
RSS Links
Sometimes Text Files Are Better Than Databases
There are, however, many classes of applications for which text files are the preferred means of storing data. One of the main reasons is that when data is stored in a relational database, editing it is not a trivial task. A well-normalized database is not easily updated via an SQL command line. More often than not, a dedicated, graphical editor is needed to model the complex relationships.
Several years ago, when I wrote TaskForest, one of the initial design requirements was that it be easily configurable with just a shell prompt and one’s favorite text editor. Many of the servers I cared for for schools and non-profits were old boxes which I administered by logging into them via ssh. So when it came to designing job definitions and dependencies, I chose a text file representation. The benefits of text files over a graphical user interface for this include:
Choosing A Text Format
In the case of the TaskForest project, the most difficult task by far was choosing which text format to use. I went through several iterations trying to find one that was simple to read and write, and yet rich enough to model the domain space completely. What worked for me (and might work for you) was to ask myself how I would represent the data I’m trying to save given just a pencil and paper. Drawing in a notebook gave me the flexibility to sketch and edit easily, and once I had a good representation, converting that to a text file was a simple task.