Sunteți pe pagina 1din 12

MongoDb

NoSQL
MongoDB
• MongoDB is an open-source document database that provides
high performance, high availability, and automatic scaling.
• A record in MongoDB is a document, which is a data structure
composed of field and value pairs.
• The values of fields may include other documents, arrays, and
arrays of documents.
Advanatages
• Documents (i.e. objects) correspond to native data
types in many programming languages.
• Embedded documents and arrays reduce need for
expensive joins.
• Dynamic schema supports fluent polymorphism.
Key Features
• MongoDB provides high performance. Input/Output
operations are lesser than relational databases due to support of
embedded documents(data models) and Select queries are also
faster as Indexes in MongoDB supports faster queries.
• MongoDB has a rich Query Language, supporting all the
major CRUD operations. The Query Language also provides
good Text Search and Aggregation features.
• Auto Replication feature of MongoDB leads to High
Availability. It provides an automatic failover mechanism, as
data is restored through backup(replica) copy if server fails.
• Sharding(process of storing data records across
multiple machines) is a major feature of MongoDB.
• As the size of the data increases, a single machine
may not be sufficient to store the data nor provide an
acceptable read and write throughput. Sharding
solves the problem with horizontal scaling.
• MongoDB supports multiple Storage Engines. When
we save data in form of document or tables, Storage
Engines manages how data is saved in memory and
on disk.
Organizations that use MongoDB

• Below are some of the big and notable organizations


which are using MongoDB as database for most of
their business applications.
• Adobe
• LinkedIn
• McAfee
• FourSquare
• eBay
• MetLife
• SAP
NoSQL
• NoSQL(Not only SQL) is a non-relational database
management systems, different from traditional relational
database management systems in some significant ways.
• It is designed for distributed data stores where very large scale
of data storing needs (for example Google or Facebook which
collects terabits of data every day for their users).
• These type of data storing may not require fixed schema, avoid
join operations and typically scale horizontally.
Contd...
• NOSQL systems focus on storage of “big data”
• Typical applications that use NOSQL
– Social media
– Web links
– User profiles
– Marketing and sales
– Posts and tweets
– Road maps and spatial data
– Email
Contd..
• NOSQL characteristics related to distributed
databases and distributed systems
1. Scalability
2. Availability, replication, and eventual consistency
• Eventual consistency is a consistency model used in
distributed computing to achieve high availability that
informally guarantees that, if no new updates are made
to a given data item, eventually all accesses to that item
will return the last updated value.
Contd..
3. Replication models
• Master-slave replication
– requires one copy to be the master copy; all write
operations must be applied to the master copy and then
propagated to the slave copies.
– For read, one method is to require all reads also to be at
the master copy, so this would be similar to the primary
site or primary copy methods of distributed concurrency
control with similar advantages and disadvantages.
– Another method for read would allow reads at the slave
copies but would not guarantee that the values are the
latest writes, since writes to the slave nodes can be done
after they are applied to the master copy.
Contd...
– Master-master replication:
• allows reads and writes at any of the replicas but may not
guarantee that reads at nodes that store different copies see
the same values.
• Different users may write the same data item concurrently at
different nodes of the system, so the values of the item will
be temporarily inconsistent.
• A reconciliation method to resolve conflicting write
operations of the same data item at different nodes must be
implemented as part of the master-master replication scheme.
4. Sharding (horizontal partiioning)) of the file records is often
employed in NOSQL systems. This serves to distribute the load
of accessing the file records to multiple nodes.
5. High performance data access
Contd...
• NOSQL characteristics related to data models and query languages
1. Schema not required: The flexibility of not requiring a schema is
achieved in many NOSQL systems by allowing semi-structured,
selfdescribing data.
2. Less powerful query languages:
• Many applications that use NOSQL systems may not require a
powerful query language such as SQL, because search (read)
queries in these systems often locate single objects in a single file
based on their object keys.
• NOSQL systems typically provide a set of functions and operations
as a programming API , so reading and writing the data objects is
accomplished by calling the appropriate operations by the
programmer.
• the operations are called CRUD operations, for Create, Read,
Update, and Delete.
• In other cases, they are known as SCRUD because of an added
Search (or Find) operation

S-ar putea să vă placă și