cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1179
Views
2
Helpful
1
Replies

Idempotent Operations

renees
Level 4
Level 4

I understand that NSO provides for Idempotent operations. Can someone explain that in lameman terms?

1 Accepted Solution

Accepted Solutions

camoberg
Cisco Employee
Cisco Employee

The somewhat dry definition from Wikipedia is "an operation that will produce the same results if executed once or multiple times."


The way that this manifests itself in NSO is that multiple operations of the exact same kind and content (i.e. a NETCONF edit config to create a service instance) on the northbound APIs will result in the creation of the service in the network the first time, and subsequent calls will have no effect at all, since the service is already created.


This behavior comes out of the way FASTMAP works. All operations on the service level leads to the creation of a resulting set of data for the device level. But before applying this resulting set, FASTMAP compares the resulting data with what is already in place on the device level. And if that comparison results in nothing (i.e. everything needed is already in place), then there's no need to send anything through the NEDs to the network.


The Wikipedia article has several examples, and I think contrasting the following two makes a great point:

  • Elevator buttons provide an idempotent function. Pressing floor 3 many times will not do anything except to take you to floor 3.
  • Ordering cars is not an idempotent function. Putting in many orders for the same type car will make you poor :-)

View solution in original post

1 Reply 1

camoberg
Cisco Employee
Cisco Employee

The somewhat dry definition from Wikipedia is "an operation that will produce the same results if executed once or multiple times."


The way that this manifests itself in NSO is that multiple operations of the exact same kind and content (i.e. a NETCONF edit config to create a service instance) on the northbound APIs will result in the creation of the service in the network the first time, and subsequent calls will have no effect at all, since the service is already created.


This behavior comes out of the way FASTMAP works. All operations on the service level leads to the creation of a resulting set of data for the device level. But before applying this resulting set, FASTMAP compares the resulting data with what is already in place on the device level. And if that comparison results in nothing (i.e. everything needed is already in place), then there's no need to send anything through the NEDs to the network.


The Wikipedia article has several examples, and I think contrasting the following two makes a great point:

  • Elevator buttons provide an idempotent function. Pressing floor 3 many times will not do anything except to take you to floor 3.
  • Ordering cars is not an idempotent function. Putting in many orders for the same type car will make you poor :-)