data-infra
Glossary ↗Delivery Semantics
Delivery semantics describe the guarantee a messaging system gives about how many times a message reaches its consumer: at-most-once, at-least-once, or exactly-once. At-most-once may drop messages but never duplicates them. At-least-once never loses a message but may deliver it more than once after a retry. Exactly-once is the ideal and the hardest — every message lands once, no loss, no duplicate. In practice, most queues and streams (SQS, Kafka, RabbitMQ) default to at-least-once, because guaranteeing no loss is easier than guaranteeing no duplicate. True exactly-once usually isn't end-to-end magic; it's at-least-once delivery plus idempotent consumers that deduplicate on a message key. For SaaS builders, this choice governs correctness in anything that charges money or mutates state. Practical note: assume at-least-once and make your handlers idempotent — store a processed-message ID, or use an upsert — so a redelivered 'charge card' event doesn't bill the customer twice.
Related terms