mongoDB - A document-based NoSQL database
-
Upload
paulo-matos -
Category
Data & Analytics
-
view
184 -
download
4
description
Transcript of 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
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
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…
5
• 2 step refresh about NoSQL
• MangoDB basics
• A tiny, tiny demo
6
Please,
save the throwing
of rotten vegetables to the end!
Thank you!
• “Next Generation Databases mostly
addressing some of the points: being non-
relational, distributed, open-
source and horizontally scalable. (…)”
from nosql-databases.org
7
• 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
• 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
• Is a data storage solution, based on non-
relational document approach, so that
can easily scale horizontally to “many,
many wonderful” machines
• Focuses on four main things:
– Flexibility
– Power
– Speed
– Ease of use
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.
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
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.
16
• Easy to install, configure, maintain, and
use.
• Provides few configuration options, and
tries to automatically do the "right thing"
whenever possible
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)
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
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
• Site do MongoDB – http://www.mongodb.org
– Software downloads, documentation, etc. etc..
• The Little MongoDB Book
– http://openmymind.net/2011/3/28/The-Little-
MongoDB-Book/
22
23
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…