What is Redis? | Why and When to use Redis? | Tech Primers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] that's the Bell lichen on the YouTube app and never miss any updates from tech timers welcome to tech primers in this video we are going to see what is rated and where we can use Redis in our application so if you are not familiar with what is ready reader stands for remote dictionary server so Redis is extremely fast and it's an open source in-memory key value data structures - so where do we use Redis right you would have heard these four term read with respect to Twitter because Twitter user it is for caching okay so it used straightish for publishing and subscribing your client you wise as well so if I open Twitter client if let's say I open Twitter so the web UI connects to a web socket and that is like subscribing to a channel which the data is publishing to so if you see here this is my Twitter ID so this gets published subscribe to channel so in the backend of Twitter so they have a channel and then if there is a message they push it so if you see here the UI doesn't get researched but I see some to it here right so that is a twitter is using rated so basically RIT is is used for caching it can be used for session management it can be used for publisher subscriber based messaging and also it can be used in places where they have leaderboards where they want to publish n number of information immediately and they want to process them very quickly so basically this is very fast because everything is stored in in-memory so there there is no hardware involved in it so if you have a database you cannot compare reduce to the database because there in a database system data is stored in the hard drive so if you request for a data from the database the database is going to get the data from the hard drive and then return it back to you however Redis has everything in its cache so it this doesn't have anything in its hardware it can in fact you can redirect rate though store it in a hardware but it is a secondary option so by default Redis is a cache basically so if you want to use Redis you can load data from the RT VMs on the red disk cache use it wherever you want and then finally when you are done you can just throw it off so basically it's a caching database right so Redis was written on C language so it was written in C that is why it is extremely fast so if you you cannot compare anything with ready so read its class is extremely fast because it is written in C language right so let's see how to use Redis right so what I am going to do is I'm going to download it it so you can also download as well if you want to give it a try so I'm just going to download it from here it just has a slip I believe so I'm just going to say downloads and then save so let that get downloaded meanwhile you can download attachment so if you see here it has already got downloaded so I'm just going to say show unzip this guy clean so the unzip is complete so let's go to the command prompt and then so where's my and minty okay so I mean there it is the directory where I don't order than unzip so let's go to the source direct alright so if you are not familiar just yeah so what is there the source so there are lots of commands here if you see here there are dot C and dot H file these are basically the C language files good so let me go out and then I'll do a link because if you see here the the files were all like dot C files right so there were no runtime bin files which we can execute so basically I think we need to compile the Regice code because that's just a raw code I just need to compile these now so I just did a make so let's just get completed so then we will see how to run dot actually in fact it is done quickly cool so what I'm going to do is I'm going to go to source and let's say water all there so there are lots of files if you see here all the dot o files are all the ones which got created right now soap is here right now the time is eight twenty nine so it got fatal just now so there is a ready alike file as well so I'm going to just say ready CLI so why is could not connect to that it is that does it so now we need to run the radius server so what I will do is I will just go to the radius server so let me go to source R it is silver right so this is now ready to accept the server connection okay now I have opened another tab so what is happening here this aster server is up there it is server is up now so we are going to use the command line interface to connect to thee it is the server so I'll just do this yeah if you notice here I am just running the R it is CLI so the other server is now connected from the CLI okay so what can I do from here right so I can basically put the values into the data the data store basically that's what we said right so we can put values and then get the values so what we are going to do is we are just going to put some information inside the reddit cache and it is a key value store so we have to put them as key so we can to put anything inside a key so anything you want to put you have to have a key and you can put the value inside it so what I'm going to do is I'm going to say is sick if you notice you have by default is suggesting something so it is saying you have to put a key and then the value so in the in the in our case I'm going to have the key as the name okay and I'm going to provide the name as tech primers all right okay I'm going to press ENTER and it just said okay so that means the value got inserted the key and the value got inserted into the radius server so I need to get this out so I'm just take it and give me that okay so I'm just saying that get and made so this is like a hash map right so it is basically like an ash map air you put key and a value and then you get it by other key so that is what rel does this and if you notice a and here it is so fast one more thing which I liked extremely about the Redis caches you can have a subscriber publish of model without even having to create any drivers or stuff like that okay and also there are lots of polyglot libraries which you can use so what I'm going to do is I'm going to show you I'm going to run two different British caches and then I'm going to show you how to do publish a subscriber model so what I'm going to do here is I'm going to say subscribe okay and I'm going to say a channel name so if you notice here by default it is suggesting me that give a channel name so I'm going to say the channel name is tech primers okay I'm going to subscribe to this channel so basically nothing has come here right and here I'm going to do a publish to that channel so I'm going to publish some messages to that channel right so I'm going to say hello YouTube to that chain so if you notice here it said integers so one message got published I'm P notice here hello YouTube got received here right so in the subscriber we received the message which we published in the other channel so that is how the publisher subscriber box if you see here it is so simple right we just set up publish you just subscribed it nothing big okay and there are lots of libraries which are which are there in the Java or JavaScript or not even on Java scripts of the Java or three different poly or languages like Ruby Python and everywhere you can have different libraries which are providing lots of functionality and you can use them to communicate with the publisher and subscriber so there's another good thing about carrot inside so you don't have to store these messages in the end email in the hardware it is all stored in the cache so that is why Twitter if you notice they use the web sockets and then transfer the message or the poster message via the Redis cache on to the UI so that is a very good use case of using records then you want to have very fast and quick publishers of scatter model all right so that is what I want to show about what is the reddest so I hope you guys understood what is read is so in the next video we are going to see how to create a springboard application with a reddish cache so we are going to use spring data ready which spring provides in a spring board obligation and we are going to see how to create a simple application how to communicate with a retic server inside that application hope you understood what is read is I will just summarize what we discussed in this particular video so redness is a extremely fast open source in memory key value data structure store where we can use it for caching session management publisher subscribe model and wherever we want to have faster communication between the server and the client and you have like let's say you have multiple channels or multiple clients register to the server you can use Redis so you can load the data from the database on to redish cache and then use the cache to communicate with each other or use the cache as a faster medium for communicating with different different processes or microservices right and Redis is written in C language that is why it is extremely fast and if you're not aware latest stands for remote dictionary server okay so that is for this particular video meet again in the next video with the Redis springboard implementation thank you [Music]
Info
Channel: Tech Primers
Views: 84,883
Rating: 4.2790446 out of 5
Keywords: techprimers, tech primers, redis cache, what is redis, redis implementation, spring data redis, redis example, what is redis cache, why redis, when to use redis cache, redis fast, cache redis, remote dictionary server, redis server, what is redisserver, what is redis why and when to use, redis tech
Id: Wxd6sMUhgBg
Channel Id: undefined
Length: 10min 27sec (627 seconds)
Published: Fri Aug 18 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.