[Intro Music]
Alright guys, now let's proceed,
and let's have a look at another
image called 'redis'. Before we have
talked about such database
images as mysql and mongo; and
such databases are usually used
for persistent data storage; and
storage of large amounts of data.
'redis', in opposite way is
usually used for real time data
processing; and for example, it is
very often used for processing of
events in the queues. And
such database is very fast and
very efficient; and it is again,
very often used for many backend
applications. And now let's quickly
have a look at the redis image; and
let's quickly create a redis
container. Let's use immediately
command 'docker run'; and here let's
type 'redis', like this. Unable to
find image 'redis:latest' locally as
usually. Pulling several fs layers.
Procedure is the same as you have
seen before for previous images.
Let's wait a bit. Alright, the
image was downloaded. And now you
see some logs related to start of
the Redis server. Redis is
starting. And finally you see
message, 'Ready to accept
connections'; and that means that
now our Redis server is listening at
Port 6379. But of course in this
command we have not to used any
port mapping, we simply run redis
container like that. But we're able
to use built-in Redis CLI
utility, and connect from that
Redis CLI to Redis server. And for
that, of course we're able to use
same container as is running right
now, or you're able to create a
separate container if you want to.
But let me reuse this container;
and I'll simply open up a new tab
here; and I'll use 'docker exec'
command in order to start
additional process inside of that
running container. First of all,
let me have a look at the currently
running containers; and let me have
a look at this CONTAINER ID; and
now let's use 'docker exec -it
bf'; and next let's type 'redis-cli',
like so; and we have connected
to redis-cli process. And you see
basically that we have connected
from redis-cli process to
Redis server; and because redis-cli
is running inside of the same
container as is used for start of
Redis server here you see that redis-cli
was automatically connected to
localhost IP address; and default
redis port 6379. Here you're able
to perform some Redis operations,
for example, you can enter command
'PING', and you will get answer 'PONG'.
Also you're able to check
information about Redis server using
'INFO' command like this; and you'll
see a large output divided into
different sections related to CPU,
memory information. And if you'll
scroll to the very beginning of
this output, you should see version
number of the Redis server, here
it is, redis_version is 6.0.1 in
my case, Also, you see the
underlying operating system that
was used for running of this
Redis server. And also, you may
notice 'tcp_port' that is open for
connections to this Redis server.
All right. Let's now quickly insert
some records into Redis server; and
for that you could use the command
SET, and next comes key, and after
key comes value. Redis is
again very simple database, and it
simply stores key-value pairs,
nothing else. Great. Let's type
here key; and let's give it name
'key1' for example; and the value
will be "Hey there", like so. And now
we're able to use GET command in
order to get value for specific key.
'GET key1', like so. And I get
response, "Hey there". You are able in
similar way insert additional keys
if you want to. But for the sake of
this lecture it is completely enough.
Great. Let's now proceed, and next
you'll get a small challenge, and
you will need to create two
containers - redis container, and one
more container that will be used
for graphical user interface
management of Redis server; and
inside of that container you will
be able to perform such inserts in
UI using HTTP protocol, Challenge task
comes next. Bye-Bye.
[no audio]