This is the accompanying repository for a presentation on Redis containing multiple demos on the features and concepts discussed.
- Run docker compose
docker compose up -d --build
Hint: If you do not want to build the container every time you can use the following to start the environment:
docker compose up -d --remove-orphans
- Connect to container
docker exec -it redis-demo fish
- Use redis-cli
redis-cli -h redis
- Use RedisInsight in browser
Visit http://localhost:5540 in your browser and add a new connection. Make sure to use redis
as the hostname instead of 127.0.0.1
and keep the port on 6379
.
- Use demo application inside container (possible demo names:
cache
,fibonacci_cache
,pubsub
,geo
,geo_radius
)
cargo run --bin [DEMO_NAME]
The demo fibonacci_cache
requires two arguments:
n
the nth number of fibonacci numbers to calculatecache
wether to use the cache or not
Example:
cargo run --bin fibonacci_cache 20 true
The demos geo
and geo_radius
require you to run the following to import the sample data provided by OpenStreetMap:
python3 /redis_demo/sample_data/etl.py
The demo geo
requires one argument:
city
the name of the city to search for
Example:
cargo run --bin geo mannheim
The demo geo_radius
requires three arguments:
latitude
the latitude of the center of the radiuslongitude
the longitude of the center of the radiusradius
the radius in kilometers
Example:
cargo run --bin geo_radius 49.47474553497348 8.534231778349126 3
OpenStreetMap® is open data, licensed under the Open Data Commons Open Database License (ODbL) by the OpenStreetMap Foundation (OSMF). Redis and the cube logo are registered trademarks of Redis Ltd.