2. MongoDB
- What is NoSQL?
- NoSQL database types
- Document Database
- MongoDB
- When to use MongoDB?
- Installing MongoDB
3. What is NoSQL?
- Originally referring to "non SQL", "non relational" or "not only SQL"
- Database provides a mechanism for storage and retrieval of data which is
modeled in means other than the tabular relations used in relational
databases.
- Do you know ACID?
- No support for ACID :D
4. NoSQL database types
- Key-value stores:
- Riak, Voldemort, and Redis
- Wide-column stores:
- Cassandra and HBase
- Document databases:
- MongoDB and CouchDB
- Graph databases:
- Neo4J and HyperGraphDB
5. Document Database
- A document database is designed to store semi-structured data as
documents, typically in JSON or XML format.
- There are 11 Document databases so far.
6. MongoDB
- MongoDB (from humongous) is a free and open-source cross-platform
document-oriented database program. Classified as a NoSQL database
program, MongoDB uses JSON-like documents with schemas.
- The software company 10gen began developing MongoDB in 2007 as a
component of a planned platform as a service product. In 2009, the company
shifted to an open source development model, with the company offering
commercial support and other services. In 2013, 10gen changed its name to
MongoDB Inc.
7. MongoDB features
- Document based:
- Documents are similar to JSON objects
- Geospatial Indexes and Queries.
- Indexing
- High Performance:
- Support for embedded data models reduces I/O activity on database system.
- Horizontal Scalability.
- Schemaless
- No Joins
- NO ACID
8. - Your Data is Location Based
- MongoDB has built in spacial functions, so finding relevant data from specific locations is fast
and accurate.
- Your Data Set is Going to be Big (starting from 1GB) and Schema is Not
Stable.
- Need to handle large volumes of structured, semi-structured, and
unstructured data
- Follow modern development practices such as agile sprints, quick iterations,
and frequent code pushes
- Prefer object-oriented programming that is easy to use and flexible
- Want to leverage efficient, scale-out architecture instead of expensive,
monolithic architecture.
When to use MongoDB?
9. Installing MongoDB - Windows
- Download from https://www.mongodb.com/download-center#community
- Double-click the .msi file. A set of screens will appear to guide you through
the installation process.
- Connect to DB: run this exe > C:Program
FilesMongoDBServermongo-versionbinmongo.exe
- To start MongoDB:
- C:Program FilesMongoDBServer3.4binmongod.exe --dbapth directory_of_the_database
10. Installing MongoDB - Mac
- Run the below commands:
- > brew update
- > brew install mongodb --with-openssl
11. Installing MongoDB - ubuntu 16.04
- Use the guidelines here for other versions.
- Run the below commands:
- > sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
- > echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo
tee /etc/apt/sources.list.d/mongodb-org-3.2.list
- > sudo apt-get update
- > sudo apt-get install -y mongodb-org