ID Strategy
Zeptoz supports:
intuuidv4uuidv7ulidnanoid
Set strategy on collection create
bash
zeptoz collection create Task title:string --id-strategy uuidv7Behavior
int: database auto-increment.uuidv4,uuidv7,ulid,nanoid: generated by runtime on insert.- Record path ID validation follows collection strategy.
Recommendation: ULID or UUID?
Default recommendation: uuidv7.
- Choose
uuidv7when you want standards-based UUIDs with good time ordering. - Choose
ulidwhen you want shorter, URL-friendly IDs with lexicographic time ordering.
If your team already standardizes on UUIDs, use uuidv7.
Examples
| Strategy | Example ID |
|---|---|
int | 42 |
uuidv4 | 550e8400-e29b-41d4-a716-446655440000 |
uuidv7 | 018f0f3a-7b6c-7f6d-b1de-7c3f6f2b5f21 |
ulid | 01J4Z5K6Q7R8S9T0UV1W2X3Y4Z |
nanoid | V1StGXR8_Z5jdHi6B-myT |
Pros and cons
| Strategy | Pros | Cons |
|---|---|---|
int | Small, simple, fast indexing | Not globally unique, easier to enumerate |
uuidv4 | Standard and highly unique | Random distribution, weak natural ordering |
uuidv7 | Standard UUID + time ordered | Longer than ULID/NanoID |
ulid | Shorter, readable, sortable | Not UUID format |
nanoid | Very compact and URL-friendly | Not time ordered by default |