EXPERIMENT GUIDE FOR KEY VALUE DATABASE
Leader: Hadiah(康隽秀)
Experiment Topic: Benchmarking Key-Value Operations
Objective: Test the performance of a KV database (e.g., Redis, Cassandra, or DynamoDB) by
benchmarking basic operations like adding, updating, retrieving, and deleting data.
Procedure:
Summary:
● Set up a key-value store using Redis.
● Load the database with a large dataset (e.g., 1 million key-value pairs).
● Perform CRUD operations and measure their time.
● Vary the size of the dataset to see how performance scales.
Detailed steps of the procedure for the experiment:
1. install redis server.
Tutorial link:
[Link]
2. create a project and install needed packages in venv (i recommend PyCharm - it is quite easy
to use)
3. - new python project
- create venv -> realization depends on your system
- (venv) pip install redis
- (venv) pip install matplotlib #if you want to make graphs too.
3. Copy paste the code below (to test DB - [Link], to see the graphs - [Link]) and run it:
import redis
r = [Link](
host='localhost',
port=6379
)
[Link](1, 'meow') #create
[Link](1, 'woof') #create
[Link](2, 'test2') #create
value = [Link](1)
print(value) #read
[Link](2) #delete
value2 = [Link](2) #not storing anymore
print(value2)
4. wait a bit and enjoy the result!
Analysis: Compare performance across different data sizes and discuss how efficient KV
databases are for simple operations.