Skip to content

uchiha-vivek/Redis-concepts

Repository files navigation

Redis Concepts :

Redis Logo

Redis

Installation of Redis in Ubuntu

sudo apt update
sudo apt install redis-server -y

Enable Redis to start automatically

Edit the redis config:

sudo nano /etc/redis/redis.conf

Change the following line

change supervised no to supervised systemd Save and exit

Open Redis CLI

redis-cli

Test

127.0.0.1:6379> ping
PONG

Official Installation Docs

The following repository contains the performance of api using redis . We generally see the response time of request with both caching and no-caching

Installation Steps:

git clone https://github.com/uchiha-vivek/Redis-concepts.git
cd Redis-concepts

Install the dependencies

npm install

Run the file

node index.js

How to test :

Once the server is running

Call cached endpoint (first time hit's miss)

curl "http://localhost:3000/photos?albumId=1"

call cached endpoint again(hits)

curl "http://localhost:3000/photos?albumId=1"

Invoke no-cache endpoint

curl "http://localhost:3000/photos-nocache?albumId=1"

Test and check the metrics:

curl "http://localhost:3000/metrics"

Performance Metrics:

Redis Logo

Data Structures in Redis

The following data structures have been included:

  • List
  • String
  • Set
  • Sorted Set
  • Hash
  • JSON

Link of Data Structure

Ways to test it

Navigate to data-structures folder Run node structure.js

Test the following below api's

List

http://localhost:3000/api/v1/list

String

http://localhost:3000/api/v1/string

Set

http://localhost:3000/api/v1/set

Sorted Set

http://localhost:3000/api/v1/zset

Hash

http://localhost:3000/api/v1/hash

JSON

http:/localhost:3000/api/v1/json

About

Understanding primary concepts of Redis!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published