0% found this document useful (0 votes)
9 views14 pages

No SQL

The document discusses various NoSQL database types, including key-value stores, document databases, column-family databases, and graph databases, emphasizing their flexibility and schema-less nature. It also covers distribution models like replication and sharding, explaining master-slave and peer-to-peer replication methods, as well as the CAP theorem which outlines the trade-offs between consistency, availability, and partition tolerance. Additionally, it highlights the importance of these concepts in managing large data volumes and ensuring system resilience.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

No SQL

The document discusses various NoSQL database types, including key-value stores, document databases, column-family databases, and graph databases, emphasizing their flexibility and schema-less nature. It also covers distribution models like replication and sharding, explaining master-slave and peer-to-peer replication methods, as well as the CAP theorem which outlines the trade-offs between consistency, availability, and partition tolerance. Additionally, it highlights the importance of these concepts in managing large data volumes and ensuring system resilience.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

NO SQL

Dr. Kavitha H,
ASSOC. PROFESSOR
DEPT OF ISE SIT
SCHEMALESS DATABASES
• A key-value store allows you to store any data you like under a key
• You can easily add new things as you discover them
• A document database effectively does the same thing, since it makes
no restrictions on the structure of the documents you store
• Column-family databases allow you to store any data under any
column you like
• Graph databases allow you to freely add new edges and freely add
properties to nodes and edges as you wish
MATERIALIZED VIEW
• A view is like A relational table but defined by computation over the
base tables.
• When a views is accessed the databases execute the computation
required.
• Materialized views are created using MapReduce computation.
DISTRIBUTION MODELS
The distribution model the data store can give us the ability:

• To handle large quantity of data,


• To process a greater read or write traffic
• To have more availability in the case of network slowdowns of breakages.
There are two path for distribution

Replication
 Sharding
REPLICATION
• Replication copies data across multiple servers, so each
bit of data can be found in multiple places.
• Replication comes in two forms,
o Master-slave replication
o Peer-to-peer replication
• Master-slave replication makes one node the
authoritative copy that handles writes while slaves
synchronize with the master and may handle reads.
• Peer-to-peer replication allows writes to any node; the
nodes coordinate to synchronize their copies of the data.
MASTER-SLAVE REPLICATION
• In this setting one node is designated as the master and the other as
slaves.
• The master is the authoritative source for the data and designed to
process updates and send them to slaves.
• The slaves are used for read operations.
PEER-TO-PEER REPLICATION
• Master-Slave replication helps with read scalability but has problems
on scalability of writes.
• It provides resilience on read but not on writes.
• The master is still a single point of failure.
• Peer-to-Peer attacks these problems by not having a master.
• All the replica are equal (accept writes and reads)
• With a Peer-to-Peer we can have node failures without lose write
capability and losing data.
SHARDING

• Sharding is a method of storing data records across


many server instances.
or
• Database sharding refers to replicating a database
across other databases in chunks of data called shards.
• Sharding is especially valuable for performance because it improves
read and write performances.
• It scales read and writes on the different nodes of the same cluster
CAP THEOREM

The Database shards the data and also replicates it


based on the replication factor called CAP theorem.
CAP theorem is also called brewer’s theorem. It states that is
impossible for a distributed data store to offer more than two out of
three guarantees
1.Consistency
2.Availability
3.Partition Tolerance
Consistency:

The data should remain consistent even after the execution of an


operation. This means once data is written, any future read request
should contain that data. For example, after updating the order
status, all the clients should be able to see the same data.
Availability:

• The database should always be available and responsive. It should


not have any downtime.
Partition Tolerance:

Partition Tolerance means that the system should continue to


function even if the communication among the servers is not stable.
For example, the servers can be partitioned into multiple groups
which may not communicate with each other. Here, if part of the
database is unavailable, other parts are always unaffected.
Let us take a look at various scenarios

• The first one is RDBMs where Reading and writing of


data happens on the same machine. Such systems are
consistent but not partition tolerant because if this
machine goes down, there is no backup. Also, if one
user is modifying the record, others would have to wait
thus compromising the high availability
Contd..
• The second is a system which has two machines. Only
one machine can accept modifications while the reads
can be done from all machines.
• In such systems, the modifications flow from that one
machine to the rest.
• In the third design Every new change or modification at
A in the diagram is propagated to the backup machine
B. There is only one machine which is interacting with
the readers and writers. So, It is consistent but not
highly available.

You might also like