12. 12
Easy: MongoDB Multi-Document ACID Transactions
Just like relational transactions
• Multi-statement, familiar relational syntax
• Easy to add to any application
• Multiple documents in 1 or many collections and databases
ACID guarantees
• Snapshot isolation, all or nothing execution
• No performance impact for non-transactional operations
Planning
• MongoDB 4.0: replica set
• MongoDB 4.2: extended to sharded clusters
13. 13
Fully Indexable
Fully featured secondary indexes
• Primary Index
– Every Collection has a primary key index
• Compound Index
– Index against multiple keys in the document
• MultiKey Index
– Index into arrays
• Text Indexes
– Support for text searches
• GeoSpatial Indexes
– 2d & 2dSphere indexes for spatial geometries
• Hashed Indexes
– Hashed based values for sharding
Index Types
• TTL Indexes
– Single Field indexes, when expired delete the document
• Unique Indexes
– Ensures value is not duplicated
• Partial Indexes
– Expression based indexes, allowing indexes on subsets of data
• Case Insensitive Indexes
• supports text search using case insensitive search
• Sparse Indexes
– Only index documents which have the given field
Index Features
16. 16
Compared to SQL JOINs and aggregation
SELECT
city,
SUM(annual_spend) Total_Spend,
AVG(annual_spend) Average_Spend,
MAX(annual_spend) Max_Spend,
COUNT(annual_spend) customers
FROM (
SELECT t1.city, customer.annual_spend
FROM customer
LEFT JOIN (
SELECT address.address_id, city.city,
address.customer_id, address.location
FROM address LEFT JOIN city
ON address.city_id = city.city_id
) AS t1
ON
(customer.customer_id = t1.customer_id AND
t1.location = "home")
) AS t2
GROUP BY city;
SQL queries have a
nested structure
Understanding the outer
layers requires
understanding the inner
ones
So SQL has to be read
“inside-out”
17. 17
db.customers.aggregate([
{
$unwind: "$address",
},
{
$match: {"address.location": "home"}
},
{
$group: {
_id: "$address.city",
totalSpend: {$sum: "$annualSpend"},
averageSpend: {$avg: "$annualSpend"},
maximumSpend: {$max: "$annualSpend"},
customers: {$sum: 1}
}
}
])
Versatile: Complex queries fast to create, optimize, & maintain
MongoDB’s aggregation framework has the flexibility you need to get
value from your data, but without the complexity and fragility of SQL
These “phases” are distinct and
easy to understand
They can be thought about in
order… no nesting.
19. 19
Sophisticated Analytics & Visualizations Of Data In Place
• Rich MongoDB query
language & idiomatic
drivers
• Connector for BI
• Connector for Spark
• Charts (beta)
20. MongoDB Charts: Create, Visualize, Share
Work with complex data Connect to data sources securely.
Filter. Sample. Visualize.
Share dashboards and
collaborate
21. 21
Versatile: MongoDB Change Streams
Enabling developers to build
reactive, real-time servicesChangeStreamsAPI
Business
Apps
User Data
Sensors
Clickstream
Real-Time
Event Notifications
Message Queue
37. Cloud ManagerOps Manager MongoDB Atlas
Private DBaaS
Compatibility multi-environment
Hybrid DBaaS Public DBaaS
Fully managed
Same codebase, same API & same UI
38. 38
Operational Agility – 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
40. Evolution of Computing Models
Evolution to more streamlined, managed infrastructure
Large Data Center Virtual Machines VMs in the Cloud (EC2) Containers Serverless
Manage H/W Manage less H/W Size & provision VMs Size & provision containers Just send in requests
Wasted resources Better utilization Rent, not buy Rent with less waste Pay as you go
$$$$$ $$$$ $$$ $$ $
Cheaper to build
Cheaper to run
Faster time to market
42. Focus Your Energy Where You Can Make a Difference
App Backend Infrastructure
Core Database Functionality
Storage
Service integrations, data access control
Code that moves the business forward
Managing OS, Scale, Security, Backups, etc.
Time
40%
40%
20%
43. Focus Your Energy Where You Can Make a Difference
App Backend Infrastructure
Core Database Functionality
Storage
Service integrations, data access control
Code that moves the business forward
Managing OS, Scale, Security, Backups, etc.
MongoDB
Atlas
Time
40%
40%
20%
44. Focus Your Energy Where You Can Make a Difference
App Backend Infrastructure
Core Database Functionality
Storage
Service integrations, data access control
Code that moves the business forward
Managing OS, Scale, Security, Backups, etc.
MongoDB
Atlas
MongoDB
Stitch Fully managed
Elastic scale
Highly Available
Secure
Time
40%
40%
20%
45. Focus Your Energy Where You Can Make a Difference
App Backend Infrastructure
Core Database Functionality
Storage
Service integrations, data access control
Code that moves the business forward
Managing OS, Scale, Security, Backups, etc.
MongoDB
Atlas
MongoDB
Stitch Fully managed
Elastic scale
Highly Available
Secure
Customer can focus here
Time
40%
40%
20%
46. Streamlines app development with simple, secure access to data and services from the client with thousands of lines less
code to write and no infrastructure to manage – getting your apps to market faster while reducing operational costs.
Stitch QueryAnywhere
Full power of MongoDB
document model & query
language in frontend code
Fine-grained security
policies through
declarative rules
MongoDB Stitch Serverless Platform Services
47. Streamlines app development with simple, secure access to data and services from the client with thousands of lines less
code to write and no infrastructure to manage – getting your apps to market faster while reducing operational costs.
Stitch QueryAnywhere
Full power of MongoDB
document model & query
language in frontend code
Fine-grained security
policies through
declarative rules
Stitch Functions
Run simple JavaScript
functions in Stitch’s
serverless environment
Power apps with Server-side
logic, or enable Data as a
Service with custom APIs.
MongoDB Stitch Serverless Platform Services
48. Streamlines app development with simple, secure access to data and services from the client with thousands of lines less
code to write and no infrastructure to manage – getting your apps to market faster while reducing operational costs.
Stitch QueryAnywhere
Full power of MongoDB
document model & query
language in frontend code
Fine-grained security
policies through
declarative rules
Stitch Functions
Run simple JavaScript
functions in Stitch’s
serverless environment
Power apps with Server-side
logic, or enable Data as a
Service with custom APIs.
Stitch Triggers
Real-time notifications that
launch functions in response
to changes in the database
Make further database
changes, push data to other
places, or interact with users
MongoDB Stitch Serverless Platform Services
49. Stitch QueryAnywhere
Full power of MongoDB
document model & query
language in frontend code
Fine-grained security
policies through
declarative rules
Stitch Functions
Run simple JavaScript
functions in Stitch’s
serverless environment
Power apps with Server-side
logic, or enable Data as a
Service with custom APIs.
Stitch Mobile Sync
Automatically synchronizes
data between documents
held locally in MongoDB
Mobile and the backend
database
(coming soon)
Streamlines app development with simple, secure access to data and services from the client with thousands of lines less
code to write and no infrastructure to manage – getting your apps to market faster while reducing operational costs.
Stitch Triggers
Real-time notifications that
launch functions in response
to changes in the database
Make further database
changes, push data to other
places, or interact with users
MongoDB Stitch Serverless Platform Services
51. MongoDB Stitch Benefits
Reduce Time to Market
Functions as a Service: No
waiting on infrastructure
Service Integrations: Save
coding
Cross-Platform: Develop
once
Existing Apps Untouched:
No reverse-engineering
52. MongoDB Stitch Benefits
Reduce Time to Market
Functions as a Service: No
waiting on infrastructure
Service Integrations: Save
coding
Cross-Platform: Develop
once
Existing Apps Untouched:
No reverse-engineering
Reduce Operational costs
Serverless: We manage the
platform for you
PaYG: No up-front cost
Capacity on Demand: Zero
wasted resources
Secure by Default: Less ops
effort
53. MongoDB Stitch Benefits
Reduce Time to Market
Functions as a Service: No
waiting on infrastructure
Service Integrations: Save
coding
Cross-Platform: Develop
once
Existing Apps Untouched:
No reverse-engineering
Reduce Development Effort
Backend Integrations Built in:
Don't write generic backend code
HA & Scalability Built in: Hard
and time consuming to build
Orchestrate Data Between
Services: Reuse what's out there
Stitch Runs Your Code: The only
backend you need
Reduce Operational costs
Serverless: We manage the
platform for you
PaYG: No up-front cost
Capacity on Demand: Zero
wasted resources
Secure by Default: Less ops
effort
54. MongoDB Stitch Benefits
Reduce Time to Market
Functions as a Service: No
waiting on infrastructure
Service Integrations: Save
coding
Cross-Platform: Develop
once
Existing Apps Untouched:
No reverse-engineering
Reduce Development Effort
Backend Integrations Built in:
Don't write generic backend code
HA & Scalability Built in: Hard
and time consuming to build
Orchestrate Data Between
Services: Reuse what's out there
Stitch Runs Your Code: The only
backend you need
Reduce Operational costs
Serverless: We manage the
platform for you
PaYG: No up-front cost
Capacity on Demand: Zero
wasted resources
Secure by Default: Less ops
effort
Secure Data Access:
Simple, Declarative Rules
Complete Authentication &
Authorization out of the box:
Authenticate anything and
anyone; protect anything
Precise, Flexible, Extensible
Rules: Lock access down tighter
Flexible Auth Options: Choose
which auth service(s) to use
55. All the Functionality & Scalability of MongoDB
•Full feature set
– Not just key-value store
•Scale up or out
•Retain traditional access methods
•No lock-in
•AWS at start of beta, extending to
on-premises and other cloud providers.