Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The most important concepts behind cloud development #46

Open
tammersaleh opened this issue Dec 20, 2013 · 4 comments
Open

The most important concepts behind cloud development #46

tammersaleh opened this issue Dec 20, 2013 · 4 comments

Comments

@tammersaleh
Copy link
Owner

  • idempotent
  • reentrant
  • convergent

And how they are related.

@tammersaleh
Copy link
Owner Author

Idempotence

Idempotence (/ˌaɪdɨmˈpoʊtəns/ eye-dəm-poh-təns) is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of places in abstract algebra (in particular, in the theory of projectors and closure operators) and functional programming (in which it is connected to the property of referential transparency).

The term was introduced by Benjamin Peirce[1] in the context of elements of algebras that remain invariant when raised to a positive integer power, and literally means "(the quality of having) the same power", from idem + potence (same + power).

There are several meanings of idempotence, depending on what the concept is applied to:

  • A unary operation (or function) is idempotent if, whenever it is applied twice to any value, it gives the same result as if it were applied once; i.e., ƒ(ƒ(x)) ≡ ƒ(x). For example, the absolute value: abs(abs(x)) ≡ abs(x).
  • A binary operation is idempotent if, whenever it is applied to two equal values, it gives that value as the result. For example, the operation giving the maximum value of two values is idempotent: max (x, x) ≡ x.
  • Given a binary operation, an idempotent element (or simply an idempotent) for the operation is a value for which the operation, when given that value for both of its operands, gives the value as the result. For example, the number 1 is an idempotent of multiplication: 1 × 1 = 1.

I can call Foo() twice and be confident that I will get the same result. Foo() has no side effects.

@tammersaleh
Copy link
Owner Author

reentrant

In computing, a computer program or subroutine is called reentrant if it can be interrupted in the middle of its execution and then safely called again ("re-entered") before its previous invocations complete execution. The interruption could be caused by an internal action such as a jump or call, or by an external action such as a hardware interrupt or signal. Once the reentered invocation completes, the previous invocations will resume correct execution.

I can call Foo() and call it again before it finishes. I can also call Foo(), and pause it, call another Foo(), and restart the first Foo() without worry.

@tammersaleh
Copy link
Owner Author

convergence is a term stolen from networking configuration management:

Convergence is the state of a set of routers that have the same topological information about the internetwork in which they operate. For a set of routers to have converged, they must have collected all available topology information from each other via the implemented routing protocol, the information they gathered must not contradict any other router's topology information in the set, and it must reflect the real state of the network. In other words: In a converged network all routers "agree" on what the network topology looks like.

If a system gets out of wack, I can return it to the expected state by running Foo(). This implies that Foo() is idempotent. Such a system has the concept of the delta between the actual and desired state, though it doesn't actually need to know the actual state.

@tammersaleh
Copy link
Owner Author

Convergence implies idempotence.

Reentrance facilitates convergence and idempotence in multi-actor environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant