checkout
docker run --name my-redis -d -p 6379:6379 redis
docker exec -it contianer_id /bin/bash
redis-cli
SET user "tushar"
GET user
DEL user
Tip
HSET/HGET/HDEL - store multiple values for single key - if you want to store different data for user with different id.
Redis as a queue
LPUSH problem 1
LPUSH problem 2
RPOP problem
RPOP problem
// blocking pop - will be blocked for t seconds till a value is pushed (t = 0 for infinite)
BRPOP problem t
docker run -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres
postgresql://postgres:mysecretpossword@localhost:5432/postgres
→ url to access postgres
docker run -d --name kafka-zk \
-e ALLOW_PLAINTEXT_LISTENER=yes \
-e KAFKA_CFG_ZOOKEEPER_CONNECT=localhost:2181 \
-p 9092:9092 -p 2181:2181 \
bitnami/kafka:latest
docker stop kafka-zk && docker rm kafka-zk