On May 14, 2011, at 12:55 AM, Simon J Mudd wrote: > Hi John, > > While you obviously disagree with me, thanks for taking the time to > reply. I may be looking at the problem the wrong way which is why > I'm trying to figure out if that's the case and why. > > john.bollin...@stjude.org (jcbollinger) writes: > >> On May 13, 8:07 am, jcbollinger <john.bollin...@stjude.org> wrote: >> 2) You would prefer looking up data via a compound key (config_item, >> lookup_value) rather than via a simple key (config_item). You rightly >> observe that this would sometimes allow fewer files to be used than >> are needed in the current implementation, because different values for >> the same item could be distinguished by the "lookup_value" instead of >> by the file in which they reside. The trade-off, however, is that >> every lookup is more expensive, because on average the function would >> need to read more lines, and to perform a more complex analysis on >> each one. In your blog you suggest a DB backend, but that's not >> really relevant because by that point you have a completely different >> function than extlookup(). And even a DB performs multi-key queries >> slower than single-key searches. > > Not if they are part of the primary key. That's part of the point. > Any modern database can sustain thousands of queries a second doing this. > However, you are right small sites may not want to go this way to > start with unless configuration using a database is trivial.
As a side note, putting the information in a csv file should make it much easier to version along with the rest of your files. I assume, though I could easily be wrong, that most DBs aren't easy to version control using GIT and Subversion. That means (using csv files) you can keep your data in lockstep with the version of the config files. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.