Issue #22822 has been updated by Dan Bode.

I'm actually a bit surprised by the question b/c the same questions applies to 
data-bindings in general:

"If we can already pre-compile hierarchies and provide parameters with classes, 
why do we need data-bindings"

Perhaps this is me trying to make an unnecessary compromise.

I've spent the last month implementing hiera to solve real problems. I find it 
to be interesting, but it suffers from two main issues:

- it is really hard to debug (tooling exists to debug per key, but you have to 
invent your own tools to see how all keys map to all classes)
- it is really slow. Looking up every class parameter is much slower than 
pre-compiling an entire hierarchy. For my manifests, the performance difference 
between data-bindings and a pre-compile is dozens of seconds vs. .1 seconds.

As these issues have lead me towards hierarchy-precompile tools and a node 
terminus, the reasons that I am interested in this feature is b/c:

- It provides an interesting way to bind data to class parameters without 
having to couple it with class declarations.
- - declaring data with classes suffers from the classical set of duplicate 
class declaration issues
- My understanding is that data-bindings is the future of how data gets set in 
Puppet, for this reason I would like my solution to be consistent with "the 
Puppet way" of doing things
- - If I do want to use hiera to precomile hierarchies when a node checks in, 
storing it somewhere on the node object where hiera can retrieve it by default 
seems to be the best way to integrate this with the Puppet way (ie: data 
bindings)

----------------------------------------
Feature #22822: Puppet should support data_bindings as a part of the node object
https://projects.puppetlabs.com/issues/22822#change-98760

* Author: Dan Bode
* Status: Needs More Information
* Priority: Normal
* Assignee: 
* Category: node
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
In Puppet, it should be possible to supply data_bindings during the creation of 
the node, and have the data-bindings system just use those bindings (by-passing 
the regular hiera lookup).

Applied specifically to the ENC stdout interface, this might look something 
like this:

    parameters:
    classes:
      - foo
      - bar
      - baz
    data_bindings:
      foo::one: value_one
      foo::two: value_two
      bar::one: value_three

This example assumes that somewhere in Puppet::Node, this sets a instance 
variable accessible to the data_binding system

    def lookup(key)
      @some_hash_set_by_the_node(key)
    end

This would have the following advantages:

1. it allows users to precompile out their hierarchies in one pass which is 
much faster than the current default behavior of data-bindings
2. It allows users using an ENC to precompile all of their data for debugging 
purposes ahead of time


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to