0% found this document useful (0 votes)
4 views6 pages

NOSQL Database

The document outlines the differences between RDBMS and NoSQL databases, highlighting that NoSQL databases like MongoDB and Apache Cassandra offer flexible schemas, high scalability, and are designed for handling large volumes of data. MongoDB is a document-oriented NoSQL database that supports various programming languages and offers features like replication and aggregation, while Cassandra is a distributed, fault-tolerant system known for its fast performance and flexible data storage. Both databases have their advantages and disadvantages, including MongoDB's limitations in data consistency and security, and Cassandra's single point of failure concerns.

Uploaded by

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

NOSQL Database

The document outlines the differences between RDBMS and NoSQL databases, highlighting that NoSQL databases like MongoDB and Apache Cassandra offer flexible schemas, high scalability, and are designed for handling large volumes of data. MongoDB is a document-oriented NoSQL database that supports various programming languages and offers features like replication and aggregation, while Cassandra is a distributed, fault-tolerant system known for its fast performance and flexible data storage. Both databases have their advantages and disadvantages, including MongoDB's limitations in data consistency and security, and Cassandra's single point of failure concerns.

Uploaded by

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

Difference between RDBMS and

NOSQL:
____________________________

NoSql Database
Relational Database

Supports very simple


Supports powerful query language.
query language.

It has a fixed schema. No fixed schema.

Follows ACID (Atomicity, Consistency, Isolation, and It is only eventually


Durability). consistency.

Does not support


Supports transactions. transactions.

It handles data in high


It handles data in less volume.
volume.

MongoDB

MongoDB is a document database. It stores data in a type of JSON format called


BSON.

MongoDB is an open source NoSQL database management program. NoSQL (Not


only SQL) is used as an alternative to traditional relational databases. NoSQL
databases are quite useful for working with large sets of distributed data.
MongoDB is a tool that can manage document-oriented information, store or
retrieve information.
MongoDB is used for high-volume data storage, helping organizations store large
amounts of data while still performing rapidly. Organizations also use MongoDB
for its ad-hoc queries, indexing, load balancing, aggregation, server-side
JavaScript execution and other features.
Structured Query Language (SQL) is a standardized programming language that is
used to manage relational databases. SQL normalizes data as schemas and tables,
and every table has a fixed structure.
Instead of using tables and rows as in relational databases, as a NoSQL database,
the MongoDB architecture is made up of collections and documents. Documents
are made up of key-value pairs -- MongoDB's basic unit of data. Collections, the
equivalent of SQL tables, contain document sets. MongoDB offers support for
many programming languages, such as C, C++, C#, Go, Java, Python, Ruby and
Swift.

Why is MongoDB used?


An organization might want to use MongoDB for the following:
Storage- MongoDB can store large structured and unstructured data volumes and
is scalable vertically and horizontally. Indexes are used to improve search
performance. Searches are also done by field, range and expression queries.
Data integration- This integrates data for applications, including for hybrid and
multi-cloud applications.
Complex data structures descriptions- Document databases enable the
embedding of documents to describe nested structures (a structure within a
structure) and can tolerate variations in data.
Load balancing - MongoDB can be used to run over multiple servers.
Features of MongoDB
Features of MongoDB include the following:
Replication. A replica set is two or more MongoDB instances used to provide high
availability. Replica sets are made of primary and secondary servers. The primary
MongoDB server performs all the read and write operations, while the secondary
replica keeps a copy of the data. If a primary replica fails, the secondary replica is
then used.
 Scalability. MongoDB supports vertical and horizontal scaling. Vertical
scaling works by adding more power to an existing machine, while
horizontal scaling works by adding more machines to a user's resources.
 Load balancing. MongoDB handles load balancing without the need for a
separate, dedicated load balancer, through either vertical or horizontal scaling.
 Schema-less. MongoDB is a schema-less database, which means the database
can manage data without the need for a blueprint.
 Document. Data in MongoDB is stored in documents with key-value pairs
instead of rows and columns, which makes the data more flexible when
compared to SQL databases.
Advantages of MongoDB
MongoDB offers several potential benefits:
 Schema-less. Like other NoSQL databases, MongoDB doesn't require
predefined schemas. It stores any type of data. This gives users the flexibility
to create any number of fields in a document, making it easier to scale
MongoDB databases compared to relational databases.
 Document-oriented. One of the advantages of using documents is that these
objects map to native data types in several programming languages., Having
embedded documents also reduces the need for database joins, which can lower
costs.
 Scalability. A core function of MongoDB is its horizontal scalability, which
