220 likes | 246 Views
MongoDB is a scalable high-performance open-source document-orientated database which is built for speed, rich document based queries for easy readability, full index support for high performance, replication and failover for high availability, auto sharding for easy scalability and map/reduce for aggregation.
E N D
MongoDB Introduction, Installation & Execution iFour Consultancy https://www.ifourtechnolab.com
What is MongoDB ? • Scalable High-Performance Open-source, Document-orientated database. • Built for Speed • Rich Document based queries for Easy readability. • Full Index Support for High Performance. • Replication and Failover for High Availability. • Auto Sharding for Easy Scalability. • Map / Reduce for Aggregation. https://www.ifourtechnolab.com
Why use MongoDB? • SQL was invented in the 70’s to store data. • MongoDB stores documents (or) objects. • Now-a-days, everyone works with objects (Python/Ruby/Java/etc.) • And we need Databases to persist our objects. Then why not store objects directly ? • Embedded documents and arrays reduce need for joins. No Joins and No-multi document transactions. https://www.ifourtechnolab.com
What is MongoDB great for? • RDBMS replacement for Web Applications. • Semi-structured Content Management. • Real-time Analytics & High-Speed Logging. • Caching and High Scalability • Web 2.0, Media, SAAS, Gaming • HealthCare, Finance, Telecom, Government https://www.ifourtechnolab.com
Not great for? • Highly Transactional Applications. • Problems requiring SQL. Some Companies using MongoDB in Production https://www.ifourtechnolab.com
Advantages of MongoDB https://www.ifourtechnolab.com
MongoDB Terminologies for RDBMS concepts https://www.ifourtechnolab.com
JSON https://www.ifourtechnolab.com
BSON https://www.ifourtechnolab.com
BSON Example { "_id" : "37010" “City" : “Nashik", “Pin" : 423201, "state" : “MH", “Postman” : { name: “Ramesh Jadhav” address: “Panchavati” } } https://www.ifourtechnolab.com
Data Types of MongoDB https://www.ifourtechnolab.com
Data Types • String : This is most commonly used datatype to store the data. String in mongodb must be UTF-8 valid. • Integer : This type is used to store a numerical value. Integer can be 32 bit or 64 bit depending upon your server. • Boolean : This type is used to store a boolean (true/ false) value. • Double : This type is used to store floating point values. • Min/ Max keys : This type is used to compare a value against the lowest and highest BSON elements. • Arrays : This type is used to store arrays or list or multiple values into one key. • Timestamp : ctimestamp. This can be handy for recording when a document has been modified or added. • Object : This datatype is used for embedded documents. https://www.ifourtechnolab.com
Data Types • Null : This type is used to store a Null value. • Symbol : This datatype is used identically to a string however, it's generally reserved for languages that use a specific symbol type. • Date : This datatype is used to store the current date or time in UNIX time format. You can specify your own date time by creating object of Date and passing day, month, year into it. • Object ID : This datatype is used to store the document’s ID. • Binary data : This datatype is used to store binay data. • Code : This datatype is used to store javascript code into document. • Regular expression : This datatype is used to store regular expression https://www.ifourtechnolab.com
Installation in Windows • Download MongoDB from Website: https://www.mongodb.org/downloads • Select option Windows • Download and Run https://www.ifourtechnolab.com
Starting MongoDB in Windows https://www.ifourtechnolab.com
Installation in Ubuntu • Download MongoDB from Website: https://www.mongodb.org/downloads • Select option Linux • Download and Run https://www.ifourtechnolab.com
Starting MongoDB in Ubuntu https://www.ifourtechnolab.com
Outline https://www.ifourtechnolab.com
Basic Database Operations https://www.ifourtechnolab.com
Basic Database Operations- Database https://www.ifourtechnolab.com
Basic Database Operations- Collection https://www.ifourtechnolab.com