News for hackers. Stuff that matters.
Re:What are the best non-database solutions you've seen? Wha... by ntoshev on Thursday April 19, 2007 @11:56AM (#14643)
It is interesting how flat files can manage the evolution of the data structures you use? Any advice?
Re:What are the best non-database solutions you've seen? Wha... by vikram on Saturday April 21, 2007 @10:23AM (#15481)
Use hashtable for everything. So Person who has a name address age and occupation is represented as a hashtable with those fields. When you want to add a new field like emailaddress it's just another key in the hashtable.

Ideally you want to code the person accessors so that they still specific externally

person-name person-age

the rest of the program uses these so it becomes easy to move person to a different structure if that's what you want .

You want to write some function to read a hash-table and write on to disc. In lisp this is trivial, but most languages have some sort of serializer. Then a function to load all the hash tables up when you start up.

Re:What are the best non-database solutions you've seen? Wha... by brlewis on Thursday April 19, 2007 @03:40PM (#14740)
If I understand your question you're wondering how to deal with older flat files when your app expects a newer data structure.

If you're using s-exprs make your structure a list where the first element is a version identifier. If you aren't using s-exprs then use some other extensible format like XML.