<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vinita Mathreja</title>
    <description>The latest articles on DEV Community by Vinita Mathreja (@vinitamath).</description>
    <link>https://dev.to/vinitamath</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F723029%2Fa4516ce1-60e9-4094-889b-45af656e9c2d.jpg</url>
      <title>DEV Community: Vinita Mathreja</title>
      <link>https://dev.to/vinitamath</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vinitamath"/>
    <language>en</language>
    <item>
      <title>What Is Idempotency?</title>
      <dc:creator>Vinita Mathreja</dc:creator>
      <pubDate>Mon, 26 Oct 2026 18:55:33 +0000</pubDate>
      <link>https://dev.to/vinitamath/what-is-idempotency-4ahb</link>
      <guid>https://dev.to/vinitamath/what-is-idempotency-4ahb</guid>
      <description>&lt;p&gt;An idempotent operation is an action that produces the exact same result whether you apply it once or multiple times.&lt;/p&gt;

&lt;p&gt;In software, an idempotent request can be &lt;strong&gt;safely retried&lt;/strong&gt; without side effects like double charges or duplicate orders. Apps make this work with an &lt;strong&gt;idempotency key&lt;/strong&gt;: a unique ID sent with the request so the server can spot repeats and return the original result instead of running the action again.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What does idempotent mean?&lt;/li&gt;
&lt;li&gt;Why does idempotency matter?&lt;/li&gt;
&lt;li&gt;What is an idempotency key?&lt;/li&gt;
&lt;li&gt;How do idempotency keys work?&lt;/li&gt;
&lt;li&gt;Where is idempotency used?&lt;/li&gt;
&lt;li&gt;Where does idempotency live in your codebase?&lt;/li&gt;
&lt;li&gt;How Stripe uses idempotency keys&lt;/li&gt;
&lt;li&gt;Which HTTP methods are idempotent?&lt;/li&gt;
&lt;li&gt;How to prompt idempotency as a vibe coder&lt;/li&gt;
&lt;li&gt;Common mistakes to avoid&lt;/li&gt;
&lt;li&gt;Jargon decoder&lt;/li&gt;
&lt;li&gt;FAQ&lt;/li&gt;
&lt;li&gt;Key takeaways&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What does idempotent mean? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The word sounds scary. The idea is simple. Richard Feynman's rule was: if you can't explain it to a kid, you don't really get it. So here's the kid version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The elevator button.&lt;/strong&gt;&lt;br&gt;
You press the call button. The elevator is coming. You press it four more times out of impatience. Still one elevator. Pressing again changes nothing. That button is idempotent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The light switch set to "off."&lt;/strong&gt;&lt;br&gt;
Flip a switch to off when the light is already off. Nothing happens. You can do it 50 times. The room stays dark. Idempotent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The vending machine (the opposite).&lt;/strong&gt;&lt;br&gt;
Each time you press "buy," you lose another dollar and get another soda. Pressing twice means two sodas and two charges. That is &lt;em&gt;not&lt;/em&gt; idempotent.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The one-line test:&lt;/strong&gt; ask, "If this accidentally happens twice, is the world any different than if it happened once?" If the answer is no, it's idempotent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The word itself comes from Latin: &lt;em&gt;idem&lt;/em&gt; ("the same") + &lt;em&gt;potent&lt;/em&gt; ("power"). Same power, no matter how many times you apply it.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why does idempotency matter? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Because the internet drops messages, and people double-tap.&lt;/strong&gt; Without idempotency, every retry is a chance to charge someone twice.&lt;/p&gt;

