https://github.com/dedpixta/project-redis
Comparison of the efficiency of implementing a caching system Redis
https://github.com/dedpixta/project-redis
cashing mysql redis
Last synced: 3 months ago
JSON representation
Comparison of the efficiency of implementing a caching system Redis
- Host: GitHub
- URL: https://github.com/dedpixta/project-redis
- Owner: DedPixta
- Created: 2023-01-04T07:12:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-28T16:32:37.000Z (about 2 years ago)
- Last Synced: 2025-01-13T02:13:19.607Z (5 months ago)
- Topics: cashing, mysql, redis
- Language: Java
- Homepage:
- Size: 116 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project-redis
Familiarity with caching technology and in-memory database Redis
## GOAL
Compare the speed of getting the same data from MySQL and Redis.## Prerequisites
1. Create docker container with MySQL database
```
docker run --name mysql -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --restart unless-stopped -v mysql:/var/lib/mysql mysql:8
```
* user: **root**
* password: **root**
2. Expand dump file to MySQL database from resources folder3. Create docker container with Redis database
```
docker run -d --name redis -p 6379:6379 redis:latest
```
**optionally** if you have installed redis-insight _(redis client to connect to database)_ you can create instead of the previous container:
```
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
```
## To run the project
1. Clone the project;
2. Run the project from Runner.class in your IDE from the main method;You can manipulate with number of Queries in Runner.class
```java
public static final int NUMBER_OF_QUERIES = 400;
```
to see the difference in speed of getting data from MySQL and Redis.
## Technologies used
- MySQL
- Hibernate
- Redis
- Lettuce
- P6Spy
- Lombok
- Logger (Logback, Slf4)
- Docker