Revoke Framework
A high-performance microservices infrastructure framework built with pure Rust, providing comprehensive components for building distributed systems.
Features
- π High Performance: Built on async Rust with minimal overhead
- π API Gateway: Powered by Cloudflare Pingora for exceptional performance
- π Service Discovery: Dynamic service registration and discovery
- βοΈ Configuration Management: Centralized configuration with hot-reloading
- π Distributed Tracing: OpenTelemetry integration for observability
- π¨ Message Queue: Unified interface for various MQ systems
- π‘οΈ Resilience: Circuit breakers, rate limiting, and retry mechanisms
- π¦ Pure Rust: No external system dependencies, just Rust
Quick Start
Add revoke to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Basic Example
use *;
use Arc;
async
Feature Flags
Individual Components
gateway- API gateway with load balancingregistry- Service registry and discoveryconfig- Configuration managementtrace- Distributed tracingmq- Message queue abstractionsresilience- Circuit breakers and resilience patterns
Feature Combinations
default=full- All features enabledminimal- Only core functionalityservice-mesh- Gateway + Registry + Config + Tracemessaging- Message Queue + Configreliability- Resilience + Registry
Usage Examples
Only core functionality:
= { = "0.1", = false }
Service mesh components:
= { = "0.1", = false, = ["service-mesh"] }
Custom selection:
= { = "0.1", = false, = ["gateway", "registry"] }
Components
API Gateway
High-performance API gateway built on Pingora:
use *;
use RevokeGateway;
let config = GatewayConfig ;
let gateway = new?;
gateway.run?;
Service Registry
Dynamic service discovery with health checking:
// Memory registry for development
let registry = new;
// Consul registry for production
let consul_config = builder
.address
.build?;
let registry = new;
Configuration Management
Centralized configuration with hot-reloading:
use ;
let config = new;
config.set.await?;
let db_url = config.get.await?;
Circuit Breaker
Protect against cascading failures:
use ;
let breaker = new
.failure_threshold
.success_threshold
.timeout
.build;
let result = breaker.call.await?;
Rate Limiter
Control request rates:
use ;
let limiter = new
.requests_per_second
.burst_size
.build;
if limiter.check_key.await? else
Complete Example
Here's a complete microservice setup:
use *;
use RevokeGateway;
use ;
use Arc;
async
Architecture
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β API Gateway ββββββΆβ Service Registryβββββββ Microservice β
β (Pingora) β β (Consul/Memory)β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β βββββββββββββββββββ β
βββββββββββββββΆβ Config Provider ββββββββββββββββ
β (Consul/Memory)β
βββββββββββββββββββ
Performance
Revoke is designed for high performance:
- Zero-copy message passing where possible
- Async/await throughout for optimal concurrency
- Connection pooling and reuse
- Efficient serialization with serde
- Minimal allocations in hot paths
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Acknowledgments
- Built on Pingora by Cloudflare
- Inspired by Spring Cloud and other microservice frameworks
- Thanks to the Rust async ecosystem