0% found this document useful (0 votes)
21 views5 pages

Scipt

The document presents a video report on Redis, a NoSQL database management system known for its in-memory data structure capabilities, supporting various data types such as strings, lists, and hashes. It highlights Redis's advantages, including sub-millisecond query responses, master/slave replication, and its use as a caching solution to improve data access speed. A demo showcases session and cache management in a Node.js application, illustrating Redis's effectiveness in enhancing data retrieval performance.

Uploaded by

20522164
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

Scipt

The document presents a video report on Redis, a NoSQL database management system known for its in-memory data structure capabilities, supporting various data types such as strings, lists, and hashes. It highlights Redis's advantages, including sub-millisecond query responses, master/slave replication, and its use as a caching solution to improve data access speed. A demo showcases session and cache management in a Node.js application, illustrating Redis's effectiveness in enhancing data retrieval performance.

Uploaded by

20522164
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Side 1

Hi teacher, in this video. My team will report out research about 1 of the database
management systems developed with NoSQL style is Redis. We will take a brief look at
Redis, as well as highlight the fundamental difference between Redis and other DBMS.
My team includes of 3 member: ....
Slide 2
We will go over 4 part... And the last of video we will talk about an important features of
Redis is Redis Cache and demo it on building a node.js app that show session & cache
management using Redis Cache.
Slide 3
Okey so what exactly is Redis. It’s a pretty awesome technology it's an open source in-
memory data structure store and it can be used as a database and/or a caching system and
a message broker so if you really wanted to classify it as a certain type of know SQL
database I think it best fits into a key value store the structure is actually incredibly
simple alright so one of if not the best feature of Redis is the huge range of data types or
data structures that it supports such as lists sets and so on and I'll be going over these in
depth throughout this report video.
Redis also has built-in replication master-slave replication that allows Redis servers to be
exact copies of master server smasters can have multiple slaves and replication is done
asynchronously meaning that the master will continue to handle queries when slaves are
synchronizing all right I'm not going to really get into replication because there's a lot to
it and it’s advanced knowledge.
Slide 4
no SQL is an informal loosely defined term for non-relational structured data storage
systems like MongoDB man cached CouchDB or Cassandra so following in the footsteps
of other no SQL databases such as Cassandra CouchDB or MongoDB Redis allows the
user to store vast amount of data they doubt the limits of relational databases so in no
SQL databases data can be stored in non-relational way
Slide 5
now what does the name Redis mean ready stands for remote directory server it is often
referred to as a data structure server since the keys can contain strings hashes lists sets
and sorted sets so because the keys can contains these type of different data structures it's
often referred as a data structure server right so the name come from remote directory
server
Slide 7
Unlike RDMS like MySQL, or PostgreSQL, Redis has no tables. Redis stores data as
key-values. In fact, memcache does the same, but the data type of memcache is limited,
not as diverse as Redis, so it does not support many operations from the user. Below is a
brief overview of the data types Redis uses to store values.
Slide 8
let's take a look at the data types that reddit supports so we're going to cover these the
ones on the left mostly the ones on the right are a little more complicated and beyond the
scope of this core so we have strings which are the most basic kind of rennet a string can
contain any kind of data then we have lists which are simply lists of strings and we'll be
going over all the commands to push on just onto lists and take off take strings off of
them and so on sets are an unordered collection of strings we can add remove and we can
test for existing members of a set then we have sorted sets which are non repeating
collections of strings okay each member of a set is associated with something called a
score and will go on to that we'll get into that later and then we have hashes which are
basically key value pairs these are the perfect data types to represent objects you can
almost compare hashes with JavaScript objects or JSON when we build our node
application this is what will mostly be working with all right and then bitmaps and hyper
logs these are actually based on strings but have their own set of semantics all right we're
not going to really get into that it's more important for you to understand the ones on the
left all right
Slide 9
Redis supports Master/Slave Replication. Data from any Redis server can be replicated to
any replica. This is not a very prominent feature, other DBMS have this feature, but
mentioned here to remind that, Redis is no less than DBMS in Replication feature
Slide 10
The primary benefit of Redis is its sub-millisecond queries. Redis runs in-memory, which
enables low-latency and high throughput. Running in-memory means requests for data do
not require a trip to disk. This leads to an order of magnitude more operations and faster
response times. Redis is one of the only databases that supports millions of operations per
second.
Slide 11
Cache is cache memory, a temporary data storage area on the device, which stores
certain types of data.
For example, if you save your facebook username and password on your phone, the next
time you access it, your phone will automatically log in to facebook without having to re-
enter your password and username. That's because the information is already cached.
Slide 12
Thus redis cache is an open source code used to create a server to be used as a cache.
Using redis cache is suitable for systems with frequently accessed data by users, it helps
to speed up data access.
Slide 13
For frequently accessed data items, the redis cache has a response time of less than a
millisecond. It also allows users to easily scale data to accommodate high loads without
increasing backend. This saves a lot of money.
People often use redis cache to cache websites, cache with commonly used files such as
images, metadata files. In addition, it is also used as a data query result cache when
searching, a session cache.
Slide 14
 Database storage on redis cache has many advantages as follows:
o Reduce data access latency because data access speed will be faster.
o Increase device and application productivity
o Reduce the load on the device's database
 Redis supports most connection protocols and programming
languages. Supported languages include: Java, javaScript, Python, PHP, Perl,
Node.js, C/C#, C++, Ruby, Go.
 Redis creates a highly extensible data storage server that can be shared with
many different processes, applications and servers.
 Redis cache is easier and simpler to use because redis allows to write fewer
lines of code to store, access and use data on the application.
 Another Redis is an open source, so the source code is constantly being
updated by users, the ability to improve the quality of the source code is
higher. Errors are also quickly handled.
Slide 15
Demo
Demo app that shows session & cache management for a Node.js app using express-
sessions and connect-redis.
Session: The app queries an API for ML-generated craft beer names and displays them on
the page. There is a session management panel that displays session ID, time until the
session expires, and the number of beer names viewed in that session.
Cache: The app fetch/query data and save it to redis for caching.
Make sure you have have Redis server running locally (and mysqld):
redis-cli
Then in your browser, go to http://localhost:3000. It should look something like this:
In file routes/repos.js, we defined:
Function getRepos:
Purpose: Get the repository number of a certain Github user.
API: https://api.github.com/users/${username}
After fetching the data, write the obtained data to Redis.
Cache function: This is the middleware to check if the data is being cached in Redis or
not.
Here, using the cache aside strategy, if there is no data in the cache check, the application
will switch to getting the data through the API.
The TTL(Time-To-Live for Caching) is set to a random value between (3600, 4200).
Result
1st query:
After the first query with the username “nqkhanh2002” entered, we see that the repos
runs in 583ms. After being queried for the first time, the results will be saved to the redis
server.
2nd query:
Querying again with the username "nqkhanh2002" as above, we see that the query time is
nearly 20 times faster because instead of getting data from the api, the application gets
data from redis.
Check the data on Redis:
Open the Redis CLI, type the command KEYS * to retrieve all the keys that are being
saved, see that Redis is saving the key as nqkhanh2002.
Conclusions
From the demo above, we can clearly see the effect of Redis in increasing data retrieval
speed. Using Redis as a cache is suitable for systems that have frequently accessed data
by users. In addition to being used as a cache, Redis has countless other useful
applications that we should learn more about.
The github link for the demo above: https://github.com/nqkhanh2002/redis-caching (This
link includes the Redis app demo to save the session)

You might also like