Redis Tutorial for Beginners #1 - What is Redis?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey gang and welcome to your very first redis [Music] tutorial okay so first up what exactly is redis well in simple terms it's an inmemory data store and it uses simple key value data structures to store your data in now over the years it's been commonly used as a caching layer that sits in front of your traditional databases like postgres or Dynamo whatever other database you might use and the reason it was use this way is because redis is extremely fast since all data inside reddis is stored in memory RAM rather than on disk so if you had an API that interacted with a traditional database to query data that process is going to take some time to finish and the end user ends up waiting around for it and that would be the story for every following request as well but with re in place as a caching server data can sometimes be stored and retrieved from that instead de speeding up your API response time the downside to storing data in memory is that it's volatile and it would be lost if the server crashes which is why it was generally just used as a caching server on top of your regular database because if the server crashed then all the data would still be safe inside your database which is more durable but like with most things redis has evolved over the years and it can now also be used as your primary database in instead of just a caching layer and that's thanks to some features like data persistence and replication to make sure your data is durable and available additional modules for Json support and search which makes it much much easier to store in query more complex data and tools like redis om which is an object mapping library that makes it really simple to interact with reddis from your application code on top of that we can now use something called reddis Cloud as well to set up and manage the Rish database which makes it incredibly simple to get started now when we talk about these additional modules and tools being added to redis we can sometimes refer to them as the redis stack and reddis on its own without those extra modules is known as redis core which is basically the core features of redis now in this series we'll be focusing on redis core and learning everything from the ground up but I will also be releasing a follow on course two in the future which dives into the reddish sty as well so before we get started with setting up a reddish database and using it I want to quickly talk about the way we store dates in reddish using different data structures now in its most basic sense we store data in key value pairs where the key is like the identifier for that bit of data and the value is the data itself and the data can take the form of various different data types it could be a string which is also used to store numbers as well it could be a set which is an unordered collection of strings which must be unique we have have hashes which are a little bit like objects in that they're a collection of key value pairs lists which are a collection of string values which don't need to be unique but there is a caveat which we'll see later sorted sets which are a bit like sets but where the values inside them are ordered According to some Associated score and there are some other data types as well like streams and geospatial indexes they're are little bit beyond the scope of this course but there are other types as well now I said that reddish stores data in key pairs right and the keys themselves can be called whatever you want them to be called for example if you wanted to store some titles of books in a set then your key might just be books and that key would point to that set you might also want to store several individual books as hashes where each hash has a title property and an author property so we need a separate key for each one of those books now common convention when we're doing something like this is to name the key the resource name first for example books and then a colon and then an ID for that book so for example books one would point to one book hash and books two would point to a different book hash and so forth so we will be looking at Key naming and all the different data types in much more detail throughout the series and we'll also look at how we can use some of them in a nextjs application now there's no real prerequisites to St in the series however like I just said we will be having to go it using redish briefly with a next application so if you want to learn the latest version of nextjs first I've got a big next 13 masterclass course which you can take the link to that is going to be down below the video I've also got a smaller next 13 crash course which I'll leave the link to as well now One Last Thing Before we start I just want to highlight this repo right here ready for beginners the link to this is going to be down below because I've put all the course files up on this repo including a St project for later on in the course which is the nextjs uh project we're going to start with but we do have lesson code for some of the lessons here as well not the first half of the course because we're not going to be creating some kind of application then but for the second half of the course so from lesson 8 onwards we're going to be using reddis in our own application so I do have course files for all of those lessons so to download one of those lessons you can select the lesson Branch for example lesson 9 and then you can go to the code button and then you can open with get desktop or download the zip entirely up to you unzip it and then just open that up in vs code or whatever text editor you're using install the dependencies and away we go basically so anyway that's your introduction to redis out of the way so in the next lesson we're going to be setting up our first redis [Music] database
Info
Channel: Net Ninja
Views: 26,967
Rating: undefined out of 5
Keywords: redis, redis tutorial, redis for beginners, redis crash course, tutorial, crash course, redis client, redis node, redis next, js, redis stack, redis json, redisearch, redis stack tutorial, redis search, redis cloud
Id: 8sHCdz_tOjk
Channel Id: undefined
Length: 5min 56sec (356 seconds)
Published: Thu Sep 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.