---
id: "ulid-service"
type: "component"
kind: "id-generator"
provider: "default"
category: "data"
docs: "https://github.com/ulid/spec"
url: "https://localhost:3000/catalogue/components/ulid-service"
---

# ULID service

Lexicographically sortable ids from a millisecond timestamp plus randomness.

| | |
|---|---|
| Provider | [default](https://localhost:3000/catalogue?provider=default) |
| Kind | [ID generator](https://localhost:3000/catalogue/kinds/id-generator) |
| Category | Data |
| Official docs | [https://github.com/ulid/spec](https://github.com/ulid/spec) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `batchSize` | integer | — | no | — | inherited |
| `central` | boolean | — | no | false | **false** |
| `clockRollbackGuard` (advanced) | boolean | — | no | false | **false** |
| `managed` | boolean | — | no | false | inherited |
| `monotonic` | boolean | — | no | true | inherited |
| `replicated` | boolean | — | no | false | **false** |
| `strategy` | enum | `uuid`, `ulid`, `snowflake`, `counter`, `counter-batched`, `hash` | yes | — | **"ulid"** |
| `timeSortable` | boolean | — | no | false | **true** |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 4

- [Generic ID generator](https://localhost:3000/catalogue/components/id-generator.md) `id-generator` — default
- [Snowflake ID](https://localhost:3000/catalogue/components/snowflake-id.md) `snowflake-id` — default
- [Ticket server](https://localhost:3000/catalogue/components/ticket-server.md) `ticket-server` — default
- [UUID generator](https://localhost:3000/catalogue/components/uuid-generator.md) `uuid-generator` — default

## Use it in a design

```yaml
nodes:
  - { id: "ulid-service", component: "ulid-service" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# ULID generation: 48-bit millisecond timestamp plus randomness, lexicographically sortable;
# monotonic only within the same millisecond, no guard against clock rollback.
schemaVersion: "1"
type: "component"
id: "ulid-service"
kind: "id-generator"
provider: "default"
docs: "https://github.com/ulid/spec"
defaults:
  strategy: "ulid"
  central: false
  replicated: false
  timeSortable: true
  clockRollbackGuard: false
properties:
  monotonic:
    type: "boolean"
    default: true
```

Human page: https://localhost:3000/catalogue/components/ulid-service
