Assignment2
Assignment2
Submitted By:
Abdullah khan 2023-CS-718
Submitted To:
Ma’am Rida
Course:
Advanced DBMS
1|Page
Table of Contents
[1]Redis: .......................................................................................................................................... 3
[2]Level DB: ................................................................................................................................... 3
[3]Comparison table of Redis and Level DB: ............................................................................. 3
Comparison with Relational Databases (SQL) ............................................................................... 5
Insert Operation: ......................................................................................................................... 5
Read Operations: ...................................................................................................................... 5
Update Operations: .................................................................................................................. 6
Delete Operations: .................................................................................................................... 6
Complex Queries:...................................................................................................................... 7
[4]Comparison Table between Redis, Level DB, MYSQL: ........................................................... 7
References: ...................................................................................................................................... 8
2|Page
NoSQL (REDIS, LEVEL DB) VS Tradition Relational Databases
We are going to discuss NoSQL key-value stores, specifically Redis and Level DB, and
compare their performance with relational databases. Key-value stores are a type of NoSQL
database that store data as simple pairs of keys and values. They are known for their simplicity,
speed, and scalability, making them ideal for specific use cases like caching, session storage, and
real-time application.
[1]Redis:
Redis, short for Remote Dictionary Server, is an in-memory key-value store. It’s like a
super-fast, temporary storage system that keeps data in memory for quick access. Redis is often
used for caching, real-time analytics, and session storage in web applications. It supports
advanced data structures like strings, lists, sets, and hashes, which makes it versatile for different
use cases. While Redis can persist data to disk, its primary strength lies in its ability to handle
high-speed operations in memory. However, because it’s single-threaded, it may not fully utilize
multi-core systems.
[2]Level DB:
Level DB, developed by Google, is an on-disk key-value store. Unlike Redis, Level DB
stores data directly on disk, making it a good choice for applications that need persistent storage.
It’s lightweight, fast, and optimized for write-heavy workloads. Level DB organizes data in a
sorted manner, which makes it efficient for range queries. However, it doesn’t support advanced
data structures like Redis—it only handles simple key-value pairs. Level DB is often used in
embedded systems and applications where disk-based storage is required
3|Page
Aspect Redis Level DB
Performance Extremely fast for read/write Fast for on-disk operations but
operations due to in-memory storage. slower than Redis.
Scalability Scales horizontally using Redis Scales vertically but not designed
Cluster. for distributed systems.
Complexity Easier to set up and use for simple use Requires more effort to integrate
cases. and manage.
4|Page
Comparison with Relational Databases (SQL)
Insert Operation:
Radis:
MySQL inserts 10,000 rows in 5 seconds (slower due to disk I/O and ACID compliance).
Read Operations:
Radis:
MySQL retrieves 10,000 rows in 3 seconds (slower due to disk I/O and query parsing).
5|Page
Update Operations:
Radis:
Delete Operations:
Radis:
6|Page
Complex Queries:
MySQL:
Redis:
Redis does not support complex queries like joins. You would need to implement this logic in
the application layer.
Level DB:
Level DB does not support complex queries. Range queries are possible but limited to key-based
iterations.
7|Page
Use Cases Caching, real-time Embedded systems, Complex queries,
apps persistent storage transactions
References:
[1] Redis, “Redis Documentation.” Accessed: Feb. 03, 2025. [Online]. Available:
https://redis.io/docs/latest/
[2] L. DB, “Level DB Documentation.” Accessed: Feb. 03, 2025. [Online]. Available:
https://github.com/google/leveldb
[3] DB-Engines, “Comparison of LEVEL DB and REDIS,” Red Gate Software Ltd. [Online].
Available: https://db-engines.com/en/system/LevelDB%3BRedis
[4] GeeksforGeeks, Sanchhaya Education Private Limited, “Difference between Redis and
MySQL.” [Online]. Available: https://www.geeksforgeeks.org/difference-between-redis-
and-mysql/
8|Page
9|Page