&lt;p&gt;Picture a payment app:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user taps &lt;strong&gt;Send Money&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Their phone sends the request. Your server processes the payment.&lt;/li&gt;
&lt;li&gt;The Wi-Fi cuts out before the "Success!" reply reaches the phone.&lt;/li&gt;
&lt;li&gt;The phone shows a spinner, then an error. The user panics and taps &lt;strong&gt;Send Money&lt;/strong&gt; again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's the trap: the phone has no way to know whether step 2 worked. From its side, "the request never arrived" and "the reply got lost" look exactly the same.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Without idempotency:&lt;/strong&gt; the server sees a brand-new request and sends the money a second time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;With idempotency:&lt;/strong&gt; the server says, "I already did this one. Here's the answer I gave you before." One payment, no harm done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same problem shows up when apps retry automatically after a timeout, when a user refreshes a checkout page, or when a mobile app reconnects after going through a tunnel.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is an idempotency key? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;An idempotency key is a &lt;strong&gt;unique ID your app attaches to a request&lt;/strong&gt; so the server can recognize a repeat. It's usually a UUID, a long random string like &lt;code&gt;f47ac10b-58cc-4372-a567-0e02b2c3d479&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Think of a coat-check ticket:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You hand over your coat and get ticket &lt;strong&gt;#47&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Later you come back with #47. The attendant doesn't take a new coat. They look up #47 and hand you the same coat.&lt;/li&gt;
&lt;li&gt;Come back with #47 three times, and you still get one coat, not three.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idempotency key is ticket #47. The server is the attendant. The saved result is your coat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two rules make the ticket work:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One key per real action.&lt;/strong&gt; A new checkout attempt gets a new key. A retry of the same attempt reuses the old one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The key is made before sending.&lt;/strong&gt; The app creates it first, so every retry carries the exact same ticket.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  How do idempotency keys work? Step by step &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The server checks every key against the keys it has already handled. &lt;strong&gt;New key: do the work. Known key: replay the saved answer.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user taps &lt;strong&gt;Pay&lt;/strong&gt;. The app generates a UUID and ties it to this one checkout attempt.&lt;/li&gt;
&lt;li&gt;The app sends the request with the key in a header, usually named &lt;code&gt;Idempotency-Key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The server asks the database: "Have I seen this key before?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New key:&lt;/strong&gt; the server charges the card, then saves the key together with the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Known key:&lt;/strong&gt; the server skips the charge and returns the saved result.&lt;/li&gt;
&lt;li&gt;The reply gets lost? The app retries with the same key, and step 5 kicks in. The user is charged once.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  Where is idempotency used? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Anywhere money moves or a duplicate would cause a mess. Stripe, PayPal and banks all rely on it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Payments&lt;/strong&gt; — charging a card once, not twice&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Money transfers&lt;/strong&gt; — sending $500, not $1,000&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refunds&lt;/strong&gt; — refunding an order once&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E-commerce orders&lt;/strong&gt; — one checkout, one order, one shipment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bookings&lt;/strong&gt; — one seat, one hotel room, one appointment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sign-ups and invites&lt;/strong&gt; — one account, one welcome email&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Webhooks&lt;/strong&gt; — handling a "payment succeeded" event once, even when the sender delivers it twice&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background jobs&lt;/strong&gt; — a task that gets retried after a crash shouldn't send 3 invoices&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A quick gut check:&lt;/strong&gt; if a duplicate would make a customer email support, that action needs idempotency.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Where does idempotency live in your codebase? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Mostly in the backend, with a small but important job for the frontend and the database. Idempotency isn't a library or a language feature — it's a design rule you can build in JavaScript, Python, Go or anything else.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Its job&lt;/th&gt;
&lt;th&gt;What it looks like&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Frontend&lt;/strong&gt; (app or website)&lt;/td&gt;
&lt;td&gt;Create the key and stop double-clicks&lt;/td&gt;
&lt;td&gt;Generate a UUID when the user hits Pay; disable the button while the request is pending; reuse the same key on retry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Backend&lt;/strong&gt; (API)&lt;/td&gt;
&lt;td&gt;Check the key before doing the work&lt;/td&gt;
&lt;td&gt;Look up the key; if found, return the saved response; if new, do the work and save the response with the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Make duplicates impossible&lt;/td&gt;
&lt;td&gt;A unique constraint on the key column, so two copies of the same key can never be stored, even if two requests arrive at the same instant&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why the database part matters:&lt;/strong&gt; two retries can hit your server at the exact same millisecond. Both might check "seen this key?" before either has saved it. A unique constraint is the bouncer at the door: only one gets in, the other is turned away.&lt;/p&gt;


&lt;h2&gt;
  
  
  How Stripe uses idempotency keys (real-world example) &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Stripe is the textbook example: send an &lt;code&gt;Idempotency-Key&lt;/code&gt; header, and a retried charge never charges twice.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The setup.&lt;/strong&gt; When your app asks Stripe to charge a card, it adds a header called &lt;code&gt;Idempotency-Key&lt;/code&gt; with a unique value made for that one checkout attempt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The happy path.&lt;/strong&gt; Stripe runs the charge and saves the status code and response body next to the key, whether the request succeeded or failed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The retry.&lt;/strong&gt; The connection drops before your app hears back. Your app doesn't know if the charge went through, so it sends the same request with the same key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe's move.&lt;/strong&gt; It recognizes the key, skips charging the card, and returns the saved response. One charge, and your app finally gets its answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The safety check.&lt;/strong&gt; Reuse a key with different details (say, a different amount) and Stripe returns an error. One ticket can't be used for two different coats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The expiry.&lt;/strong&gt; Stripe keeps keys for at least 24 hours and may delete them after that. A key reused after it's deleted is treated as a brand-new request.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Good to know:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keys can be up to 255 characters. Don't use emails or personal info as keys.&lt;/li&gt;
