Re: Which data structure to use for semi static data?

Sebastian Kanthak
2005-05-30T18:44:47Z

Matthew Margolis wrote:

> With this knowledge how would you recommend that I store my hierarchy
> in my application?  It doesn''t change very often so I was thinking
> that maybe I should not throw it in the db.  If I keep it purely in
> code as some sort of class or hash structure then I won''t have to
hit
> the db so often and initial setup could be done inside of a text
> editor as opposed to the having to use funky sql syntax or slow
> phpmyadmin record entry forms.
>
you could put it into a YAML file that is loaded upon startup of your
application (e.g. from environment.rb). This way, you only need to parse
the file once. Of course this means, you''ll have to restart your webapp
whenever you change the data.

Sebastian