Idempotency
A property of an operation where performing it multiple times produces the same result as performing it once, critical for building reliable systems that handle retries and network failures gracefully.
Idempotency ensures safety in unreliable networks. If a client sends a payment request but the response is lost due to a network timeout, the client must retry without knowing if the first request succeeded. If the payment endpoint is idempotent, the retry will not cause a double charge because the system recognizes the duplicate request and returns the original result.
The standard implementation uses idempotency keys: clients include a unique identifier with each request, and the server stores the result keyed by this identifier. If the same key is seen again, the stored result is returned without re-executing the operation. This pattern is essential for any operation with side effects: payments, order creation, email sending, and resource provisioning.
For AI applications, idempotency matters when LLM calls trigger downstream actions. If a customer support agent uses AI to issue a refund, the operation must be idempotent to prevent duplicate refunds when network issues cause retries. Idempotency keys should be generated at the intent level, not the request level, ensuring that the same user action always produces the same outcome.
Related Terms
A/B Testing
A controlled experiment comparing two or more variants to determine which performs better on a defined metric, using statistical methods to ensure reliable results.
Feature Flag
A software mechanism that enables or disables features at runtime without deploying new code, used for gradual rollouts, A/B testing, and targeting specific user segments.
MLOps
The set of practices combining machine learning, DevOps, and data engineering to reliably deploy, monitor, and maintain ML models in production.
Model Serving
The infrastructure and systems that host trained ML models and handle inference requests in production, optimizing for latency, throughput, and cost.
Semantic Search
Search that understands the meaning and intent behind a query rather than just matching keywords, typically powered by embedding-based similarity comparison.
CI/CD (Continuous Integration / Continuous Deployment)
An automated software practice where code changes are continuously integrated into a shared repository, tested, and deployed to production, reducing manual intervention and accelerating delivery cycles.