&lt;li&gt;Every &lt;code&gt;POST&lt;/code&gt; request accepts a key. &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; don't need one, because they're already idempotent by design.&lt;/li&gt;
&lt;li&gt;Stripe's official SDKs can generate keys and retry for you.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.stripe.com/v1/customers &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-u&lt;/span&gt; sk_test_your_key: &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Idempotency-Key: KG5LxwFBepaKHyUD"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"My first test customer"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Source: Stripe API docs — Idempotent requests, and Advanced error handling.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Which HTTP methods are idempotent? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; are idempotent by design. &lt;code&gt;POST&lt;/code&gt; is not, which is exactly why POST requests need idempotency keys. An HTTP method is just the verb your app uses when it talks to a server.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Plain-English job&lt;/th&gt;
&lt;th&gt;Idempotent?&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read something&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;Reading a page 10 times doesn't change it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Replace something with this exact version&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;Setting your name to "Ana" twice still leaves it as "Ana"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DELETE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove something&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;Deleting an already-deleted item leaves it deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create something new&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;Each call can create another order, charge or post&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PATCH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change part of something&lt;/td&gt;
&lt;td&gt;⚠️ Not always&lt;/td&gt;
&lt;td&gt;"Set price to $10" is safe; "add $10 to price" is not&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The rule of thumb:&lt;/strong&gt; "set" is safe to repeat, "add" is not. Setting a value lands in the same place every time. Adding stacks up.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  How to prompt idempotency as a vibe coder &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;You don't need to write the code. You need to &lt;strong&gt;ask for it by name&lt;/strong&gt;, because AI coding tools rarely add idempotency unless you do. Copy these into Claude Code, Cursor or any AI coder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The all-in-one prompt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Make the create-order and payment endpoints idempotent. Have the frontend
generate a UUID idempotency key for each submission and send it in an
Idempotency-Key header. On the backend, store the key with the response in
the database using a unique constraint. If the same key comes in again,
return the original response instead of processing it again. Disable the
submit button while the request is pending.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. The Stripe prompt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Integrate Stripe payments using idempotency keys. Generate one key per
checkout attempt and reuse that same key on every retry of that attempt.
Never create a new key for a retry.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. The audit prompt&lt;/strong&gt; (run this on an existing app)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review every endpoint that creates, charges, refunds or sends something.
List which ones are not retry-safe, then add idempotency handling to each.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. The webhook prompt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Make our webhook handlers idempotent. Store each event ID after processing
it, and skip any event ID we've already handled.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. The test prompt&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a test that sends the same payment request twice with the same
idempotency key and confirms only one charge is created and both calls
return the same response.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Common idempotency mistakes to avoid &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most bugs come from making a new key when you should reuse the old one.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;New key on every retry.&lt;/strong&gt; If the retry gets a fresh key, the server thinks it's a new payment. The whole system is defeated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disabling the button and calling it done.&lt;/strong&gt; A disabled button stops double-clicks, not network retries or page refreshes. You still need the backend check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checking without a unique constraint.&lt;/strong&gt; Two requests arriving at the same instant can both slip past a simple "have I seen this?" check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Saving the key before the work finishes.&lt;/strong&gt; If the server crashes halfway, you may block the retry that would have fixed it. Save the key and the result together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using personal data as the key.&lt;/strong&gt; An email or phone number isn't unique per action, and it leaks private info into logs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeping keys forever.&lt;/strong&gt; Storage grows without limit. Set an expiry, like Stripe's 24-hour minimum.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgetting webhooks and background jobs.&lt;/strong&gt; These retry on their own, often more than your users do.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Jargon decoder: every term in this article, explained simply &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Each term gets one plain sentence and one everyday picture.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;What it actually means&lt;/th&gt;
&lt;th&gt;Everyday picture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Idempotent&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Doing it again changes nothing&lt;/td&gt;
&lt;td&gt;Pressing an elevator button that's already lit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Idempotency key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A unique ID that marks one specific action&lt;/td&gt;
&lt;td&gt;A coat-check ticket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;UUID&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A random ID so long that two will practically never match&lt;/td&gt;
&lt;td&gt;A lottery number nobody else will ever draw&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Request&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A message your app sends to a server asking it to do something&lt;/td&gt;
&lt;td&gt;Placing an order at a counter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Response&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The server's reply&lt;/td&gt;
&lt;td&gt;Your receipt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retry&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sending the same request again because no reply came back&lt;/td&gt;
&lt;td&gt;Re-asking "did you get my order?"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Timeout&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Giving up on waiting for a reply after a set time&lt;/td&gt;
&lt;td&gt;Hanging up after 30 seconds of ringing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Header&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Extra info attached to a request, outside the main message&lt;/td&gt;
&lt;td&gt;The label on the outside of a parcel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Endpoint&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A specific address on a server that does one job&lt;/td&gt;
&lt;td&gt;One service window at the post office&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cached result&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A saved copy of an earlier answer, reused instead of redoing the work&lt;/td&gt;
&lt;td&gt;Handing over yesterday's photocopy instead of copying again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Unique constraint&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A database rule that blocks two identical values&lt;/td&gt;
&lt;td&gt;A guest list that won't take the same name twice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Race condition&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A bug when two things happen at the same moment and step on each other&lt;/td&gt;
&lt;td&gt;Two people grabbing the last donut at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Webhook&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A message another service sends you automatically when something happens&lt;/td&gt;
&lt;td&gt;A text alert from your bank&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The server side, where the real work and data live&lt;/td&gt;
&lt;td&gt;The restaurant kitchen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The part users see and tap&lt;/td&gt;
&lt;td&gt;The dining room and menu&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  FAQ: idempotency and idempotency keys &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is idempotency in simple terms?&lt;/strong&gt;&lt;br&gt;
Idempotency means repeating an action has the same effect as doing it once. Press an elevator button five times and you still get one elevator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an idempotency key?&lt;/strong&gt;&lt;br&gt;
An idempotency key is a unique ID attached to a request. The server uses it to spot duplicates and return the original result instead of repeating the action.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do idempotency keys prevent double payments?&lt;/strong&gt;&lt;br&gt;
The server saves each key with its result. When a retry arrives with the same key, it returns the saved result and skips the charge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is POST idempotent?&lt;/strong&gt;&lt;br&gt;
No. Each POST request can create something new, like another order. That's why payment APIs such as Stripe accept idempotency keys on POST requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are GET, PUT and DELETE idempotent?&lt;/strong&gt;&lt;br&gt;
Yes. Reading, replacing with an exact version, or deleting something gives the same end state no matter how often you repeat it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How long does Stripe keep idempotency keys?&lt;/strong&gt;&lt;br&gt;
Stripe keeps keys for at least 24 hours and may remove them after that. A reused key after removal is treated as a new request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What should I use as an idempotency key?&lt;/strong&gt;&lt;br&gt;
A UUID generated once per user action. Avoid emails, phone numbers or anything personal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is idempotency frontend or backend?&lt;/strong&gt;&lt;br&gt;
Both, but mainly backend. The frontend creates the key and disables the button. The backend checks the key. The database enforces it with a unique constraint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which programming language supports idempotency?&lt;/strong&gt;&lt;br&gt;
All of them. Idempotency is a design principle, not a language feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I need idempotency if I disable the Pay button after one click?&lt;/strong&gt;&lt;br&gt;
Yes. A disabled button stops double-clicks, but not automatic retries, page refreshes or lost network replies.&lt;/p&gt;


