engineering
Database Sequences and Auto-Increment Without Gaps: A Field Guide
Database-generated IDs almost always have gaps, and most of the time that's fine. The cases where it isn't fine require different machinery, and the cost of that machinery is worth understanding before you reach for it.