This is my first attempt in creating a high performance database system while learning Rust.
- Caching layer non-persistent (e.g. Redis) and persistent layer (e.g. Postgres SQL). (See https://redis.com/wp-content/uploads/2023/04/redis-enterprise-for-caching.pdf)
- In-memory cache (fastest, but volatile)
- Redis cache (medium speed, distributed)
- PostgreSQL database (persistent storage)
- Support 5000 read requests per second with subsecond average latency on each request.
- Support 5000 write requests per second with subsecond average latency on each request.
- High Concurrency
Clone the repository
git clone https://github.com/jacksonbaxter/high-performace-cache.gitEnter the project repository
cd high-performace-cacheBuild and run the project with Docker
# Build and start
docker-compose up --buildTo rebuild the project and restart the database
# Clean up first
docker-compose down --volumes --remove-orphans
# Rebuild and start
docker-compose up --buildStore a value in cache
# PUT request to store data
curl -X PUT -H "Content-Type: application/json" \
--data '{"some":"data"}' \
http://localhost:8080/cache/mykeyRetrieve a value
# GET request to retrieve data
curl http://localhost:8080/cache/mykeyDelete a value
# DELETE request to remove data
curl -X DELETE http://localhost:8080/cache/mykeyCheck health
# Health check endpoint
curl http://localhost:8080/cache/health