Table of Contents
Overview
BakBon is an lightweight infrastructure microkernel library in Rust created to help configure, compose and build any type of message-driven distributed system whether it is microservices, blockchain insfrastructure IoT networks, by providing generic building blocks such as routers, gateways, balancers, queues, caching systems.
Features
- Protocol-Agnostic: works with TCP, UDP, HTTP(s), gRPC, MQTT, Serial, InProc or custom protocols.
- Composable: mix and match different components (Router, Queue, Gateway, Balancer, Cache, etc).
- Type-Safe: strong typing with runtime flexibility.
- Production-Ready: Comprehensive tests, clean architecture.
Installation
cargo add bakbon
File System
π bakbon
β
βββ π src
β β
β βββ π balancer
β β β
β β βββ π mod.rs
β β βββ π strategy.rs
β β
β βββ π cache.rs
β β β
β β βββ π builder.rs
β β βββ π eviction.rs
β β βββ π mod.rs
β β
β βββ π core
β β β
β β βββ π address.rs
β β βββ π error.rs
β β βββ π mod.rs
β β βββ π protocol.rs
β β
β βββ π infra
β β β
β β βββ π gateway.rs
β β βββ π middleware.rs
β β βββ π mod.rs
β β βββ π processor.rs
β β βββ π service.rs
β β βββ π storage.rs
β β
β βββ π message
β β β
β β βββ π envelope.rs
β β βββ π mod.rs
β β βββ π route.rs
β β
β βββ π queue
β β β
β β βββ π attributes
β β β β
β β β βββ π delivery.rs
β β β βββ π durability.rs
β β β βββ π mod.rs
β β β βββ π ordering.rs
β β β βββ π provider.rs
β β β
β β βββ π builder.rs
β β βββ π mod.rs
β β
β βββ π registry
β β β
β β βββ π builder.rs
β β βββ π mod.rs
β β
β βββ π router
β β β
β β βββ π builder.rs
β β βββ π mod.rs
β β
β βββ π lib.rs
β
βββ π tests
β β
β βββ π common
β β β
β β βββ π services
β β β β
β β β βββ π echo.rs
β β β βββ π mod.rs
β β β
β β βββ π gateway.rs
β β βββ π mod.rs
β β
β βββ π integration_gateway.rs
β βββ π integration_queue.rs
β βββ π integration_router.rs
β
βββ βοΈ Cargo.toml
βββ π LICENSE
βββ π README.md
14 directories, 40 files
Modules
BakBon provides:
- Balancer: Balancer.
- Cache: Cache.
- Core: Address, Protocol, Error, Result.
- Infra: Gateway, Middleware, Processor, Service and Storage traits.
- Message: Envelope, Route, Reply, Headers, Payload.
- Queue: Queue.
- Registry: Registry.
- Router: Router.
Usage
use *;
let url = "http://services.com/echo";
// Create an address from url
let address: = parse;
assert!;
// Create a service with the address
let service = new;
// Register the service while building a registry
let registry = builder
.register
.build;
// Build a router
let mut router = builder
.registry
.build;
// Create a message.
let message = new;
// Route the message to the appropriate service
let reply: = router.route;
assert!;
Attribution
If you use this project in your application, service, or research, please include the following credit:
Based on Bakbon by Xn!l0 (https://github.com/Xnil0/backlab), licensed under the MIT License.