Basics Flashcards
Advantages of MongoDB over RDBMS?
Schema less− MongoDB is a document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another.
Structure of a single object is clear.
No complex joins.
Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that’s nearly as powerful as SQL.
Tuning.
Ease of scale-out− MongoDB is easy to scale.
Conversion/mapping of application objects to database objects not needed.
Uses internal memory for storing the (windowed) working set, enabling faster access of data.
Why use MongoDb?
Document Oriented Storage− Data is stored in the form of JSON style documents.
Index on any attribute
Replication and high availability
Auto-sharding
Rich queries
Fast in-place updates
Professional support by MongoDB
Where to use MongoDb
Big Data
Content Management and Delivery
Mobile and Social Infrastructure
User Data Management
Data Hub
db.stats()
This will show the database name, number of collection and documents in the database.
What makes MongoDB the best?
MongoDB is considered to be best NoSQL database because of :Document-oriented (DO) High performance (HP) High availability (HA) Easy scalability Rich query language
How to do transactions/locking in MongoDB?
MongoDB does not use conventional locking with reduction, as it is planned to be light, high-speed and knowable in its presentation. It can be considered as parallel to the MySQL MyISAM auto entrust sculpt. With simplest business sustain, performance is enhanced, particularly in a structure with numerous servers.
When and to what extent does Data get extended to Multi-slice?
The MongoDB scrap stands on a collection. So an album of all substances is kept in a lump or mass. Only when there is an additional time slot, there will be more than a few slice data achievement choices, but when there is more than 1 lump, data gets extended to a lot of slices and it can be extended to 64 MB.
When do we use Namespace in MongoDB?
During sequencing of the names of the database and collection name Namespace is used.
If you remove an object attribute, is it deleted from the database?
Yes, it is deleted. So better eliminate the attribute and then save the object again.
How can we move the old file in the moveChunk directory?
Once the functions are done, the old files are converted to backup files and moved to the moveChunk directory at the time of balancing the slices.
Explain the situation when an index does not fit into RAM?
When an index is too huge to fit into RAM, then MongoDB reads the index, which is faster than reading RAM because the indexes easily fit into RAM if the server has got RAM for indexes along with the remaining set.
How does MongoDB provide consistency?
MongoDB uses the reader-writer locks, allowing simultaneous readers to access any supply like a database or any collection. But always offers private access to singles writes.
Why is MongoDB not chosen for a 32-bit system?
ngo DB is not considered as a 32-bit system because for running the 32-bit MongoDB, with the server, information and indexes require 2 GB. So only it is not used in 32-bit devices.
How does Journaling work in MongoDB?
Write operations are saved in the memory while journaling is going on. The on-disk journal files are really dependable for the reason that the journal writes are habitual. Inside dbPath, a journal subdirectory is designed by MongoDB.
How can you isolate our cursors from intervening with the write operations?
Snapshot () method is used to isolate cursors from intervening with writes. This method negotiates the index and makes sure that each query comes to any article only once.
Define MongoDB.
It is document oriented database which is used to high availability, easy scalability and high performance. It supports the dynamic schema design.
Explain replica set.
It is a group of mongo instances that maintain same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.
What are the key features of mongodb
There are 3 main features of mongodb that are automatic scaling, High performance and high availability.
What is CRUD?
Mongodb provides CRUD operations that are create, Read, Update, Delete.
What is sharding?
Sharding means to store the data on the multiple machines.
What is Aggregation in MongoDB?
Aggregations are operations that process data records and return computed results.
Define the namespace in mongodb?
It is the concatenation of collection name and database.
Which syntax is used to create collection in mongodb?
db.createCollection(name,options) is used to create collection in mongodb.
Which syntax is used to drop collection in mongodb?
db.collection.drop() is used to drop collection in mongodb.
Explain Replication
Replication is the process of synchronizing data across multiple servers.
What is the use of Index in mongodb?
Indexes provide high performance read operations for frequently used queries.
Which command is used for inserting a document?
database.collection.insert (document) is used for inserting a document.
What is use of GridFS in mongodb?
GridFS is used for storing and retrieving the large files like audio, Images, Video files.