Giter Site home page Giter Site logo

app-redis's Introduction

HW #3 Proxies, Queues, Cache Fluency

Setup

  • Clone this repo, run npm install.
  • Install redis and run on localhost:6379

Files

  1. main.js
    main.js is the main program which takes a port number as input.
    Initially, an app server listens at the given input port number.
    Run it as: node main.js 3001
  2. package.json npm install will install all the required dependencies for the main.js program listed in the package.json file.
  3. img
    This folder has images which are used in the demo.

Implementation:

Part 1 : set/get

/set sets a new key with the value "this message will self-destruct in 10 seconds"
Key expires in 10 seconds.
Alt

/get fetches the value of the key and sends it to the client.
Alt

Part 2 : recent

/recent stores the most recent 5 sites visited, and returns that to the client.

Alt
command line:
Alt

Part 3 : upload/meow

/upload stores all the uploaded images in a queue.
Alt

/meow displays the most recent image to the client and removes the image from the queue.
Alt

Part 4 : spawn

/spawn creates a new app server running on a new port and stores the new app server URL in a list.
Alt

Alt

Part 5: destroy

/destroy selects a random server from the list of available server and removes it from the list and server is not used to handle any requests.
If only one server is available in the list of active servers then this server cannot be destroyed.
Alt

Part 6: listservers

All the available servers are stored in redis queue.
/listservers displays all the servers in this queue.

Alt

Part 7 : proxy server

Requests made on the proxy server port is uniformly distributed among all the available servers in a round robin fashion.

![Alt](https://github.ncsu.edu/psjawale/HW3/blob/master/screenshots/proxy server.png "proxy")

Screencast :

YouTube link

app-redis's People

Contributors

psjawale avatar

Watchers

James Cloos avatar  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.