Leaves: Distributed ID Generation Service
This is a unofficial port of Leaf.
🏠 Homepage
Features
- generate id in segment mode
- generate id in snowflake mode
- mysql
- redis
- postgresql
- sqlite
- mongodb
- runtime-agnostic(tokio or async-std) when using mysql or postgres
- lazy mode: fetch leaf by tag lazily and needs remove it manually
- http server or rpc service(actually just implement it by yourself 😂)
TODO
- performance
- correctness
Example
Enabling the mysql
and runtime-tokio
feature:
use MySqlLeafDao;
use ;
async main
Benchmark
1,000,000 IDs in 180ms(local MongoDB with R7 3700X)