hello everyone welcome back to my channel this is sambhu from cloudtech today I will show you how we can use Amazon elastic cassette like what the use of this one and and what basically advantage and disadvantage about this elastic assay and then which all casting mechanism like distribute Cassie mechanism we can configure by using this elastic acid so this by naming itself you guys can understand like gassing means like it's a kind of in memory uh like service which you which provide you like instead of making call in the back end like each and every time in that server level making the call you can get that whatever entry you are looking that entry you can get from this cache and this Amazon elastic has basically it's support like two uh caching mechanism one is the radius cassette and other one is the meme casting okay so this two engine basically it will support and I have a plan to give demo by using radius and as well as the meme casting and today's session I am planning to give you like how we can configure the radius Cassie and then in real life example how we can use like programmatically if you want to use by python or if you want to use by any VC for instance Amazon ec2 instance how we can use so I will show you both okay guys and then in my next subsequent video I will talk about mimecast okay guys so let's I haven't already logged in in that uh Azure like this is the AWS sorry AWS console and I am in the Virginia region if you uh click on search like elastic assay you will get this and this is what I have got here and if you see like it's a like a performance reliable and cost effective in memory casting oil complexity associated with the deploy in managing a Distributors caching environment and okay guys and it's these also possible I scale in scale out that also benefit is there and there are defined use case like you can use like uh if I give the real life example like uh where like suppose you have a like a like you have an application that is like a backup application or maybe e-commerce application or maybe like a Netflix kind of thing application right in that application uh instead of like each and every time whenever user hitting the request right some movie name or something right that what we can do by using this cassing thing we can store that two cache instead of make it so that it will be more performance basically is all this like you perform because if you have some database query suppose a multiple table join or maybe select query if you you have some mechanism right to get the data from the database so execute that query it will take some time right so performance indices like once we execute it then store the data in caching if the cache is available then only to make the call back it you can get it from the Cassie so that's the benefit of that so let's go how we can create so let's get start here and this is the option here one is the first VPC is required so if you not yet watched my previous video how we can create the frequency I will recommend guys you can have a look but today's session I Will Show You by default VPC and then we'll create the cluster like uh for redis only will go uh let's click on redisk if you click redis but before that let me tell you one more thing here so if you want to create this either is a radius or memecast right you need the subnet group so before creating the caching because this is the thing we need actually so before that let's create the subnet group here let's keep that something like that and then select the default VPC and for that VPC ritual uh like subnet is available that you can select if you want you can assert also available so for that minimum two subnet you have to select here you can select like if you click here manage like then you can select which are now Baidu for all are selected if you want you can deselect also and you can select accordingly but if you want a z multi available uh like a availability Zone then at least two subnet here is required okay guys then tag is optional if you want you can give it so subnet creation is done so now let's go to again here and now click create here multiple options like to create like one is the easy and that is the best practice and configure you can always recommend to use this one or if you have already and a new cluster this results one and if you have from backup restore this one you can so let's go for easy and this configuration section is very important guys so depend on what you are using right so if you are having production system then you can use this one because uh this is like a cost effective and some performance memory all this thing will combine so if your day about testing purpose you can use this one for demo I would or learning purpose I would recommend it use this one so accordingly whatever you select that this uh it will get change your charge like for pricing charge will get changed okay guys so let's give the name like that any name you can give here and then here Network section let's select the which network you want ipv4 dwell or wherever you want and then here we have a subnet group I told you right before that I have created the summary if you don't have then here if you click then here itself you can create the subnet group also there that option is also available and here you can manage that same thing what we have done before creating so I have already created so let's select that existing one so let's select here and this is the thing we created and these all the availability zones selected then default settings so this is like a hotel thing is there a port right so radius casser basically Port is six three seven nine so by default is any this is the port like default Port kind of thing and this other thing is that virtual is module module like you can modify or virtual you cannot modify right it's more type this is since we are doing demo this is that more type and Security Group the default Security Group selected then param group this is the thing is selected engine version this one are modified here if you see right editable after creation also if you want which is yes is there then that you can edit which is more is there you cannot edit actually those so that's the one more uh like the now I can say like uh engine uh version if you want to modify later you can modify that also okay then replication selected zero as of now if you want replication means like suppose like multiple backup kind of thing right so maybe you find I am talking about EMR all this thing right that time I will give more details about this replication that time it will be very useful also replication means you if you want to make the maintenance the backup copy suppose instead of a single copy if you want to make two copy three copies something like that okay now a z is disabled by default if you want you can modify an encryption that also disable an automatic backup also now I have deserve it okay if you want you can do that also after creating also this can be modifiable if you see here whichever parameter sorry you can modify and which are you not able to modify that option also here there right tag is optional if you want you can keep the tag otherwise you can just simply click okay now it is started creating so it will take some time to compute meantime what we can do uh since this caching I am planning to use from Lambda right so let's create one Lambda function also so let's come here Lambda here climbed and something like that and let's select the python version here in here uh deep details I have already talked about today I will just quickly go to that if you want you can modify that settings also like if you want exit existing role you can use existing road if you want to enable the VPC let's select the VPC or default VPC and then choose the subnet here and then let's select the security group this one I have already explained deep details guys in my previous video so if you not yet watch I would recommend it please watch this in that high level how we can configure the Lambda function I already explained this so I will suggest you to have a look flat so now case foreign basically need the dependency right radius dependency let me show you the code so that you will get clearly I understood like so this is the radius Lambda function I have written and here we are planning to import this ready side so this dependence is required so I have already explained like how we can add that this kind of dependency through AWS layer right so if you guys not yet watched my previous video about how we can add the uh create the layer this kind of dependency I will give that link to this video description so I have already created the layer so let's use that layer and if you guys have any doubt about the how to create layer or edit anything please put the doubt in this video uh comment section I will address that and also I would recommend you uh please watch that layer how we can create a layer all that that video please watch it okay so now add layer and python choose that existing specified Arn if you want a custom layer here we have created one already side so version also we have to so let's select this this is the layer I have created where I have included the religious dependency okay guys let's add this one so now it is adding this layer so that we can access otherwise it will give that this module is not found what it's showing okay because we are not able to modify why because this Lambda that Lambda whatever okay let me go to permissions pending state creating creating function oh still that Lambda function it is in creating status so just mute see it's still in creating since we configured a PPC all right so that's why it is taking time if you guys not specified VPC all then it won't take this much time at least that's why it is taking time just a minute let's see what it is happening here meantime what we can do we can launch one easy to instance also because I will show you how we can connect from VC to instance also so let's come here running let's launch instance so it is something like that let's select this default let's select the key here here let's select the security group which I I have already explained the security group all this video so I will if you guys have any doubt or if you want to see more details I will recommend it watch my previous video about the security group so this is done and see instance is launching here okay so radius is going on what this python python still is going on now okay whatever it is this is also still creating yeah still that is in creating mode so yeah now it is created if you see now Lambda function is created now we put to add this layer here check yeah now layer is added here so we are good here so if you see one is there right it was zero and if you just click here if you want to modify you can modify also so how we can modify how we can create the layer you will get idea because this is required otherwise you can't access this Lambda from the radius and for that what dependency I have added let me show you that so this radius I have added in that okay guys now let's create this rest these are the environment variable Lambda environment variable so more details I have already explained in my previous video about this environment variable what basically and what purpose we can use so let's create this and value once this radius is created right we can get this value so let's add another one and Port we need here so it is post name this port password is the optional if you have any password then only you need to give otherwise you no need to give so let's skip this value we need to give it still creating mode still creating and still it is creating if you see here right it is still creating so it used to take some time to reply because there are distributed cluster mode right so here it will come some endpoint so what is going on let's do it and here if you want you can select a multiple node also so I have selected on the single node because this is a demo right so it's going meantime what we can do save it relate it later this value and come into code section let's add our code let's explain the code what I have written here let's take this code here let's import what I am going to do this I if you don't know about this Lambda right so please watch my previous video I have already explained this part so what I am going to do I am reading from environment variable like it is for host and if you have any password password and the port okay guys once we have all this thing right if you don't provide anything then we are sending like this this is mandatory and it will we are returning in like a Sur internal server error kind of thing once we got all the details right then I am getting the radius connection like uh this is the radius uh Constructor in this what I am passing host endpoint and decode response I am true so by using this one you can get the ready readys connection client once we get right then we are good to set like now I am setting one key Cloud tag and then redist demo from Lambda python this is the value I am setting then next to that I am just trying to get this value from the cache this is what I am trying to do from Lambda I am trying to connect the radius and then from that what I can say from this uh whatever value is set to this cache then I am trying to get that value so this is what and if any exception is there then I am doing this exception fail to connect and then we are returning 500 or else uh if everything is done then I am returning 200 message I welcome to elastic cassette demo from cloudtext something like that okay guys so let's deploy this one she's running this is also still running okay so meantime what we can do let's come to radius one ec2 also you can make it ready mean time so let's come here let's connect the ec2 instance here is the private key nothing wrong okay let's connect this data to update they don't ask hyper and y means I I hope you guys know this all a nice comment if you have any doubt let me know I will hear some session about this little chitchat about linuxos yum 12. let's install ladies equal to find the match right and check that for the package this is main requesting that is this is the package editor it is why it is saying radius is not fun okay just if you forget right then you can search here where it is install [Music] um [Music] so it is deployed okay let me see about computer Edition this is the command why it is let me try again okay due to some XYZ reason it is not installing guys so I will give those step in this video link okay how to I will figure out this one but let's see by python how we can connect okay so this is done correctness okay now redis is available so now come here and if you see here endpoint details it will keep the end point if you see this is the end point right so let's select this endpoint let's add to this Lambda so go to the configuration edit this and let's add the practice post that is the end point and then add the port here 6 3.79 and Port here and password okay okay now save this one now it is saved okay so now let's try here good section [Music] that is python some error is there under here and starting cluster connected demo traditionally okay some variable let me come here there it is Okay the third one okay let's change this one in the flight now updating so now paste again see we are returning this is the response body 200 and we have added this radius endpoint and then we start reduce connection connected and then there it is demo from cloud taxi this is what we we added right connected and then error is removed from cloudtech let me show you that this is the key we have added right here if you see and this is what we are reading from there right so if you see result we are able to read so this is how we can connect the radius from python so one more thing I can try here so let me see this cabinet and then try to connect that if it is possible let me see just want to show you that since ready is client clis we are not able to do right so copy this time to connect say it is connected right so whatever key we have given right let's see this is the key we have given right if you see now we can say it also yes set suppose a name equal to suppose name what I can get suppose give something okay now set is okay right now let's try to get a name name see we are getting suppose get what is yellow UD now take this is the key right see red is python whatever we are able to access from that Lambda let me show you that let's change that here we set that value right now let's go to the for Lambda function and then change this key to or maybe one more key will add here so let's add here first name okay now deploy actually I was planning to install the radius CLI and then from CLI I thought I will connect so since it was not working so in my mind now instance came one more idea like okay let's try by telling it also we can connect let's try we can connect or not but yeah it's good we are able to connect from ec2 by telnet also so this is how we can connect from the internet so if you see right uh okay let me show you the results see here whatever name I added that I set this caching to this file from that uh what I can say from the radius except in the client its server itself and then here by Lambda I am trying to access right I am able to face right so this is how we can do and if you want to see like what all keys there is just Easter if you enter so see in in my case two key is there so this is the key and name and Cloud okay guys and name is the four character this is the four character and Cloud tag is the nine character so that's what it is one how many character is there so this is how we can configure radius and we can connect the radius from that EC to instance to what I can say the ready server and then if you want you can see it get all this thing you can do and from Lambda also maybe in a real life scenario right if when you are real life we are working right so basically maybe from easy to instance by application you want to excel right maybe this kind of python code you have to write and then from the python you have to get done but if it is not a Lambda right maybe this portal you can create a some properties file and from that properties file you can get it or maybe in Python you can create some EMB dot uh in one environmental file and then from that environment file you can read those value dynamically in stop if you just hardcore to the code right then what happened like every time you have to face that those like if some today now that this is the uh endpoint maybe that endpoint gets changed right then you have to again reconfigure the code you need to deploy redeploy that code so that kind of you have to overcome that redeploy code stop changing code if you just change here like two models suppose uh that password got changed right what you can do if you just go to environment and end edit and then here just change the password or maybe the endpoint got modified right just come here and edit this you no need to redeploy that code so that's the benefit okay guys so I hope this session will helpful and with one more thing guys what I was trying here earlier like I tried to install the ready CLI here but uh I'm not sure why this latest AWS that CLI is not found maybe this 2023 that uh installation uh like maybe different uh version of radius RPM I need to install that I will put this video link uh that comment what already CLI if you want CLI then what you need to install I will give this to in this video description and uh another alternate approach to connect This Server Like by tlnet so this is the tail net so tail light also was not there in this 2023 so what I have done I have installed the tablet by using this command we can install similarly I was trying to install radius also but somehow this this package is not there and then uh once this connect install this one then telnet tail net basically command is telenet host name and then Port I will give this comment also in this video description okay guys so I hope this session will helpful to you guys and if you like and if you feel this video is valuable to you guys then I will suggest you please guys uh support me by using subscribe my channel and share with your friend that will really inspire me and that will really help to be okay guys see you in my next video okay guys bye