Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiisanda/pandas-pouch
πΌπΌA Distributed Caching Service in Rust π¦π¦
https://github.com/jiisanda/pandas-pouch
cache distributed distributed-systems grpc pandas-pouch postgresql rust tokio tonic
Last synced: about 7 hours ago
JSON representation
πΌπΌA Distributed Caching Service in Rust π¦π¦
- Host: GitHub
- URL: https://github.com/jiisanda/pandas-pouch
- Owner: jiisanda
- License: mit
- Created: 2024-03-08T17:47:51.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-17T17:54:54.000Z (about 2 months ago)
- Last Synced: 2024-09-17T22:13:49.434Z (about 2 months ago)
- Topics: cache, distributed, distributed-systems, grpc, pandas-pouch, postgresql, rust, tokio, tonic
- Language: Rust
- Homepage:
- Size: 173 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![banner](static/banner.png)
# πΌ pandas-pouch πΌ
A Distributed Caching Service with Rust π¦π¦.
## Progress
- β Basic Cache
- β LRU Cache
- β Database Setup
- β API Integration
- β Docker Setup
- π‘ Consistent Hashing
- π‘ Distributed Cache - Dedicated cache cluster## Pre-requisites
- [Rust](https://www.rust-lang.org/tools/install)
- [Docker](https://docs.docker.com/get-docker/)
- gRPC
- [grpcurl](https://github.com/fullstorydev/grpcurl)## How can pandas-pouch be used with current features?
### Configuration
Create a `config` directory. And add `default.toml` file with the following configuration.
Sample default.toml file is provided in the `config` directory [config/sample_default.toml](config/sample_default.toml). Also add a `.env` file with the
configuration in [config/.env.sample](config/.env.sample) file.### Running the Service
1. Clone the repository and navigate to the project directory.
```bash
git clone https://github.com/jiisanda/pandas-pouch.git
cd pandas-pouch
```2. Start the service using `docker-compose`.
```bash
docker-compose build
docker-compose up
```### Interacting with the Service
You can use `grpcurl` to interact with the service. Install `grpcurl` using the installation guide in the [grpcurl repository](https://github.com/fullstorydev/grpcurl)
Run the following command to interact with the service.
1. Put operation
```bash
grpcurl -plaintext -proto proto/pandas_pouch.proto -d '{"key": "key2", "value": "value2"}' 0.0.0.0:50051 pandas_pouch.PandasPouchCacheService/Put
```2. Get Operation
```bash
grpcurl -plaintext -proto proto/pandas_pouch.proto -d '{"key": "key2"}' 0.0.0.0:50051 pandas_pouch.PandasPouchCacheService/Get
```3. PrintAll Operation
```bash
grpcurl -plaintext -proto proto/pandas_pouch.proto 0.0.0.0:50051 pandas_pouch.PandasPouchCacheService/PrintAll
```### pandas-pouch as a crate
To use pandas-pouch as a crate, add the following to your `Cargo.toml` file.
```toml
[dependencies]
pandas-pouch = { git = "https://github.com/jiisanda/pandas-pouch.git" }
```Using it in code:
```rust
use pandas_pouch::Client;#[tokio::main]
async fn main() -> Result<(), Box> {
let mut client = Client::new("http://localhost:50051").await?;
// put a value
client.put("key1".to_string(), "value1".to_string()).await?;
// get a value
let value = client.get("key1".to_string()).await?;
println!("Value: {:?}", value);
Ok(())
}
```## License
This project is licensed under the [MIT License](LICENSE).