SlideShare una empresa de Scribd logo
1 de 50
MongoDB 3.6
What’s New
Rubén Terceño, Senior Solutions Architect
ruben@mongodb.com
@rubenTerceno
Agenda
• Razones tecnológicas y de mercado para
MongoDB 3.6
• Key Features & Mejoras
• Desarrollo
• Operaciones
• Análisis y Ciencia de Datos
• Próximos Pasos
Digital Matters….
$4tn+ in
eCommerce sales
by 2020
75bn connected
devices
by 2025
61% see AI as an
“urgent” strategy
in 2017
$108bn AR/VR
market size
by 2021
59% smartphone
penetration
by 2022
$6tn+ in cyber-crime
damage
by 2021
Speed Matters…..
Speed Matters…..But Digital is Hard
Forrester Digital Transformation Infographic: https://go.forrester.com/blogs/16-05-09-digital_transformation_2016_infographic/
MongoDB 3.6
Speed to Develop
• Change Streams
• Retryable Writes
• Tunable Consistency
• MongoDB Compass
• Query Expressivity
• Fully Expressive Array Updates
Modern apps &
services are
tightly integrated
MongoDB Change Streams
Enabling developers to build
reactive, real-time services
ChangeStreamsAPI
Business
Apps
User Data
Sensors
Clickstream
Real-Time
Event Notifications
Message Queue
Change Streams Implementation
Apps register for notifications via change
streams API on top of MongoDB oplog
• Change streams are:
• Flexible: deltas or the full document, filter on specific events only
• Consistent: total ordering of data across shards
• Secure: enforces collection’s user access privileges
• Reliable: only notifies once write committed on majority of replicas
• Resumable: from node failure
• Concurrent: up to 1,000 changes streams per MongoDB instance
• Familiar: use regular MongoDB query language and drivers
Change Streams Use Cases
• Refreshing trading apps as stock prices
change
• Syncing changes across microservices
• Updating dashboards, analytics systems,
search engines
• IoT data pipelines – e.g., generating alarms in
response to connected asset failures
• Push new credit card transactions into ML
models to recalculate risk
• Maintaining multiplayer game scoreboards
ChangeStreamsAPI
Business
Apps
User Data
Sensors
Clickstream
Real-Time
Event Notifications
Message Queue
Change Streams in Action
// Select the collection to query.
MongoCollection<Document> collection =
database.getCollection(”orders");
// Create the change stream cursor.
MongoCursor<Document> cursor =
collection.watch().iterator();
Write Availability
Business
Apps
User Data
Sensors
Clickstream
Write
ACK
In the real world….
Business
Apps
User Data
Sensors
Clickstream
Write
ACK
…..failures happen……
…and the app has no way of
knowing if the write was
applied or not*
• Network failure stops write reaching MongoDB
• MongoDB primary undergoes an election
• Write succeeds, but network failure prevents
ACK delivery
* For idempotent operations, this is not an issue
Handling Write Failures
Business
Apps
User Data
Sensors
Clickstream
Write
ACK
But failures happen……
…and the app has no way of
knowing if the write was
applied or not
• Network failure stops write reaching MongoDB
• MongoDB primary undergoes an election
• Write succeeds, but network failure prevents
ACK delivery
Developers write
complex exception
handling code
MongoDB Retryable Writes
Write failure handling moved from the app to the
database for transient network errors or primary
elections
• Driver automatically retries failed write
• With a unique transaction identifier, server enforces exactly-once
processing semantics
• Properties
• Supports idempotent & non-idempotent operations, and errors caused
by time-outs
• Delivers always-on, global availability of write
operations
• Overcomes the complexity imposed by multi-master, eventually
consistent systems
Retryable Writes in Action
uri = "mongodb://example.com:27017/?retryWrites=true"
client = MongoClient(uri)
database = client.database
collection = database.collection
Strong Consistency
All reads
&
writes
Business
Apps
User
Data
Sensors
Click
stream
MongoDB Primary
MongoDB Secondary
MongoDB Secondary
Tunable Consistency: Scaling Reads
MongoDB Primary
MongoDB Secondary
MongoDB Secondary
All writes
Some reads
Reads
Reads
Business
Apps
User
Data
Sensors
Click
stream
Tunable Consistency Controls
Balance data consistency with performance SLAs
• Developers have precise control over how queries are routed across the
database cluster
• Causal consistency: guarantees monotonic, logically
consistent reads from any replica node in the same user
session
• Sharded secondary reads: Secondary replicas now chunk-
aware, ensuring consistent reads even as data is being
rebalanced across a sharded cluster
Causal Consistency in Action
//start client session, which is causally consistent by default
try (ClientSession session =
client.startSession(ClientSessionOptions.builder().build())) {
//Run causally related operations within the session
collection.insertOne(session, ... );
collection.updateOne(session, ...);
try (MongoCursor<Document> cursor =
collection.find(session).filter(...).iterator()) {
while (cursor.hasNext()) {
Document cur = cursor.next();
}
}
Compass: The GUI for MongoDB
New features
• Query auto-complete
• Query history
• Table view
• Compass plugin framework
Compass Community
• No-cost edition
• GUI used alongside the shell
Download Compass Community
https://www.mongodb.com/download-center#compass
Query Expressivity & Fully
Expressive Array Updates
• Use aggregation pipeline expressions within the MongoDB
query language, using new $expr operator
• SQL equivalent of SELECT * FROM T1 WHERE a>b
• Example: find all customer accounts that have increased month on
month spend by $200 or more
• More expressive queries with less client-side code
• Atomically update multiple matching elements of an array
in a single update command
• Example: update all prices in an array by 20%
• More flexible data modeling
• Avoids document rewrites imposed by other databases
[ ]
Updating Arrays: All Elements
orders:
{
_id: 5,
line_items : [
{ id: 123,
title : "USB Battery",
price: 15.0 },
{ id: 512,
title : "Hip T-shirt",
price : 45.0 }
],
...
}
db.orders.update(
{ _id: 5 },
{ $mul: {
"line_items.$[].price":
0.8
}
}
)
Updating Arrays: Some Elements
orders:
{
_id: 5,
line_items : [
{ id: 123,
title : "USB Battery",
price: 15.0 ,
shipped: true},
{ id: 512,
title : "Hip T-shirt",
price : 45.0,
shipped: false }
]
}
db.orders.update(
{ _id: 5 },
{ $mul: {
"line_items.$[li].price":
.8}},
{arrayFilters:[
{"li.shipped":{$ne:true}}
]}
)
• Ops Manager
• Schema Validation
• Extended Security
• Compression
• Multi-tenancySpeed to Scale
Data Explorer
Inspect schema &
index utilization
Real-Time
Performance Panel
Live telemetry: in-flight operations &
resource consumption
Performance Advisor
Always-on index
recommendations
Ops Manager Backup & Restore
Continuous & Consistent Backups with Point in Time
Restore:
• Queryable Backups: Inspect backups without need to first restore
• Faster Backups: Refactored agent & improved initial sync
• Faster Recovery: Point in time snapshots now created at
destination node, reducing a network hop
• Backups to Object Stores: On-prem as well as S3
• Cross-Project Restores: Restore to different project from
snapshot source
Balancing Flexible Data Model with
Data Governance
{
product_name: ‘Acme Paint’,
color: [‘Red’, ‘Green’],
size_oz: [8, 32],
finish: [‘satin’, ‘eggshell’]
}
{
product_name: ‘T-shirt’,
size: [‘S’, ‘M’, ‘L’, ‘XL’],
color: [‘Heather Gray’ … ],
material: ‘100% cotton’,
wash: ‘cold’,
dry: ‘tumble dry low’
}
{
product_name: ‘Mountain Bike’,
brake_style: ‘mechanical disc’,
color: ‘grey’,
frame_material: ‘aluminum’,
no_speeds: 21,
package_height: ‘7.5x32.9x55’,
weight_lbs: 44.05,
suspension_type: ‘dual’,
wheel_size_in: 26
}
Documents in the same product catalog collection in MongoDB
Schema Validation
Enforces strict schema structure over a complete collection
for data governance & quality
• Builds on document validation introduced by restricting new content that
can be added to a document
• Enforces presence, type, and values for document content, including
nested array
• Simplifies application logic
Tunable: enforce document structure, log warnings, or allow
complete schema flexibility
Queryable: identify all existing documents that do not comply
Schema Validation in Action
db.createCollection( "orders",
{validator: {$jsonSchema:
{
properties:
{line_items:
{type: "array",
items:
{properties:
{title: {type: "string"},
price: {type: "number", minimum: 0.0} },
required: ["_id", "title", "price"],
additionalProperties: false}}},
required: ["line_items"]}}}
)
End-to-End Data Security
• Authentication: LDAP, Kerberos, x509,
Challenge/Response
• Authorization: RBAC, User-Defined
Roles, Field-Level Security
• Encryption: In-Motion, At-Rest, Backups
• Audit: Full DML & DDL
Extending Security Controls
New in MongoDB 3.6
• Bind to Localhost: RPM & DEB defaults extended to all packages &
platforms. Denies all external connections to the database until
permitted by the admin
• IP Whitelisting: Only accept external connections from defined IP
addresses or CIDR blocks
User Authentication IP Address
Whitelisting
db.createUser(), db.updateUser(), db.createRole(), db.updateRole()
192.168.1.25
Application
Application
System Administrator
192.168.1.48
172.16.4.13
172.16.4.88
172.33.20.62
172.33.20.11
Restrict each user’s
authentication based on:
• Client IP Address Range
and/or
• Server IP Listen Address
End to End Compression
MongoDB 3.6 adds compression
of wire protocol traffic between
client and database
• Up to 80% bandwidth savings
MongoDB End to End
Compression
• Wire protocol
• Intra-cluster
• Indexes in memory
• Storage
Application
MongoDB Primary
Replica
Wire Protocol
Compression
MongoDB Secondary Replica
Single ViewMongoDB Secondary Replica
Single ViewMongoDB Secondary Replica
Single ViewMongoDB Secondary Replica
Single ViewMongoDB Secondary Replica
MongoDB Secondary Replica
Intra-Cluster
Compression
Compression of
Data on Disk
Compression of
Indexes in Memory
Multi-Tenancy Management
• Operational Session Management
• Admins can view, group, search every user session on every
node in the cluster
• Kill operations running across multiple nodes in a single command
• 1m+ WiredTiger Collections
• Refactored WiredTiger internals to support applications
generating thousands of collections per instance
• SaaS apps: collection per user
• IoT services: collection per asset per hour
• Connector for BI
• Aggregation Pipeline
• R Driver
Speed to Insight
MongoDB Connector for BI
+ many more
• Faster
• Takes advantage of 3.6 expressive Lookup to push more
computation into the database
• Supports Show Status function to enable deeper performance
optimization
• Simpler
• Lifecycle management with Ops Manager
• Schema sampling and mapping now managed by the the
mongosqld process, rather than separate utility
• Authenticate via client-side plugins, rather than managing TLS
certificates. Kerberos support added
What’s New in the BI Connector
Richer Aggregation Pipeline
• Expressive $lookup
• Beyond Left Outer equi-join. Now supports non equi-joins &
subqueries
• Executed natively in the database, allowing more complex
analytics queries with less code
• Timezone-aware aggregations
• Enables multi-region analysis that are aware of region-specific
timezones and working days when grouping data
• New expressions for richer transformations
• Convert to and from objects to arrays of K-V pairs
• Merge multiple objects into a single object
• Remove fields from an object based on evaluation criteria
$lookup in 3.6
db.orders.aggregate([
{$unwind: "$line_items"},
{$lookup:{
from: "reviews",
let: {p_id:
"$line_items.id"},
pipeline: [
{$match: {$expr: {$eq:
["$p_id", "$$p_id"]}}},
{$group: {
_id: 1,
rating: {$avg:"$rating"}
}}
],
as: "avgRating" }
}
])
orders:
{
...
line_items : [
{ id: 123,
title : “USB Battery”,
price: 15.0 },
{ id: 512,
title : “Hip T-shirt”,
price : 45.0 }
],
...
}
R Driver for MongoDB
Recommended MongoDB R driver for data scientists,
developers & statisticians
• Idiomatic, native language access to the database
• MongoDB read & write concerns to control data
consistency & durability
• Data security with enterprise authentication
mechanisms
• Advanced BSON data types, e.g., Decimal 128 for
high precision scientific & financial analysis
Cloud ManagerOps Manager MongoDB Atlas
Private DBaaS:
On-Prem
Run Anywhere
Eliminating Lock-In
Hybrid DBaaS
Public DBaaS:
Fully Managed
Same Code Base, Same API, Same Management UI
MongoDB Atlas: Database as a
Service
Self-service, elastic,
and automated
Secure by defaultGlobal and highly
available
Continuous
backups
Real-time monitoring and
optimization
Cloud agnostic
What’s New in Atlas
● Availability of MongoDB 3.6 in
MongoDB Atlas (at GA)
● Cross-region replication
● Storage auto-scaling
● Pause Cluster
● Always-on performance advisor
● Cross project restores
Auto-storage
scaling
Next Steps
MongoDB 3.6
Move at the Speed ofYour Data
Speed to Develop
● Change Streams
● Retryable Writes
● Tunable Consistency
● Compass
● Query Expressivity &
Fine-Grained Array
Updates
Speed to Scale
● Ops Manager
● Schema Validation
● Extended Security
Controls
● E2E Compression
● Multi-Tenancy
Management
Speed to Insight
● BI Connector
● Richer Aggregation
Pipeline
● R Driver
http://university.mongodb.com/courses/M036/about
M036: New Features
and Tools in
MongoDB 3.6
Getting Started with MongoDB 3.6
• Download the release candidate &
review the Release Notes
• Read the What’s New whitepaper
• Free MongoDB University Training
• We can help: Major Version Upgrade Service
https://www.mongodb.com/download-center#development
https://docs.mongodb.com/master/release-notes/3.6/
https://www.mongodb.com/collateral/mongodb-36-whats-new
https://university.mongodb.com/courses/M036/about
https://www.mongodb.com/products/consulting
MongoDB 3.6

Más contenido relacionado

La actualidad más candente

Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
MongoDB APAC
 
Building LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDBBuilding LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDB
MongoDB
 

La actualidad más candente (20)

MongoDB Days Silicon Valley: A Technical Introduction to WiredTiger
MongoDB Days Silicon Valley: A Technical Introduction to WiredTiger MongoDB Days Silicon Valley: A Technical Introduction to WiredTiger
MongoDB Days Silicon Valley: A Technical Introduction to WiredTiger
 
Rpsonmongodb
RpsonmongodbRpsonmongodb
Rpsonmongodb
 
Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
 
Webinar: Schema Patterns and Your Storage Engine
Webinar: Schema Patterns and Your Storage EngineWebinar: Schema Patterns and Your Storage Engine
Webinar: Schema Patterns and Your Storage Engine
 
What's new in MongoDB 2.6
What's new in MongoDB 2.6What's new in MongoDB 2.6
What's new in MongoDB 2.6
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media Platform
 
Building LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDBBuilding LinkedIn's Learning Platform with MongoDB
Building LinkedIn's Learning Platform with MongoDB
 
Conceptos Avanzados 1: Motores de Almacenamiento
Conceptos Avanzados 1: Motores de AlmacenamientoConceptos Avanzados 1: Motores de Almacenamiento
Conceptos Avanzados 1: Motores de Almacenamiento
 
Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters Database Trends for Modern Applications: Why the Database You Choose Matters
Database Trends for Modern Applications: Why the Database You Choose Matters
 
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
 
MongoDB on Azure
MongoDB on AzureMongoDB on Azure
MongoDB on Azure
 
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN Stack
 
Advanced Schema Design Patterns
Advanced Schema Design PatternsAdvanced Schema Design Patterns
Advanced Schema Design Patterns
 
A Free New World: Atlas Free Tier and How It Was Born
A Free New World: Atlas Free Tier and How It Was Born A Free New World: Atlas Free Tier and How It Was Born
A Free New World: Atlas Free Tier and How It Was Born
 
MMS - Monitoring, backup and management at a single click
MMS - Monitoring, backup and management at a single clickMMS - Monitoring, backup and management at a single click
MMS - Monitoring, backup and management at a single click
 
An Introduction to MongoDB Compass
An Introduction to MongoDB CompassAn Introduction to MongoDB Compass
An Introduction to MongoDB Compass
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOL
 
MSFT Dumaguete 061616 - Building High Performance Apps
MSFT Dumaguete 061616 - Building High Performance AppsMSFT Dumaguete 061616 - Building High Performance Apps
MSFT Dumaguete 061616 - Building High Performance Apps
 
Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...
Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...
Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...
 

Similar a Novedades de MongoDB 3.6

MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt Groupe
MongoDB
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdf
MongoDB
 

Similar a Novedades de MongoDB 3.6 (20)

What's new in MongoDB 3.6?
What's new in MongoDB 3.6?What's new in MongoDB 3.6?
What's new in MongoDB 3.6?
 
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 
MongoDB 3.4 webinar
MongoDB 3.4 webinarMongoDB 3.4 webinar
MongoDB 3.4 webinar
 
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce PlatformMongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
MongoDB World 2018: Breaking the Mold - Redesigning Dell's E-Commerce Platform
 
Migrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDBMigrating from RDBMS to MongoDB
Migrating from RDBMS to MongoDB
 
Dataweek-Talk-2014
Dataweek-Talk-2014Dataweek-Talk-2014
Dataweek-Talk-2014
 
Webminar - Novedades de MongoDB 3.2
Webminar - Novedades de MongoDB 3.2Webminar - Novedades de MongoDB 3.2
Webminar - Novedades de MongoDB 3.2
 
Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2
 
Webinar : Nouveautés de MongoDB 3.2
Webinar : Nouveautés de MongoDB 3.2Webinar : Nouveautés de MongoDB 3.2
Webinar : Nouveautés de MongoDB 3.2
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 
MongoDB What's new in 3.2 version
MongoDB What's new in 3.2 versionMongoDB What's new in 3.2 version
MongoDB What's new in 3.2 version
 
MongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch TutorialMongoDB.local Atlanta: MongoDB Stitch Tutorial
MongoDB.local Atlanta: MongoDB Stitch Tutorial
 
Enterprise Trends for MongoDB as a Service
Enterprise Trends for MongoDB as a ServiceEnterprise Trends for MongoDB as a Service
Enterprise Trends for MongoDB as a Service
 
MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt Groupe
 
Rapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackRapid Application Development with MEAN Stack
Rapid Application Development with MEAN Stack
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
 
Budapest Spring MUG 2016 - MongoDB User Group
Budapest Spring MUG 2016 - MongoDB User GroupBudapest Spring MUG 2016 - MongoDB User Group
Budapest Spring MUG 2016 - MongoDB User Group
 
Final_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdfFinal_CloudEventFrankfurt2017 (1).pdf
Final_CloudEventFrankfurt2017 (1).pdf
 
Confluent & MongoDB APAC Lunch & Learn
Confluent & MongoDB APAC Lunch & LearnConfluent & MongoDB APAC Lunch & Learn
Confluent & MongoDB APAC Lunch & Learn
 
Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8Webinar: High Performance MongoDB Applications with IBM POWER8
Webinar: High Performance MongoDB Applications with IBM POWER8
 

Más de MongoDB

Más de MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Novedades de MongoDB 3.6

  • 1. MongoDB 3.6 What’s New Rubén Terceño, Senior Solutions Architect ruben@mongodb.com @rubenTerceno
  • 2. Agenda • Razones tecnológicas y de mercado para MongoDB 3.6 • Key Features & Mejoras • Desarrollo • Operaciones • Análisis y Ciencia de Datos • Próximos Pasos
  • 3. Digital Matters…. $4tn+ in eCommerce sales by 2020 75bn connected devices by 2025 61% see AI as an “urgent” strategy in 2017 $108bn AR/VR market size by 2021 59% smartphone penetration by 2022 $6tn+ in cyber-crime damage by 2021
  • 5. Speed Matters…..But Digital is Hard Forrester Digital Transformation Infographic: https://go.forrester.com/blogs/16-05-09-digital_transformation_2016_infographic/
  • 7. Speed to Develop • Change Streams • Retryable Writes • Tunable Consistency • MongoDB Compass • Query Expressivity • Fully Expressive Array Updates
  • 8. Modern apps & services are tightly integrated
  • 9. MongoDB Change Streams Enabling developers to build reactive, real-time services ChangeStreamsAPI Business Apps User Data Sensors Clickstream Real-Time Event Notifications Message Queue
  • 10. Change Streams Implementation Apps register for notifications via change streams API on top of MongoDB oplog • Change streams are: • Flexible: deltas or the full document, filter on specific events only • Consistent: total ordering of data across shards • Secure: enforces collection’s user access privileges • Reliable: only notifies once write committed on majority of replicas • Resumable: from node failure • Concurrent: up to 1,000 changes streams per MongoDB instance • Familiar: use regular MongoDB query language and drivers
  • 11. Change Streams Use Cases • Refreshing trading apps as stock prices change • Syncing changes across microservices • Updating dashboards, analytics systems, search engines • IoT data pipelines – e.g., generating alarms in response to connected asset failures • Push new credit card transactions into ML models to recalculate risk • Maintaining multiplayer game scoreboards ChangeStreamsAPI Business Apps User Data Sensors Clickstream Real-Time Event Notifications Message Queue
  • 12. Change Streams in Action // Select the collection to query. MongoCollection<Document> collection = database.getCollection(”orders"); // Create the change stream cursor. MongoCursor<Document> cursor = collection.watch().iterator();
  • 14. In the real world…. Business Apps User Data Sensors Clickstream Write ACK …..failures happen…… …and the app has no way of knowing if the write was applied or not* • Network failure stops write reaching MongoDB • MongoDB primary undergoes an election • Write succeeds, but network failure prevents ACK delivery * For idempotent operations, this is not an issue
  • 15. Handling Write Failures Business Apps User Data Sensors Clickstream Write ACK But failures happen…… …and the app has no way of knowing if the write was applied or not • Network failure stops write reaching MongoDB • MongoDB primary undergoes an election • Write succeeds, but network failure prevents ACK delivery Developers write complex exception handling code
  • 16. MongoDB Retryable Writes Write failure handling moved from the app to the database for transient network errors or primary elections • Driver automatically retries failed write • With a unique transaction identifier, server enforces exactly-once processing semantics • Properties • Supports idempotent & non-idempotent operations, and errors caused by time-outs • Delivers always-on, global availability of write operations • Overcomes the complexity imposed by multi-master, eventually consistent systems
  • 17. Retryable Writes in Action uri = "mongodb://example.com:27017/?retryWrites=true" client = MongoClient(uri) database = client.database collection = database.collection
  • 19. Tunable Consistency: Scaling Reads MongoDB Primary MongoDB Secondary MongoDB Secondary All writes Some reads Reads Reads Business Apps User Data Sensors Click stream
  • 20. Tunable Consistency Controls Balance data consistency with performance SLAs • Developers have precise control over how queries are routed across the database cluster • Causal consistency: guarantees monotonic, logically consistent reads from any replica node in the same user session • Sharded secondary reads: Secondary replicas now chunk- aware, ensuring consistent reads even as data is being rebalanced across a sharded cluster
  • 21. Causal Consistency in Action //start client session, which is causally consistent by default try (ClientSession session = client.startSession(ClientSessionOptions.builder().build())) { //Run causally related operations within the session collection.insertOne(session, ... ); collection.updateOne(session, ...); try (MongoCursor<Document> cursor = collection.find(session).filter(...).iterator()) { while (cursor.hasNext()) { Document cur = cursor.next(); } }
  • 22. Compass: The GUI for MongoDB New features • Query auto-complete • Query history • Table view • Compass plugin framework Compass Community • No-cost edition • GUI used alongside the shell Download Compass Community https://www.mongodb.com/download-center#compass
  • 23. Query Expressivity & Fully Expressive Array Updates • Use aggregation pipeline expressions within the MongoDB query language, using new $expr operator • SQL equivalent of SELECT * FROM T1 WHERE a>b • Example: find all customer accounts that have increased month on month spend by $200 or more • More expressive queries with less client-side code • Atomically update multiple matching elements of an array in a single update command • Example: update all prices in an array by 20% • More flexible data modeling • Avoids document rewrites imposed by other databases [ ]
  • 24. Updating Arrays: All Elements orders: { _id: 5, line_items : [ { id: 123, title : "USB Battery", price: 15.0 }, { id: 512, title : "Hip T-shirt", price : 45.0 } ], ... } db.orders.update( { _id: 5 }, { $mul: { "line_items.$[].price": 0.8 } } )
  • 25. Updating Arrays: Some Elements orders: { _id: 5, line_items : [ { id: 123, title : "USB Battery", price: 15.0 , shipped: true}, { id: 512, title : "Hip T-shirt", price : 45.0, shipped: false } ] } db.orders.update( { _id: 5 }, { $mul: { "line_items.$[li].price": .8}}, {arrayFilters:[ {"li.shipped":{$ne:true}} ]} )
  • 26. • Ops Manager • Schema Validation • Extended Security • Compression • Multi-tenancySpeed to Scale
  • 27. Data Explorer Inspect schema & index utilization Real-Time Performance Panel Live telemetry: in-flight operations & resource consumption Performance Advisor Always-on index recommendations
  • 28. Ops Manager Backup & Restore Continuous & Consistent Backups with Point in Time Restore: • Queryable Backups: Inspect backups without need to first restore • Faster Backups: Refactored agent & improved initial sync • Faster Recovery: Point in time snapshots now created at destination node, reducing a network hop • Backups to Object Stores: On-prem as well as S3 • Cross-Project Restores: Restore to different project from snapshot source
  • 29. Balancing Flexible Data Model with Data Governance { product_name: ‘Acme Paint’, color: [‘Red’, ‘Green’], size_oz: [8, 32], finish: [‘satin’, ‘eggshell’] } { product_name: ‘T-shirt’, size: [‘S’, ‘M’, ‘L’, ‘XL’], color: [‘Heather Gray’ … ], material: ‘100% cotton’, wash: ‘cold’, dry: ‘tumble dry low’ } { product_name: ‘Mountain Bike’, brake_style: ‘mechanical disc’, color: ‘grey’, frame_material: ‘aluminum’, no_speeds: 21, package_height: ‘7.5x32.9x55’, weight_lbs: 44.05, suspension_type: ‘dual’, wheel_size_in: 26 } Documents in the same product catalog collection in MongoDB
  • 30. Schema Validation Enforces strict schema structure over a complete collection for data governance & quality • Builds on document validation introduced by restricting new content that can be added to a document • Enforces presence, type, and values for document content, including nested array • Simplifies application logic Tunable: enforce document structure, log warnings, or allow complete schema flexibility Queryable: identify all existing documents that do not comply
  • 31. Schema Validation in Action db.createCollection( "orders", {validator: {$jsonSchema: { properties: {line_items: {type: "array", items: {properties: {title: {type: "string"}, price: {type: "number", minimum: 0.0} }, required: ["_id", "title", "price"], additionalProperties: false}}}, required: ["line_items"]}}} )
  • 32. End-to-End Data Security • Authentication: LDAP, Kerberos, x509, Challenge/Response • Authorization: RBAC, User-Defined Roles, Field-Level Security • Encryption: In-Motion, At-Rest, Backups • Audit: Full DML & DDL
  • 33. Extending Security Controls New in MongoDB 3.6 • Bind to Localhost: RPM & DEB defaults extended to all packages & platforms. Denies all external connections to the database until permitted by the admin • IP Whitelisting: Only accept external connections from defined IP addresses or CIDR blocks
  • 34. User Authentication IP Address Whitelisting db.createUser(), db.updateUser(), db.createRole(), db.updateRole() 192.168.1.25 Application Application System Administrator 192.168.1.48 172.16.4.13 172.16.4.88 172.33.20.62 172.33.20.11 Restrict each user’s authentication based on: • Client IP Address Range and/or • Server IP Listen Address
  • 35. End to End Compression MongoDB 3.6 adds compression of wire protocol traffic between client and database • Up to 80% bandwidth savings MongoDB End to End Compression • Wire protocol • Intra-cluster • Indexes in memory • Storage Application MongoDB Primary Replica Wire Protocol Compression MongoDB Secondary Replica Single ViewMongoDB Secondary Replica Single ViewMongoDB Secondary Replica Single ViewMongoDB Secondary Replica Single ViewMongoDB Secondary Replica MongoDB Secondary Replica Intra-Cluster Compression Compression of Data on Disk Compression of Indexes in Memory
  • 36. Multi-Tenancy Management • Operational Session Management • Admins can view, group, search every user session on every node in the cluster • Kill operations running across multiple nodes in a single command • 1m+ WiredTiger Collections • Refactored WiredTiger internals to support applications generating thousands of collections per instance • SaaS apps: collection per user • IoT services: collection per asset per hour
  • 37. • Connector for BI • Aggregation Pipeline • R Driver Speed to Insight
  • 38. MongoDB Connector for BI + many more
  • 39. • Faster • Takes advantage of 3.6 expressive Lookup to push more computation into the database • Supports Show Status function to enable deeper performance optimization • Simpler • Lifecycle management with Ops Manager • Schema sampling and mapping now managed by the the mongosqld process, rather than separate utility • Authenticate via client-side plugins, rather than managing TLS certificates. Kerberos support added What’s New in the BI Connector
  • 40. Richer Aggregation Pipeline • Expressive $lookup • Beyond Left Outer equi-join. Now supports non equi-joins & subqueries • Executed natively in the database, allowing more complex analytics queries with less code • Timezone-aware aggregations • Enables multi-region analysis that are aware of region-specific timezones and working days when grouping data • New expressions for richer transformations • Convert to and from objects to arrays of K-V pairs • Merge multiple objects into a single object • Remove fields from an object based on evaluation criteria
  • 41. $lookup in 3.6 db.orders.aggregate([ {$unwind: "$line_items"}, {$lookup:{ from: "reviews", let: {p_id: "$line_items.id"}, pipeline: [ {$match: {$expr: {$eq: ["$p_id", "$$p_id"]}}}, {$group: { _id: 1, rating: {$avg:"$rating"} }} ], as: "avgRating" } } ]) orders: { ... line_items : [ { id: 123, title : “USB Battery”, price: 15.0 }, { id: 512, title : “Hip T-shirt”, price : 45.0 } ], ... }
  • 42. R Driver for MongoDB Recommended MongoDB R driver for data scientists, developers & statisticians • Idiomatic, native language access to the database • MongoDB read & write concerns to control data consistency & durability • Data security with enterprise authentication mechanisms • Advanced BSON data types, e.g., Decimal 128 for high precision scientific & financial analysis
  • 43. Cloud ManagerOps Manager MongoDB Atlas Private DBaaS: On-Prem Run Anywhere Eliminating Lock-In Hybrid DBaaS Public DBaaS: Fully Managed Same Code Base, Same API, Same Management UI
  • 44. MongoDB Atlas: Database as a Service Self-service, elastic, and automated Secure by defaultGlobal and highly available Continuous backups Real-time monitoring and optimization Cloud agnostic
  • 45. What’s New in Atlas ● Availability of MongoDB 3.6 in MongoDB Atlas (at GA) ● Cross-region replication ● Storage auto-scaling ● Pause Cluster ● Always-on performance advisor ● Cross project restores Auto-storage scaling
  • 47. MongoDB 3.6 Move at the Speed ofYour Data Speed to Develop ● Change Streams ● Retryable Writes ● Tunable Consistency ● Compass ● Query Expressivity & Fine-Grained Array Updates Speed to Scale ● Ops Manager ● Schema Validation ● Extended Security Controls ● E2E Compression ● Multi-Tenancy Management Speed to Insight ● BI Connector ● Richer Aggregation Pipeline ● R Driver
  • 49. Getting Started with MongoDB 3.6 • Download the release candidate & review the Release Notes • Read the What’s New whitepaper • Free MongoDB University Training • We can help: Major Version Upgrade Service https://www.mongodb.com/download-center#development https://docs.mongodb.com/master/release-notes/3.6/ https://www.mongodb.com/collateral/mongodb-36-whats-new https://university.mongodb.com/courses/M036/about https://www.mongodb.com/products/consulting