Code Monkey home page Code Monkey logo

distributed-cache-service's Introduction

distributed cache service

A rapid and scalable data storage system distributed across multiple nodes, designed to sustain high-performance reading. Utilizes Zookeeper for configuration management and consistent hashing for efficient key-value storage and retrieval under the hood.

System idea

image

Setup

Clone the project

git clone https://github.com/KhushPatibandha/distributed-cache-service.git

Go to the project directory

cd .\distributed-cache-service\

kubectl install

https://kubernetes.io/docs/tasks/tools/

MiniKube install

https://minikube.sigs.k8s.io/docs/start/

Deployment

cd K8SYamlFiles/

Run Zookeeper server on your minikube cluster

kubectl apply -f zkDeployment.yaml
kubectl apply -f zkService.yaml

Launch the cache client

kubectl apply -f clientDeployment.yaml
kubectl apply -f clientService.yaml

Launch cache servers

kubectl apply -f serverDeployment.yaml 

Port forwarding (Most Important)

kubectl port-forward <name of client pod> 5000:5000

API Reference

Get item

  GET /api/get/<yourKey>
Parameter Type Description
cache key string Give cache key to retrive it's value

Post Key-Value

  POST /api/post?key=<yourKey>&value=<yourValue>
Parameter Type Description
cache key and value string, string Post your key-value

Auto scaling

Run autoscaling bash file.

bash autoScalingScript.sh 

Stress test

Create a traffic pod

kubectl apply -f trafficGen.yaml

SSH into traffic pod

kubectl exec -it trafficgen -- sh 

install wrk benchmark tool

apk add wrk

Test

wrk -c 10 -t 10 -d 300s -H "Connection: Close" http://cache-client:5000/api/get/khush

TODO

Implement rehashing of keys once a new server is scaled up or scaled down. The current implementation doesn't have rehashing for keys, hence it might result in cache misses if servers are scaled up. It will work perfectly once they are scaled down again.

distributed-cache-service's People

Contributors

khushpatibandha avatar

Stargazers

Abhishek Joshi avatar Om Kansara avatar Tim Kersey avatar Davide R. Wiest avatar Clayton Kehoe avatar Mantra Gohil avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.