mongoDB - A document-based NoSQL database

24
A document-based NoSQL database XVIII Encontro da comunidade SQLPort OEIRAS, MSFT PT 2011.12.20 1 SQLPort NoSQL Series

description

2011 Chirstmas SQLPort Usergroup Session Presentation about mongoDB.

Transcript of mongoDB - A document-based NoSQL database

Page 1: mongoDB - A document-based NoSQL database

A document-based NoSQL database

XVIII Encontro da comunidade SQLPort

OEIRAS, MSFT PT 2011.12.20

1

SQLPort NoSQL Series

Page 2: mongoDB - A document-based NoSQL database
Page 3: mongoDB - A document-based NoSQL database

Some of what you can learn

in less than 8 hours

XVIII Encontro da comunidade SQLPort

OEIRAS, MSFT PT 2011.12.20

3

And live to tell in 60 minutes or less…

SQLPort NoSQL Series

Page 4: mongoDB - A document-based NoSQL database

Paulo Matos • Not MVP

• Not MC-whatever

Love technology

Love talk about and teach technology

Kind of a Jack of All Trades

..and yes, I do change a lot of light bulbs…

Page 5: mongoDB - A document-based NoSQL database

5

• 2 step refresh about NoSQL

• MangoDB basics

• A tiny, tiny demo

Page 6: mongoDB - A document-based NoSQL database

6

Please,

save the throwing

of rotten vegetables to the end!

Thank you!

Page 7: mongoDB - A document-based NoSQL database

• “Next Generation Databases mostly

addressing some of the points: being non-

relational, distributed, open-

source and horizontally scalable. (…)”

from nosql-databases.org

7

Page 8: mongoDB - A document-based NoSQL database

• Non-relational AKA “Structured Storage”

– No fixed Table Schemas: Content may change row to row

– No (or minimal) JOIN operations

• Usually low-level record-at-a-time instead of SQL clauses (no SELECT, sorry… :( )

• Scale horizontally

– add commodity servers, serve more data and users

8

Page 9: mongoDB - A document-based NoSQL database
Page 10: mongoDB - A document-based NoSQL database

• MongoDB (from "humongous") is a

scalable, high-performance, open

source NoSQL database.

• Written in C++

• It runs on Windows, Mac, *nix, Sparc

• It has drivers for C, C#, C++, Erlang,

Haskel, Javascript, Java, Perl, PHP, Ruby,

Python, Scala

Page 11: mongoDB - A document-based NoSQL database

• Is a data storage solution, based on non-

relational document approach, so that

can easily scale horizontally to “many,

many wonderful” machines

Page 12: mongoDB - A document-based NoSQL database

• Focuses on four main things:

– Flexibility

– Power

– Speed

– Ease of use

Page 13: mongoDB - A document-based NoSQL database

13

• MongoDB stores data in JSON

documents, a rich data model that

seamlessly maps to native programming

language types, and since its schema-

less, makes it much easier to evolve your

data model than with a system with

enforced schemas such as a RDBMS.

Page 14: mongoDB - A document-based NoSQL database

14

• Provides a lot of the features of a

traditional RDBMS such as secondary

indexes, dynamic queries, sorting, rich

updates, upserts (update if document

exists, insert if it doesn't), and easy

aggregation

Page 15: mongoDB - A document-based NoSQL database

15

• By keeping related data together in

documents, queries can be much faster

than in a relational database where related

data is separated into multiple tables and

then needs to be joined later.

• Autosharding allows you to scale your

cluster linearly by adding more machines.

Page 16: mongoDB - A document-based NoSQL database

16

• Easy to install, configure, maintain, and

use.

• Provides few configuration options, and

tries to automatically do the "right thing"

whenever possible

Page 17: mongoDB - A document-based NoSQL database
Page 18: mongoDB - A document-based NoSQL database

18

1. One instance can have 0 or more

databases that act as containers

2. A database can have 0 or more

collections (think tables)

3. A collection can have 0 or more

documents (think rows)

Page 19: mongoDB - A document-based NoSQL database

19

4. A document is made of one or more fields

(think columns)

5. Indexes function much like in any RDMS

6. When retrieving information, MongoDB

returns a cursor that can be counted or

skipped ahead without pulling data

Page 20: mongoDB - A document-based NoSQL database

20

1. mongob is the server process

2. mongo is the shell

3. Programming languages use drivers to access and manipulate data on a MongoDB database

4. There is no Joins

– Arrays and Embedded Documents

– DBRef (driver auto pulls referenced documents)

– Denormalization

Page 21: mongoDB - A document-based NoSQL database
Page 23: mongoDB - A document-based NoSQL database

23

Page 24: mongoDB - A document-based NoSQL database

How to find me… if you care to know!

(really? don’t you have anything better to do?)

Twitter: @pjtmatos

e-mail: [email protected]

24

If you really, really must..

You can now throw the rotten vegetables…