Simple introduction to mongodb and its basic architecture.
Size: 1.22 MB
Language: en
Added: Jul 24, 2018
Slides: 36 pages
Slide Content
mongo DB
Written in: C++ Data model: uses BSON (binary JSON), lightweight, traversable, efficient Based on ‘document model’ Use NoSQL (not only SQL), SQL is used for RDBMS Retains some friendly properties of SQL License: AGPL ( Drivers:Apache )
Why?
Why?
Why?
Why?
Why?
Why?
Why?
Drawbacks of such complexity Hard to understand Hard to add features Inefficient
Imagine this was done in real world
Imagine this was done in real world
Imagine this was done in real world
Imagine this was done in real world
mongoDB takes entirely different approach Here, Data is stored in records (called as documents) Separate documents for each patient (example)
Illustration using Previous example
Illustration using Previous example
Illustration using Previous example
Illustration using Previous example
Hence, Efficient for computer to process Natural and easy for humans to read They can adapt
MongoDB terminology Databases Collections (Table in RDBMS) Documents (Tuple/Rows in RDBMS)
MongoDB Distributed Systems Architecture Replication Sets Single-master! Maintains backup copies of database instance Secondaries can elect a new primary within seconds if primary goes down
Architecture Replica Set Quirks Replicas only address durability, not ability to scale A majority of the servers in your set must agree on the primary Even number of servers (2) does not work
Architecture Write process All write operation go through primary, which applies the write operation. Write operation then records operations on primary’s operation log “ oplog ” Secondary are continuously replicating the oplog and applying the operations to themselves in an asynchronous process
Architecture Workloads Isolation Combines different classes of workload
Architecture Sharding To meet the needs of app with large data sets and high throughput requirements
Architecture Sharding Mongos talks to exactly three Config server
Architecture Sharding Quirks If any one config serves goes down, your entire database goes down. Auto- sharding sometimes doesn’t work.
Architecture Data Locality MongoDB zoned sharding allows precise control over where data is physically stored in a cluster. Enables developers- data placement by geographic region Developer can assign each shard to a zone representing the physical location. Any number of shards can be associated with each zone, and each zone can be scaled independently of the other
Architecture Data Security Authentication Offers integration with external security mechanisms including Windows Active Directory, Kerberos, etc. Authorization Enable to configure granular permission for user Auditing provide native audit log to track any DB operations Encryption On networks, on disk and in backups
Architecture Freedom to Run Anywhere Many companies moving to public cloud MongoDB allows organizations to adopt cloud at their own pace by moving select workloads as needed. For example, They may run the same workload in a hybrid environment to manage sudden peaks in demand, or use the cloud to launch services in regions where they lack a physical data center presence.
Advantages over RDBMS Schema less Deep query ability Ease of scale-out Structure of single object is clear Uses internal memory for storing the working set, enabling faster access of data Mapping of application objects to database objects is not needed
Why use MongoDB? Document Oriented Storage Index on any attribute Replication and high availability Auto- sharding Rich queries Built-in aggregation capabilities, MapReduce, GridFS Professional support by MongoDB
Where to use MongoDB? Big Data Content Management and Delivery Mobile and Social infrastructure User Data Management Data Hub
References- https:// www.mongodb.com/what-is-mongodb Mongodb A rchitectural Guide https ://www.tutorialspoint.com/mongodb / MongoDB Tutorials – TutorialsPoints Understanding mongodb , by Frank Kane - Youtube video MongoDB in 5 minutes with Eliot Horowitz – Youtube video