| Crates.io | ferroid-tonic-server |
| lib.rs | ferroid-tonic-server |
| version | 0.6.5 |
| created_at | 2025-06-13 22:25:26.861803+00 |
| updated_at | 2025-08-08 09:22:49.88451+00 |
| description | A high-performance gRPC server for streaming ID generation |
| homepage | |
| repository | https://github.com/s0l0ist/ferroid/blob/main/crates/ferroid-tonic-server |
| max_upload_size | |
| id | 1711930 |
| size | 131,286 |
ferroid-tonic-server is a high-performance, streaming gRPC server for batch
Snowflake-style ID generation, built with
tonic and powered by
ferroid.
This server is optimized for latency-sensitive and high-throughput workloads such as distributed queues, event ingestion pipelines, or scalable database key generation-where time-ordered, collision-resistant IDs are critical.
StreamIds endpoint; IDs are streamed back in chunks (compression optional).worker_id), ensuring scale-out safety and eliminating contention.Install:
# Install with the `tracing` feature to see traces/logs adjustable with RUST_LOG
cargo install ferroid-tonic-server --features tracing
# If you want full telemetry, it supports exporting to Honeycomb
cargo install ferroid-tonic-server --features tracing,metrics,honeycomb
Run with a specific number of workers. Each worker corresponds to the
machine_id of the Snowflake ID:
ferroid-tonic-server --num-workers 16
The server listens on 0.0.0.0:50051 by default. You can override the address
via CLI or environment variables (see --help).
grpcurl -plaintext localhost:50051 list
> ferroid.IdGenerator grpc.reflection.v1.ServerReflection
You can run an example query, but the results are in base64 binary packed form from grpcurl. To deserialize properly, checkout the benchmarks:
grpcurl -plaintext \
-d '{"count": 1}' \
localhost:50051 \
ferroid.IdGenerator/StreamIds
> { "packedIds": "AADANUc+1AA=" }
./grpc-health-probe -addr=localhost:50051 -service=ferroid.IdGenerator
> status: SERVING
.proto file from ferroid-tonicIdGenerator.StreamIds for streaming ID allocationIdChunk) contains a packed byte buffer of IDsu64, u128) must be inferred by the clientIdChunk.packed_ids)