0% found this document useful (0 votes)
15 views

Aimma Butt - 038 Assignment 2

Uploaded by

Saba Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Aimma Butt - 038 Assignment 2

Uploaded by

Saba Tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

FATIMA JINNAH WOMEN UNIVERSITY

Department of Software Engineering

INTERNET OF THINGS
Assignment 2

Submitted To: Dr. Bushra Bashir

Submitted By: Aimma Butt

Registration # 2020-BSE-038

Semester: VII - B
Question 1
What is “NoSQL” databases? Discuss their 4 types. Moreover, take a use case for each type of
database and provide the complete structure in form of supporting figures and functioning.
Discuss different parts of each type in detail.

NoSQL Databases
NoSQL databases means “Non-Relational” or “Non-SQL” databases which generally means that
the databases not only support SQL queries but also offer additional functionalities. It is the
category of databases that diverge the traditional relational database from the non-relation database
system. These NoSQL databases are used to handle large amount of unstructured, semi-structured
along with the structured datasets for the ease of development, functionality, and performance at
scale.
Following are the strong points of NoSQL Databases;
1. Flexibility: For faster and more iterative developments flexible schemas are provided.
This makes the datasets ideal for semi-structured and unstructured data.
2. Scalability: Rather of scaling up by adding expensive and powerful servers, NoSQL
databases are typically built to expand out using distributed hardware clusters.
3. Highly Functional: NoSQL databases offer exceptionally functional data types and APIs
that are specifically designed for each of their individual data models.
NoSQL and SQL databases selection depends on the specific requirements of the application,
including the nature of data, scalability, and performance with specific technology.

Example
A book record is stored as a JSON document. For each book, the item, Book Title, Edition,
Number, Author Name, Author ID are stored as attributes in a single document.

Types of NoSQL Databases


There are 4 types of NoSQL databases;

Key-Value Stores
Document Stores
Column Stores
Graph Stores

2|Page
1. Key-Value Stores
One of the simplest type of NoSQL databases are key-value stores. The data is stored in
the form of key-value pairs in which each key is unique and each key maps to the specific
value. This type of NoSQL databases is fast with efficient for basic operations such as read,
write, and delete for session management.

Advantages:
➢ Scalability
➢ High performance
➢ Developer productivity (easier to iterate while writing code)
➢ Simplicity
Disadvantages:
➢ Less optimization storage and query optimization
➢ Messy schemas
➢ Limited data connections and relationships

Examples:
Redis, Riak, SynamoDB

Use Case: Find book information


Database: Redis
Scenario: Storing book details for quick lookup
Implementation:
Set ISBN number as key and the entire book record as value. The book records are retrieved
quickly based on its unique identifier (ISBN).

Structure:
.makefile
{
Key: ISBN: 12345
Value: {
“Book Title”: “ABC”,
“Edition”: “DEF”,
“Number”: “12345”,
“Author Name”: “XYZ”,
“Author ID”: “111”
}
}

3|Page
2. Document Stores:
The data stored in document stores databases are in the form of documents using formats
JSON and BSON. Each document contains key-value pairs, and documents can be grouped
into collections.
The document-store databases allows multiple data structures in the same collection that is
helpful in real0time applications, and content management.

Advantages:
➢ Powerful querying
➢ Scheme evolution
➢ Flexible databases
Disadvantages:
➢ Storage issues
➢ Increased complexity

Examples:
MongoDB, CouchDB, Couchbase

Use Case: Manage Book Catalog


Database: MongoDB
Scenario: Storing and managing books with varying details and attributes.
Implementation:
In MongoDB, collection each book record is stored. Each of the document represents a
book with attributes such as title, edition, author name and author ID. This is flexible to
handle varying book attributes.

Structure:
.json
{
“Book Title”: “ABC”,
“Edition”: “DEF”,
“Number”: “12345”,
“Author Name”: “XYZ”,
“Author ID”: “111”
}

4|Page
3. Column Stores:
The databases of column store types are used to organize data into columns and column
families. It may vary between different rows within same family.
Column Stores databases are efficient for storing and retrieving large datasets. They help
us in fast data retrieval based on columns for data analytics and warehousing.

Advantages:
➢ Scalability
➢ Efficient for time-series data
➢ Flexible data model
Disadvantages:
➢ Complex data models
➢ Complex managing and optimization of columns
➢ Limited queries

Examples:
Apache Cassandra, HBase, ScyllaDB

Use Case: Time-Series Track Book Data


Database: Apache Cassandra
Scenario: Managing book data over time, such as editions, revisions and historical
changes.
Implementation:
Book record in stored in column family database, organizing columns such as title, edition,
author name and author ID. This type of database is efficient in handling time-series and
high performance for book details queries.

Structure:
.mathematica{
Column Family: BookCatalog
Row: ISBN: 12345
Columns:
- Title: “ABC”
- Edition: “DEF”
- Number: “12345”
- AuthorName: “XYZ”
- AuthorID: “111”
}

5|Page
4. Graph Stores:
The databases like graph stores focus on complex relationship and connections between
data. The data is represented as nodes, edges and properties.
Graph databases are optimal for applications having high interconnected data like fraud
detection and recommender systems. They are performant for traversing connections
between entities.

Advantages:
➢ Handling connections
➢ Graph algorithms
➢ Performance for connected data
Disadvantages:
➢ Limited use cases
➢ Storge issues

Examples:
Neo4j, Amazon Neptune, ArangoDB

Use Case: Book and Author Relationship Management


Database: Neo4j
Scenario: Managing books connections with authors.
Implementation:
The books and authors are represented as nodes to connect them in a graph database. The
nodes of the graphs are title, edition, author name and author ID. This will efficiently query
and visualize the author-book relationship.

Structure:
.css
{
Node: Book
{
Title: “ABC”,
Edition: “DEF”,
Number: “12345”
}

Node: Author
{
Name: “XYZ”

6|Page
AuthorID: “111”
}

Relationship: AUTHOR_OF
(Author) - [:AUTHOR_OF] -> (Book)
}

7|Page

You might also like