Implementing Continuous Invoice Numbers Using a Transactional Watermark Table
The article explains how to generate strictly sequential invoice numbers required by auditors by using a MySQL InnoDB watermark (water level) table combined with row locking and UPSERT within a single transaction, covering the workflow, concurrency handling, rollback versus void semantics, performance trade‑offs, and applicability limits.
