Table Accounts (first_name` VARCHAR(64) NULL , `last_name` VARCHAR(45)

Table 2 Comparison of MongoDB and Oracle 14

Key Feature

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Oracle

MongoDB

Data Model

Data
Stores in form of tables.  Follow fixed
schema structure.

Follow
Document based model for representing the data. It is schema less and can
handle unstructured data efficiently

Scalability

Providing
both vertical as  well as horizontal scalability

Provide
an effective horizontal scalability

Transaction reliability

follow
ACID rule hence are more reliable

follow
BASE rule

Complexity

More
Complex

Less Complex

Security

Very secure
mechanism

Less Secure

Crash Recovery

Ensure
crash recovery through its ACID properties

depends
on replication as back up to recover from crash.

Cloud

Not
suitable for cloud applications

Suitable for cloud applications

Big Data Handling

Unable
to handle big data problem

Designed
to deal with the Big Data problem effectively.

 

IV . Crud Operations

 

This
section focuses on the basic operations of CRUD. Two databases, one using
Oracle and one in MongoDB are created to compare the way that data will be
created, selected, inserted and deleted in both databases 21.  MongoDB is a fast responding database
management system. If you want a simple database that will respond very fast, MongoDB
is best choice.  MongoDB support all
major CRUD operations, and provides Aggregation features.  Following are the major CRUD operations – 

 

Table 3 CRUD Operations

Operations

Oracle

MongoDB

Create Table

CREATE TABLE Accounts (first_name`
VARCHAR(64) NULL , `last_name` VARCHAR(45) NULL , PRIMARY KEY (`id`) );

db.accounts.insert({
name:”abc”, age:26, address:”indore”})

Delete
a Table

Drop table accounts;

db.accounts.drop()

Insert

Insert into accounts( name, age,
address ) VALUES ( “abc”, 26, “indore”)

db.accounts.insert({
name:”abc”, age:26, address:”indore”})

Select

Select * from accounts

db.accounts.find()

Select fields

Select first_name, last_name  from accounts

db.accounts.find({ }, {
first_name: 1, last_name: 1 })

Conditional Select

Select * from Accounts where dep_wid=”D”
and balance>5000

db.accounts.find({dep_wid:”d”,
balance:{$gt:5000}})

Ordered Select ascending

Select * from accounts order
by user_id asc

db.accounts.find({}).sort({user_id
: 1})

Ordered Select descending

Select * from accounts order
by user_id desc

db.accounts.find({}).sort({user_id:
-1 })

Select with count

Select count(*) from users

db.articles.count()

Update

update table student set
section=”F”  where marks