Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mongo An alternative database system. Installing Mongo We must install both the Mongo database and at least one GUI for managing Mongo See

Similar presentations


Presentation on theme: "Mongo An alternative database system. Installing Mongo We must install both the Mongo database and at least one GUI for managing Mongo See"— Presentation transcript:

1 Mongo An alternative database system

2 Installing Mongo We must install both the Mongo database and at least one GUI for managing Mongo See http://docs.mongodb.org/manual/installation See http://www.mongodb.org/display/DOCS/Admin+UIs

3 What is Mongo? Document based Focuses on clusters for extremely large scaling Supports nested documents Uses JavaScript for queries No schema)

4 Basic Mongo concepts A database consists of collections Which is more or less a table Collections are made up of documents A lot like rows A document is made up of fields A lot like columns There are also indices There are also cursors

5 Mongo goals “Horizontal” scaling – i.e., the cloud & simple servers And no joins, effectively, pre-computed joins Anti-normalization Fast Avoid bottleneck of centralized schema Near real-time data access High availability

6 Implementation of Mongo C++ Heavy use of memory caching for read and write-through Distributes by sharding

7 Applications of Mongo Medical records and other large document systems Read heavy environments like analytics and mining Partnered with relational databases Relational for live data Mongo for huge largely read only archives Online applications Massively wide e-commerce

8 Using Mongo In bin folder mongod for database mongo for shell For data, it needs a directory called data on c: and a directory called db within data Commands Global, like help Db-specific, like db.x, where x is the collection Db.x.help()

9 Tutorial from mongodb.pdf: The Little MongoDB Book Go to: http://openmymind.net/mongodb.pdfhttp://openmymind.net/mongodb.pdf First command: use learn Second command: db.unicorns.insert({name: ‘Aurora’, gender: ‘f’, weight: 450}) In other words, we can create a db and a collection simply by saying they exist – no schema!

10 Query selectors Similar to an SQL program Used for finding, counting, updating, and removing docs from collections {} is the null search and matches all documents We could run: {gender:’f’} {field1: value1, field2: value2} creates an ‘and’ operation Also, less than, greater than, etc. (e.g., $gt) $exists, $or

11 Updating data db.unicorns.update({name: ‘ro’}, {weight: 590}) Finds unicorn with that name and updates its weight Can also find and update records according to the keys mongo has assigned Note: mongo supports arrays as document fields

12 Documents Nested documents are supported DBRef allows documents to reference each other For the future? Full text search Map reduce

13 If you are using Windows Go to http://mongovue.comhttp://mongovue.com Install it Run it…

14 You should get this

15 Other GUIs that are easy to install MongoVision (web based): http://code.google.com/p/mongo-vision/ http://code.google.com/p/mongo-vision/ PHPMoAdmin (web based): http://www.phpmoadmin.com/ – this one is ugly, though! http://www.phpmoadmin.com/ RockMongo (web based): http://rockmongo.com/http://rockmongo.com/

16 RockMongo is perhaps the best

17 Mongo tutorial: Assignment 8: Due Dec. 4 Read the 33 page book Follow the entire tutorial Send an “I did it.” message for homework 8 Include your final document database (“db”) as a zipped attachment Include a screen snapshot of the GUI you used. (You can do the project easily without a GUI, but it’s a good idea to get an idea of how they work.) Important: this material will be on the final.


Download ppt "Mongo An alternative database system. Installing Mongo We must install both the Mongo database and at least one GUI for managing Mongo See"

Similar presentations


Ads by Google