You are on page 1of 13

DBMS

ASSIGNMENT
MAIN CHARACTERISTICS OF
KEY-VALUE DATABASE
NoSQL refers to a non SQL or nonrelational
database that main purpose of it is to
provide a mechanism for storage and
retrieval of data. NoSQL database stores the
information in JSON documents instead of
columns and rows. As we know the relational
database use rows and columns for storing
and retrieval of data but in the case of
NoSQL it uses JSON documents instead of
rows and columns and that is why it is also
known as nonrelational SQL or database.
A NoSQL database includes simplicity of
design, simpler horizontal scaling, and has
fine control over availability. The data
structures used in the NoSQL database are
different from those we used in the
relational database. The database used in
NoSQL is more advanced which makes some
operations faster in NoSQL
REDIS
Redis is one of the popular key-value databases as it is an open-source, in-memory
data structure, used as a database and message broker. REDIS supports many data
structures such as lists, hashes, sets, strings. REDIS has many more important
features such as it has built-in replication, LUA scripting and it also supports LRU
eviction.
Redis is a NoSQL database which follows the principle of key-value store. The key-
value store provides ability to store some data called a value, inside a key. You can
recieve this data later only if you know the exact key used to store it.Redis is a
NoSQL database which follows the principle of key-value store. The key-value store
provides ability to store some data called a value, inside a key. You can recieve this
data later only if you know the exact key used to store it.
CHARACTERISTICS OF KEY-VALUE DB
1. Simple Data Model
2. Scalability and Performance
3. High Throughput
4. No Schema Constraints
5. In-Memory Storage
6. Persistence and Durability
7. Persistence and Durability
1.Simple Data Model
Key-value databases have a simple and straightforward data
model, where data is stored and accessed based on unique keys.
Each key is associated with a value, and these pairs form the
basic structure of the database.
Example in Redis:
SET key1 value1
2.Scalability and Performance

Key-value databases are designed to handle high volumes of


read and write operations, making them highly scalable and
performant. They can distribute data across multiple nodes to
handle increased traffic and provide fast access times.
Example in Redis:
INCR counter_key
3.High Throughput
Key-value databases are optimized for high throughput,
allowing for rapid storage and retrieval of data. They excel in
use cases that require quick access to specific data items, such
as caching or session management.
Example in Redis:
GET key1
4.No Schema Constraints
Key-value databases do not enforce a predefined schema,
providing flexibility in data storage. Different keys can have
values of various types, and the structure of the values can vary
between different key-value pairs.
Example in Redis:
HSET user:1 name John
HSET user:1 age 30
5.In-Memory Storage

Many key-value databases, including Redis, store data primarily


in memory for fast access. This approach allows for extremely
low latency and high-speed operations. However, it also means
that the total amount of data is limited by the available memory.
Example in Redis:
SET key1 value1
6.Persistence and Durability

Key-value databases can provide persistence by periodically


saving the in-memory data to disk. This feature ensures that
data is not lost in case of system failures or restarts.
Example in Redis:
SAVE
7.Advanced Data Structures
Key-value databases like Redis offer advanced data structures,
such as lists, sets, sorted sets, and hashes. These structures
enable more complex data modeling and operations beyond
simple key-value pairs.
Example in Redis:
LPUSH list_key value1
SADD set_key value1
ZADD sorted_set_key 1 value1
HSET hash_key field1 value1
THANK YOU

REFERENCE LINK
https://redis.io/documentation
https://www.w3resource.com/redis/
https://www.geeksforgeeks.org/features-of-key-value-store-in-nosql/

You might also like