Programming Terms: Idempotence

Programming Terms: Idempotence

Corey Schafer

9 лет назад

45,719 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@vlad981
@vlad981 - 07.04.2016 19:03

Thanks! very cool series of video!

Ответить
@navaneethakrishnan33
@navaneethakrishnan33 - 03.08.2016 21:09

when we will use the idempotent concept in programming , in which way it benefit program in any manner , and please give me some real world use of idempotence .Thanks

Ответить
@collinstump9706
@collinstump9706 - 27.09.2016 09:27

Thank you. Your explanation helped me get my head around it.

Ответить
@curiosull
@curiosull - 16.07.2018 11:05

POST technically means create a new resource. If you try to create the same resource twice, considering you have provided an ID, shouls be idempotent. PUT however can be used to update a value like +1

Ответить
@SheldonHull
@SheldonHull - 24.04.2019 03:37

This was a great tutorial. I'm also interested in your presentation methodology. Did you use reveal-js and if so how did you have it flip to the vscode window during the presentation so smoothly? I'm using reveal-js but didn't see anyway to flip to vscode as a next window in it. Keep up the great work, I subscribed and will be sure to review more of your great content

Ответить
@Qamarkhan007
@Qamarkhan007 - 23.07.2019 15:44

Thank you!

Ответить
@ineedsolution
@ineedsolution - 22.09.2019 07:49

As always -- simple explanation. I don't how are you doing, but your videos are the best sources of the knowledge that I
I can get. Love it.

Ответить
@williamsrensen9802
@williamsrensen9802 - 02.10.2019 21:50

str() is too and its quite entertaining since whenever you declere a string it calls str so str('yeet') is the same as str(str('yeet')) so you can use str(str(str(str(str(str(str(str('yeet')))))))) and noone questions it.

Ответить
@kaiserdrache7675
@kaiserdrache7675 - 02.02.2020 12:56

As Equilibris has eluded to, most functions are naturally idempotent.

Ответить
@kaiserdrache7675
@kaiserdrache7675 - 02.02.2020 12:57

I never knew there was a term for it, since the term itself matters not.
I just do the work but don't try to label things.

Ответить
@hermesmercuriustrismegistu4841
@hermesmercuriustrismegistu4841 - 01.04.2020 15:54

amazing explanation! Thx

Ответить
@eazy2195
@eazy2195 - 07.04.2020 21:32

The definition of insanity, executing an idempotent function and expecting it to change!

Ответить
@mohamadhussien3575
@mohamadhussien3575 - 19.04.2020 22:02

This explanation from Microsoft is very good addition to Corey excellent effort, but more practical .

The reality of event-driven and message-based architecture dictates the need to accept identical requests while preserving data integrity and system stability.

To illustrate, consider an elevator call button. As you press the button, it lights up and an elevator is sent to your floor. A few moments later, someone else joins you in the lobby. This person smiles at you and presses the illuminated button a second time. You smile back and chuckle to yourself as you're reminded that the command to call an elevator is idempotent.

Pressing an elevator call button a second, third, or fourth time has no bearing on the final result. When you press the button, regardless of the number of times, the elevator is sent to your floor. Idempotent systems, like the elevator, result in the same outcome no matter how many times identical commands are issued.

When it comes to building applications, consider the following scenarios:

What happens if your inventory control application tries to delete the same product more than once?
How does your human resource application behave if there is more than one request to create an employee record for the same person?
Where does the money go if your banking app gets 100 requests to make the same withdrawal?
There are many contexts where requests to a function may receive identical commands. Some situations include:

Retry policies sending the same request many times
Cached commands replayed to the application
Application errors sending multiple identical requests
To protect data integrity and system health, an idempotent application contains logic that may contain the following behaviors:

Verifying of the existence of data before trying to execute a delete
Checking to see if data already exists before trying to execute a create action
Reconciling logic that creates eventual consistency in data
Concurrency controls
Duplication detection
Data freshness validation
Guard logic to verify input data

Ultimately idempotency is achieved by ensuring a given action is possible and is only executed once.

Ответить
@NOVAsteamed
@NOVAsteamed - 03.06.2020 03:06

Learned this beacause of linear algebra

Ответить
@vishalagrawal2476
@vishalagrawal2476 - 07.10.2020 13:48

Super!!

Ответить
@bensmith9253
@bensmith9253 - 20.12.2020 18:34

this channel is GREAT!

Ответить
@DuyHoang-ul7lg
@DuyHoang-ul7lg - 02.05.2021 16:45

thank you

Ответить
@TypicallyThomas
@TypicallyThomas - 20.08.2021 22:09

Very helpful video but your pronunciation of Idempotence is... put politely... very wrong

Ответить
@hp7706
@hp7706 - 20.10.2021 21:12

Nicely explained. Thanks !

Ответить
@j.g.8860
@j.g.8860 - 03.12.2021 01:23

Thank you. I would recommend not using wikipedia as a primary source though

Ответить
@alexxu7542
@alexxu7542 - 03.02.2022 20:08

thanks

Ответить
@javieru5871
@javieru5871 - 01.03.2022 20:51

Thanks man!!!, it helped me get this clear!!!

Ответить
@oladayoayoola4590
@oladayoayoola4590 - 21.04.2022 21:49

thank you for this

Ответить
@sebastiandelbanorollin5482
@sebastiandelbanorollin5482 - 10.05.2022 10:33

Also, if x is a string, f(x)= upper case x defines an idempotent

In maths an idempotent is often used to define a subspace of the values of x by f(x)=x. E.g uppercase strings.

Ответить
@GandalftheWise
@GandalftheWise - 17.09.2022 01:48

My wife said for me to see the doctor because I may be idempotent. This video has left me confused

Ответить
@DommageCollateral
@DommageCollateral - 17.11.2022 03:37

isnt that including, every function that has nothing in constructor?

Ответить
@abraham_o
@abraham_o - 08.05.2023 09:17

Idempotency in programming means that an operation can be applied multiple times without changing the result beyond the initial application. For example, if we have a function that gets a cow pregnant and we apply it twice, the cow cannot get more pregnant than she already is, so the result will not change. This property ensures the reliability and consistency of operations in distributed systems or situations with potential duplicate requests.

Ответить