-
Notifications
You must be signed in to change notification settings - Fork 15
Create a DNR flow
A DNR flow is different from a normal Node-RED flow only in that DNR flow has the notion of deployment constraints, or requirements. There are node requirements and link requirements.
In a distributed environment, node requirements specify where and when a node should be running and generating data in an instance of Node-RED.
Also in a distributed environment, there are multiple instances of a node running on different devices. Link requirement specifies the relationship between these node instances. There are 4 types of link requirements: 1-1, 1-N, N-1, N-N.
DNR Editor allows to specify these requirements on a Node-RED flow.
To create a node requirement, click on Node Requirements. To edit existing node requirements or applying a requirement to a node, use the drop down menu next to the "Node Requirements" button. If a node on the canvas is selected, the selected requirement will be applied to that node. If no node is selected, a dialog will open allowing edit the existing requirement.
A node requirement currently supports the specification of location, available memory, available CPU cores and device name. While memory and cpu status are read from the system automatically, location and device name can be set manually. At runtime, the system will assess
Once a requirement is created, it is added to the drop down list and can be applied to one or more nodes at the same time by selecting all the nodes and click on the requirement from the drop down list.
Link requirements are simpler than node requirements, there are 4 fixed type of link requirements: 1-1, 1-N, N-1 and N-N. These link types indicate the cardinality or dependency arity between two nodes.
Link requirements are necessary in distributed version of Node RED due to one node can be deployed into multiple machine, creating more than one instance of it at runtime. The link requirements specify how these node instances communicate. For example, a 1-1 link between two nodes means at runtime, one specific node instance of source node should only send data to another specific node instance of destination node. A 1-N link means the instances of destination node should get data from only one particular instance of source node without mixing. So in this case, if there is more than one instance of source node, a particular destination node should only fetch data from one of them.
To apply link requirement, just select (click on) a link and choose the corresponding link requirement from the drop down menu.