DevoxxFR 2024 Reproducible Builds with Apache Maven
An introduction to MongoDB by César Trigo #OpenExpoDay 2014
1. César Trigo Esteban
Backend Development Director
Twitter: @CesarTrigoEs
www.mongodbspain.com
Twitter: @MongoDBSpain
An Introduction to
2. 1 What is MongoDB
OVERVIEW
World Wide leading NoSQL Database
that allows companies to be more agile and scalable
1. Improving the customer experience
2. Allowing schemes to change quickly to adapt easily to changes
3. Enabling Big-Data
4. Accelerating time to market
5. Reducing costs
3. 2 What is MongoDB
WHO IS USING MONGODB
More at: www.mongodb.com/customers
4. 3 What is MongoDB
COMMUNITY
7Million +
Downloads
200k +
Education Registrations
30k +
MongoDB User Group Members
Fastest-growing community in Big Data
5. 4 What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
6. 4 What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
7. MongoDB Main Features
OPEN SOURCE
Source and supported drivers are open source and hosted at Github:
https://github.com/mongodb
Supported drivers for most programming languages
4.1
8. What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ High performance
❖ Scalable
❖ Full featured
5
9. 5.1 MongoDB Main Features
DOCUMENT ORIENTED
● JSON-like format (BSON) documents as independent units
● Makes it easier to distribute data across multiple servers
● Natural object mapping due to JSON Objects
databasedatabase
collectiontable
documentrow
SQL Term MongoDB Term
SQL to MongoDB
fieldcolumn
embedding & linkingjoin
10. What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
6
12. MongoDB Main Features
NON-RELATIONAL & SCHEMA-LESS
User
Hobbies
Addresses
With MongoDB we can
store related content in
the same document
Non-Relational Data Model
6.2
13. MongoDB Main Features
NON-RELATIONAL & SCHEMA-LESS
User Info
- name - creation
- nick - ...
- age
Hobbies
Addresses
db.user.findOne();
{
_id: objectId("535c56cbdf1790f4e1c80074"),
name: "César Trigo",
nick: "CesarTrigo",
age: 25,
creation: ISODate("2014-04-27T01:00:59.448Z"),
hobbies: ["coding", "football", "basket"],
address:[{
street: "Calle Serrano",
number: 127,
city: "Madrid"
},
{
street: "Avenida Diagonal",
city: "Barcelona"
}],
}
coding basket
address address
MongoDB Document
6.3
football
14. MongoDB Main Features
NON-RELATIONAL & SCHEMA-LESS
User Info
- name - creation
- nick - ...
- age
Hobbies
Addresses
db.user.findOne();
{
_id: objectId("535c56cbdf1790f4e1c80074"),
name: "César Trigo",
nick: "CesarTrigo",
age: 25,
creation: ISODate("2014-04-27T01:00:59.448Z"),
hobbies: ["coding", "football", "basket"],
address:[{
street: "Calle Serrano",
number: 127,
city: "Madrid"
},
{
street: "Avenida Diagonal",
city: "Barcelona"
}],
}
coding basket
address address
MongoDB Document
6.3
football
15. MongoDB Main Features
NON-RELATIONAL & SCHEMA-LESS
User Info
- name - creation
- nick - ...
- age
Hobbies
Addresses
db.user.findOne();
{
_id: objectId("535c56cbdf1790f4e1c80074"),
name: "César Trigo",
nick: "CesarTrigo",
age: 25,
creation: ISODate("2014-04-27T01:00:59.448Z"),
hobbies: ["coding", "football", "basketball"],
address:[{
street: "Calle Serrano",
number: 127,
city: "Madrid"
},
{
street: "Avenida Diagonal",
city: "Barcelona"
}],
}
coding footbal basket
address address
MongoDB Document
6.3
16. What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
7
17. MongoDB Main Features
SCALABLE
Replication: provides redundancy and high data availability
Primary
Secondary
Secondary
D
R
I
V
E
R
APP
write
read
Asynchronous
Replication
● Automated replication and failover
● Multi-datacenter support
● Data durability and consistency
7.1
18. MongoDB Main Features
SCALABLE
Sharding: Storing data records across multiple machines to meeting the
demands of data growth
Shard 1 Shard 2 Shard 3 Shard N
● Increase capacity as you grow reducing the amount of data that
each server needs to store
● Reduces the number of operations each shard handles
● Automatic balancing of data
...
7.2
20. What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
8
21. MongoDB Main Features
HIGH PERFORMANCE
vs
Better data locality In-memory caching Atomic operations
8.1
Relational MongoDB
22. MongoDB Main Features
HIGH PERFORMANCE
Driver
Secondary
Secondary
Write Concern: customizable write concerns for Replica Sets
Primary
write
replicate
replicate
response
apply
apply
Write operation to a replica set
Write to the primary and at
least one secondary
8.2
23. What is MongoDB
DEFINITION
MongoDB is a ...
… database
❖ Open source
❖ Document oriented
❖ Non-relational & Schema-less
❖ Scalable
❖ High performance
❖ Full featured
9
24. ● Geospatial indexes to support
geographic data structures
● GeoJSON support
● 2d support for Flat / Euclidean plane
distance calculation
MongoDB Main Features
FULL FEATURED
Geospatial features
9.2
25. A solution for the real World
because the Earth is not flat!
2d Sphere Indexes: provides spherical
geometry support for Earth-like sphere
distance calculation
MongoDB Main Features
FULL FEATURED9.2
27. MongoDB Main Features
FULL FEATURED
Real time Aggregation: Aggregations are operations that process data
records and return computed results
9.3
Aggregation Pipelines
The pipeline provides efficient data
aggregation using native
operations within MongoDB
Map-Reduce
Uses custom JavaScript functions
to perform the map and reduce
operations, as well as the optional
finalize operation.
28. MongoDB Main Features
FULL FEATURED
MongoDB Management Service
● Server status monitoring
● Custom, metric-based alerting
● Fully managed backups
● Activity and logging viewers
● Automation coming soon
9.4