Leaves: Distributed ID Generation Service
This is a unofficial port of Leaf.
🏠 Homepage
Features
- generate id in segment mode
- generate id in snowflake mode
- using mysql
- using redis
- http server or rpc service(actually just implement it by yourself 😂)
TODO
- more configurable
- using tokio's Rwlock in the future.
- performance
- make
mysql_async
optional
Example
use MySqlLeafDao;
use LeafSegment;
use Result;
async main
Benchmark
Not yet.But in my PC and local database,I used 10 tasks and each one loop 1000 times. It costs 700ms.