---
id: "ticket-server"
type: "component"
kind: "id-generator"
provider: "default"
category: "data"
docs: "https://en.wikipedia.org/wiki/Auto-increment"
url: "https://localhost:3000/catalogue/components/ticket-server"
---

# Ticket server

Flickr-style central auto-increment id server.

| | |
|---|---|
| Provider | [default](https://localhost:3000/catalogue?provider=default) |
| Kind | [ID generator](https://localhost:3000/catalogue/kinds/id-generator) |
| Category | Data |
| Official docs | [https://en.wikipedia.org/wiki/Auto-increment](https://en.wikipedia.org/wiki/Auto-increment) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `backingStore` | ref | — | no | — | inherited |
| `batchSize` | integer | — | no | — | inherited |
| `central` | boolean | — | no | false | **true** |
| `clockRollbackGuard` (advanced) | boolean | — | no | false | **false** |
| `interleaveStep` | integer | — | no | 1 | inherited |
| `managed` | boolean | — | no | false | inherited |
| `replicated` | boolean | — | no | false | **false** |
| `strategy` | enum | `uuid`, `ulid`, `snowflake`, `counter`, `counter-batched`, `hash` | yes | — | **"counter"** |
| `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
- [ULID service](https://localhost:3000/catalogue/components/ulid-service.md) `ulid-service` — default
- [UUID generator](https://localhost:3000/catalogue/components/uuid-generator.md) `uuid-generator` — default

## Use it in a design

```yaml
nodes:
  - { id: "ticket-server", component: "ticket-server" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Flickr-style ticket server: a central auto-increment row handing out ids; pairing two servers
# on odd/even sequences is how it is replicated.
schemaVersion: "1"
type: "component"
id: "ticket-server"
kind: "id-generator"
provider: "default"
docs: "https://en.wikipedia.org/wiki/Auto-increment"
defaults:
  strategy: "counter"
  central: true
  replicated: false
  timeSortable: true
  clockRollbackGuard: false
properties:
  backingStore:
    type: "ref"
    refKind: "sql-database"
  interleaveStep:
    type: "integer"
    default: 1
```

Human page: https://localhost:3000/catalogue/components/ticket-server
