# Meituan-Dianping/Leaf

Distributed ID Generate Service

Repository: https://github.com/Meituan-Dianping/Leaf
Canonical: https://ross.abutalabs.com/products/leaf
Language: Java
License: Apache-2.0
License Family: permissive
Topics: leaf, distributed-id-generator
Last push: 2023-07-18T10:13:29+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2822, "days_push": 1142, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6765, forks 1865 (observed 2026-08-28T04:09:48.404952+00:00)

## What it is
Leaf is a distributed unique ID generation service from Meituan offering segment (database-based) and snowflake (ZooKeeper-based) modes, deployable as a Spring Boot HTTP server or used as a Java library. It is battle-tested at Meituan with ~50k QPS and sub-millisecond TP999 latency.

## Use cases
- generate unique distributed ids for microservices
- replace uuid with ordered unique ids
- build an id distribution center for SOA architecture
- generate order ids for e-commerce at high qps
- snowflake id generation with zookeeper worker assignment
- database-backed segment id allocation

## When to choose
- you need globally unique, roughly ordered IDs across services in a JVM stack
- you want a proven, high-throughput ID generator with both DB-segment and snowflake modes
- you can run a small HTTP ID service backed by MySQL or ZooKeeper

## When to avoid
- you only need single-machine unique IDs (UUIDs suffice)
- your stack is not JVM-based and you cannot call the HTTP server
- you need an actively developed project with frequent releases

## Facets
- artifact type: library
- maturity: maintenance
- function: database, http-server, sdk
- domain: microservices, backend, developer-tools
- platform: jvm
- tags: distributed-id-generation, snowflake, segment-mode, unique-ids, microservices, docker, web-server

## Member repositories
- Meituan-Dianping/Leaf (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:48.404952+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:42:33.351093+00:00, confidence not recorded.
  - readme: https://github.com/Meituan-Dianping/Leaf (fetched 2026-08-28T04:09:48.404952+00:00, sha eaccfaa25a59)
- Data as of 2026-08-30T08:39:29.467469+00:00.