makes it a useful database for companies running big data applications. In
addition, sharding lets the database distribute data across a cluster of machines.
MongoDB also supports the creation of zones of data based on a shard key.
 Third-party support. MongoDB supports several storage engines and
provides pluggable storage engine APIs that let third parties develop their own
storage engines for MongoDB.
 Aggregation. The DBMS also has built-in aggregation capabilities, which lets
users run MapReduce code directly on the database rather than running
MapReduce on Hadoop. MongoDB also includes its own file system called
GridFS, akin to the Hadoop Distributed File System. The use of the file system
is primarily for storing files larger than BSON's size limit of 16 MB per
document. These similarities let MongoDB be used instead of Hadoop, though
the database software does integrate with Hadoop, Spark and other data
processing frameworks.
Disadvantages of MongoDB
Though there are some valuable benefits to MongoDB, there are some downsides to it
as well.
 Continuity. With its automatic failover strategy, a user sets up just one master
node in a MongoDB cluster. If the master fails, another node will automatically
convert to the new master. This switch promises continuity, but it isn't
instantaneous -- it can take up to a minute. By comparison, the Cassandra
NoSQL database supports multiple master nodes. If one master goes down,
another is standing by, creating a highly available database infrastructure.
 Write limits. MongoDB's single master node also limits how fast data can be
written to the database. Data writes must be recorded on the master, and writing
new information to the database is limited by the capacity of that master node.
 Data consistency. MongoDB doesn't provide full referential integrity through
the use of foreign-key constraints, which could affect data consistency.
 Security. In addition, user authentication isn't enabled by default in MongoDB
databases. However, malicious hackers have targeted large numbers of
unsecured MongoDB systems in attacks, which led to the addition of a default
setting that blocks networked connections to databases if they haven't been
configured by a database administrator.

Apache Cassandra

Apache Cassandra is an open source, distributed and decentralized/distributed


storage system (database), for managing very large amounts of structured data
spread out across the world. It provides highly available service with no single
point of failure.
Listed below are some of the notable points of Apache Cassandra −
 It is scalable, fault-tolerant, and consistent.
 It is a column-oriented database.
 Its distribution design is based on Amazon Dynamo and its data model on
Google Bigtable.
 Created at Facebook, it differs sharply from relational database management
systems.
 Cassandra implements a Dynamo-style replication model with no single
point of failure, but adds a more powerful column family data model.
 Cassandra is being used by some of the biggest companies such as
Facebook, Twitter, Cisco, Rackspace, ebay, Twitter, Netflix, and more.
Features of Cassandra

Cassandra has become so popular because of its outstanding technical features.


Given below are some of the features of Cassandra:
 Elastic scalability − Cassandra is highly scalable; it allows to add more
hardware to accommodate more customers and more data as per
requirement.
 Always on architecture − Cassandra has no single point of failure and it is
continuously available for business-critical applications that cannot afford a
failure.
 Fast linear-scale performance − Cassandra is linearly scalable, i.e., it
increases your throughput as you increase the number of nodes in the cluster.
Therefore it maintains a quick response time.
 Flexible data storage − Cassandra accommodates all possible data formats
including: structured, semi-structured, and unstructured. It can dynamically
accommodate changes to your data structures according to your need.
 Easy data distribution − Cassandra provides the flexibility to distribute
data where you need by replicating data across multiple data centers.
 Transaction support − Cassandra supports properties like Atomicity,
Consistency, Isolation, and Durability (ACID).
 Fast writes − Cassandra was designed to run on cheap commodity
hardware. It performs blazingly fast writes and can store hundreds of
terabytes of data, without sacrificing the read efficiency.

History of Cassandra

 Cassandra was developed at Facebook for inbox search.


 It was open-sourced by Facebook in July 2008.
 Cassandra was accepted into Apache Incubator in March 2009.
 It was made an Apache top-level project since February 2010.

Components of Cassandra
The key components of Cassandra are as follows −
 Node − It is the place where data is stored.
 Data center − It is a collection of related nodes.
 Cluster − A cluster is a component that contains one or more data centers.
 Commit log − The commit log is a crash-recovery mechanism in Cassandra.
Every write operation is written to the commit log.
 Mem-table − A mem-table is a memory-resident data structure. After
commit log, the data will be written to the mem-table. Sometimes, for a
single-column family, there will be multiple mem-tables.
 SSTable − It is a disk file to which the data is flushed from the mem-table
when its contents reach a threshold value.
 Bloom filter − These are nothing but quick, nondeterministic, algorithms for
testing whether an element is a member of a set. It is a special kind of cache.
Bloom filters are accessed after every query.

You might also like