Record numbering gives records human-friendly references — INC-000042, ORD-001987 — instead of making people quote a database ID.
Every record already has an ID, but an ID is not meaningful to a customer, is awkward to read out on the telephone, and tells anyone who sees it roughly how many records you hold.
The format
A prefix, a hyphen, and a number padded with leading zeros. Both the prefix and the width are set per datastore.
Two records can never get the same number
Numbers are allocated in a way that guarantees this, even when several records are created at the same instant.
Gaps are normal
The counter only moves forwards. Deleting a record does not put its number back, and an abandoned record can leave a gap. Do not treat the numbers as a count of anything — if the highest is INC-000500 that does not mean you have 500 records.
Worked Examples
- Service desk: INC- for incidents, REQ- for requests, so the prefix alone tells an agent what they are looking at.
- Sales: QUO- for quotations, ORD- for orders, INV- for invoices.