&lt;h2&gt;
  
  
  Key takeaways &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Idempotent = safe to repeat.&lt;/strong&gt; Once or ten times, same result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Networks fail, users double-tap.&lt;/strong&gt; Without idempotency, every retry risks a duplicate charge or order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An idempotency key is a coat-check ticket.&lt;/strong&gt; One key per real action, reused on every retry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend checks, database enforces, frontend creates.&lt;/strong&gt; All three layers have a job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask your AI coder for it by name.&lt;/strong&gt; It won't add idempotency on its own, so put it in the prompt for anything that creates, charges or sends.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhparvd1x91f8h2vd6u81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhparvd1x91f8h2vd6u81.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ai</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Lumos Labs is looking for Substrate mentors for their upcoming program</title>
      <dc:creator>Vinita Mathreja</dc:creator>
      <pubDate>Fri, 18 Feb 2022 12:45:47 +0000</pubDate>
      <link>https://dev.to/vinitamath/lumos-labs-is-looking-for-substrate-mentors-for-their-upcoming-program-3i42</link>
      <guid>https://dev.to/vinitamath/lumos-labs-is-looking-for-substrate-mentors-for-their-upcoming-program-3i42</guid>
      <description>&lt;p&gt;Hi Everyone, &lt;br&gt;
I am writing on behalf of Lumos Labs. &lt;br&gt;
We are looking for Substrate mentors for our upcoming program. &lt;/p&gt;

&lt;p&gt;Remuneration for the mentorship program is 4000 USD &lt;br&gt;
Here’s the job description:: &lt;a href="https://docs.google.com/document/d/1r0N3lCxOfn82gTAheyRWb4QtgBr-sWKEPV-TPfw7okc/edit" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Link to apply: &lt;a href="https://tripetto.app/run/OK8A5YVC5P" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any queries, please write to me at &lt;a href="mailto:vinita@lumoslabs.co"&gt;vinita@lumoslabs.co&lt;/a&gt;&lt;/p&gt;

</description>
      <category>polkadot</category>
      <category>blockchain</category>
      <category>blockchainjob</category>
    </item>
  </channel>
</rss>
