Un-structed Data
Document Databases
Software System Development – Monsoon 2022
NoSQL (often interpreted as Not only SQL) database. It provides a mechanism for storage and retrieval of
data that is modeled in means other than the tabular relations used in relational databases.
SQL NoSQL
Relational Database Management Non-relational or distributed database
System (RDBMS) system.
These databases have fixed or static or
They have dynamic schema
predefined schema
These databases are best suited for These databases are not so good for
complex queries complex queries
Vertically Scalable Horizontally scalable
Follows ACID property Follows BASE property
Atomicity, Consistency, Isolation, Durability Basically Available, Soft State, Eventually Consistent
MongoDB is an open source, document-oriented database designed with both
scalability and developer agility in mind. Instead of storing your data in tables and rows
as you would with a relational database, in MongoDB you store JSON-like documents
with dynamic schemas(schema-free, schema less).
Relational Database Document Database
Database Database
Table Collection
Row Document (JSON,
BSON)
Column Field
Index Index
Join Embedded Document
Partition Shard
MongoDB does not need any pre-defined data schema.
Every document could have different data!
Document-Oriented storege
{name: “will”,
Full Index Support
name: “jeff”, {name: “brendan”,
eyes: “blue”, eyes: “blue”, boss: “will”} Replication & High Availability
birthplace: “NY”, loc: [40.7, 73.4],
aliases: [“bill”, “ben”], boss: “ben”}
Auto-Sharding
loc: [32.7, 63.4], {name: “matt”, Aggregation
boss: ”ben”} weight:60,
height: 72, MongoDB Atlas
name: “ben”,
age:25}
loc: [44.6, 71.3]} Various APIs - JavaScript,
Python, Ruby, Perl, Java, Java,
Scala, C#, C++, Haskell, Erlang
Community
Replication
Sharding (Replica-Sets)
It provides redundancy and increases data availability.
With multiple copies of data on different database It is a method for distributing data across multiple machines.
servers, replication provides a level of fault tolerance MongoDB uses sharding to support deployments with very large
against the loss of a single database server. data sets and high throughput operations.