https://github.com/ats1999/dakia
A high-performance API gateway built with Rust, designed for low-latency request processing. Dakia supports dynamic configuration updates, allowing seamless changes to routing rules, authentication settings, rate limits, and other gateway policies without requiring a restart.
https://github.com/ats1999/dakia
api dakia gate-way http load-balancer proxy rust tcp udp websocket
Last synced: 10 months ago
JSON representation
A high-performance API gateway built with Rust, designed for low-latency request processing. Dakia supports dynamic configuration updates, allowing seamless changes to routing rules, authentication settings, rate limits, and other gateway policies without requiring a restart.
- Host: GitHub
- URL: https://github.com/ats1999/dakia
- Owner: ats1999
- License: apache-2.0
- Created: 2023-08-01T17:42:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T03:35:29.000Z (10 months ago)
- Last Synced: 2025-03-18T04:29:36.781Z (10 months ago)
- Topics: api, dakia, gate-way, http, load-balancer, proxy, rust, tcp, udp, websocket
- Language: Rust
- Homepage:
- Size: 12.6 MB
- Stars: 82
- Watchers: 4
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Dakia: An API gateway tailored for modern distributed systems
**Dakia** is a high-performance API gateway built with Rust, designed for low-latency request processing. Dakia supports **dynamic configuration updates**, allowing seamless changes to routing rules, authentication settings, rate limits, and other gateway policies **without requiring a restart**. This ensures high availability and adaptability in rapidly evolving microservices architectures. Additional features include request routing, load balancing, caching, and fault tolerance, making it a robust solution for modern distributed systems.
> It's under construction ๐ฆบ ๐ช ๐๏ธ ๐ง ๐จ
## Feature highlights
- **Configurable**: Easily manage API configurations using various formats like YAML, JSON, and HTTP API calls.
- **Extensible**: Add new functionality with support for custom middleware and plugins, written in any programming language (Rust, Java, C++, etc.).
- **Fully Programmable**: Tailor the API Gateway to your specific needs with custom plugins and middleware in multiple languages.
- **Zero Downtime Upgrades**: Perform upgrades and restarts without affecting the availability of your services.
- **Dynamic Middleware**: Add, remove, or modify middleware on the fly without disrupting service.
- **Request and Response Management**: Modify requests before they reach the upstream or read/write responses to meet your application's needs.
- **Real-Time Configuration**: Modify your gateway configuration in real time with no downtime, using HTTP API calls.
Dakia ensures your services stay performant, reliable, and highly customizable, giving you full control.
## Limitations โ ๏ธ
> These limitations will be addressed over time as we continue to improve the dakia.
- Currently supports only `UTF-8` character encoding.
- Only the round-robin load balancing algorithm is available at the moment.
- IPv6 addresses are not supported at this time; only IPv4 is supported.
- Currently it supports only `HTTP` protocol
## Reasons to use `Dakia`
- **Security** - Built with Rust, Dakia ensures enhanced memory safety and reduces vulnerabilities compared to services written in C/C++.
- **Performance** - Powered by [pingora](https://github.com/cloudflare/pingora), a battle tested protocol implemention, as it has been serving more than **_40M+_** internet requests per second for more than a few years.
- **Customization** - You need ultimate customization, you can configure, extend and even further program in multiple languages.
- **Asynchronous and Multi-Threaded** โ Dakia is designed to handle tasks concurrently, ensuring efficient and high-performance request processing by default.
**_Benchmark of Dakia on a Local Machine (8 CPU Cores, 16GB RAM)_**
```txt
Performance test: 10s @ http://0.0.0.0:80
- 1 thread, 100 concurrent connections
Thread Statistics:
- Average Latency: 699.64ยตs (ยฑ125.23ยตs)
- Maximum Latency: 3.77ms
- Requests per Second: 76.09k (ยฑ3.98k)
- Peak Requests per Second: 81.89k
Total Requests: 764,590 in 10.10s
Data Transferred: 80.94MB
Throughput: 75,678.12 requests/sec
Transfer Rate: 8.01MB/sec
```
## Architecture

## Getting started
- See our [quick starting guide](/docs/quick_start.md)
- See our [docs](/docs/README.md)
## ๐ Progress Tracker
[Dakia Configuration Sample](https://github.com/ats1999/dakia/blob/main/docs/config.sample.yaml)
| Task | Status |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Configurable(YAML + JSON) | Done โ
|
| Virtual Host | Done โ
|
| Wild card host matching ([Wiki](https://en.wikipedia.org/wiki/Matching_wildcards)) | Done โ
|
| Wild card route ([Wiki](https://en.wikipedia.org/wiki/Matching_wildcards)) | Done โ
|
| Proxy | Done โ
|
| HTTP Protocol Suport | Done โ
|
| [Upstream SSL support](https://en.wikipedia.org/wiki/Server_Name_Indication) | Done โ
|
| Load Balancer | Done โ
|
| Filter (MongoDB like query support) | Done โ
|
| Dakia CLI | Done โ
|
| [PCRE](https://www.pcre.org/) support for pattern matching | Done โ
|
| Extension, Interceptor & Interceptions Phases (Inbuilt Rust) | Done โ
|
| Declarative filter support [(Allows to use MongoDB like query syntax for filtering HTTP requests)](https://github.com/ats1999/dakia/blob/main/docs/config.sample.yaml) | Done โ
|
| [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) Support for interceptor | Pending |
| [UDS Support](https://man7.org/linux/man-pages/man7/unix.7.html) | Pending |
| Load Balancer Algorithms (Least connection, Least response time, IP/Url hash) | Pending |
| SSL Support | Pending |
| Certbot Integration | Pending |
| Controller (API to manage dakia over REST) | Done โ
|
| TCP/UDP Proxy | Pending |
| Web Socket Proxy | Pending |
| gRPC Proxy | Pending |
| Docs | In-Progress ๐ |
### Load Balancing Algorithm
| Algorithm | Status |
| ------------------- | ------- |
| Round robin | Done โ
|
| Least connection | Pending |
| Least response time | Pending |
| IP/URL hash | Pending |
### Interceptor
| Interceptor | Description | Status |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| Server Version | Append server version into http response header. E.g `Dakia/1.0.1` | Done โ
|
| Request ID | Append request id(UUID) into upstream request and downstream response headers. | Done โ
|
| Basic Auth | [Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) | Done โ
|
| Basic Auth ( External Storage Integration ) | Use external storage for storing user name and password, support hashing. | Pending |
| JWT Auth | [Support JWT authentication](https://jwt.io/) | Pending |
| Use File | Read data from a file and return its contents as the response. If the file is not found, respond with a 404 error. | Done โ
|
| Use File ( Path rewrite support ) | Allow to rewrite HTTP request path | Pending |
| Try File | Read data from a file and return its contents as the response. If the file is not found, make request to upstream, write response to file and then serve response. | Pending |
| Controller | Allow to update dakia configuration in **_YAML/JSON_** format via REST endpoint without restarting the gateway | Done โ
|
| Rate Limiter | Token bucket rate limiter algorithm | Done โ
|
| Prometheus Integration | Expose server interval metric using prometheus (New TCP connection, Reused TCP connection, TCP connection failure, etc) | Pending |