SlideShare a Scribd company logo
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
Global Clusters Topologies
Sig Narvaez
Principal Solution Architect, MongoDB
3.15 Billion
new internet users
since the first MongoDB code commit
Every year a US-sized population
is coming online for the first time
You don’t have to be a household
name to meaningfully reach them
Yes, a CDN can reach
but users expect more
Your users want…
Interactive experiences
Personalization
Instant gratification
Global Operational Data
Your users want…
Interactive experiences
Personalization
Instant gratification
Global Operational Data
You want…
Happy users
To stay ahead of competition
Global awareness
What does 100ms equate to?
What does 100ms equate to?
1% drop in sales
Missed chance to engage a customer
meaningfully
Global Latencies from AWS US West
Americas US West – US East: 83ms
EMEA US West – Frankfurt: 163ms
LATAM US West – Sao Paulo: 190ms
APAC US West – Singapore: 225ms
Options
Global Multi-Region Replication
Secondary Secondary
Primary
Secondary Secondary
Primary
US West
Frankfurt Singapore
Secondary Primary
Frankfurt
Frankfurt
Application
Driver
US West
Application
Driver
Singapore
Application
Driver
EMEA Users Americas Users APAC Users
Global Load Balancer
Secondary
US West Singapore
Global Multi-Region Replication
Single connection string globally
Cross-region high availability
Advantages Disadvantages
All writes go to preferred region
⅔ of users experience > 100ms
Fast reads require secondary read preference
Asymmetrical deployment
Cluster Per Region
Frankfurt
Application
Driver
US West
Application
Driver
Singapore
Application
Driver
EMEA Users Americas Users APAC Users
Global Load Balancer
Secondary
Secondary
Primary
Frankfurt SingaporeUS West
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Cluster Per Region
Easy today in MongoDB Atlas
Independently scalable
Advantages Disadvantages
No global aggregation
Application tier manages end user to connection string
affinity
Can we get the best of both worlds?
Global Clusters with Global Writes
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
How Global Writes work
Data includes location attribute
{
_id: 123,
firstName: "Johannes",
lastName: "Doe",
activities: [
{
title: "Skiing",
attributes: ["downhill", "jumps"]
},
{
title: "Coding",
attributes: ["mongodb", "python"]
}
]
}
{
_id: 123,
location: "DE",
firstName: "Johannes",
lastName: "Doe",
activities: [
{
title: "Skiing",
attributes: ["downhill", "jumps"]
},
{
title: "Coding",
attributes: ["mongodb", "python"]
}
]
}
Generally...
an ISO 3166-1 country code
e.g., US, DE, IN, or JP
Or optionally and more specifically...
an ISO-3166-2 subdivision code
e.g., US-CA or US-NY
Examples Description Potential Region Affinity
US United States US East
DE Germany Frankfurt
IN India Mumbai
JP Japan Tokyo
US-CA California US West
US-NY New York US East
What is a location attribute?
US West
Application
Driver
mongos mongos•••
z
Repl0
Repl1
Repl2
US West Zone
Shard
Frankfurt
Application
Driver
Singapore
Application
Driver
mongos
Americas Users EMEA Users APAC Users
Global Load Balancer
MongoDB Atlas Global Cluster
Repl0
Repl1
Repl2
Frankfurt Zone
Shard
Repl0
Repl1
Repl2
Singapore Zone
Shard
•••
z
Repl0
Repl1
Repl2
Config Servers
Data includes location attribute
{
_id: 123,
firstName: "Johannes",
lastName: "Doe",
activities: [
{
title: "Skiing",
attributes: ["downhill", "jumps"]
},
{
title: "Coding",
attributes: ["mongodb", "python"]
}
]
}
{
_id: 123,
location: "DE",
firstName: "Johannes",
lastName: "Doe",
activities: [
{
title: "Skiing",
attributes: ["downhill", "jumps"]
},
{
title: "Coding",
attributes: ["mongodb", "python"]
}
]
}
US West
Application
Driver
mongos mongos•••
z
Repl0
Repl1
Repl2
US West Zone
Shard
Frankfurt
Application
Driver
Singapore
Application
Driver
mongos
Americas Users EMEA Users APAC Users
Global Load Balancer
MongoDB Atlas Global Cluster
Repl0
Repl1
Repl2
Frankfurt Zone
Shard
Repl0
Repl1
Repl2
Singapore Zone
Shard
•••
z
Repl0
Repl1
Repl2
Config Servers
Repl0
Repl1
Repl2
Frankfurt Zone
Shard
Define Global Collections
MongoDB Atlas will be very opinionated...
In the Data Explorer, you’ll be guided to set a shard key like
{location : 1, <identifier> : 1}
You’ll receive global-targeting query examples
db.globalColl.findOne({ location : "XY", <identifier> : 123, ... })
For example location and _id
{
_id: 123,
location: "CA",
firstName: "Jane",
lastName: "Doe",
activities: [
{
title: "Mountaineering",
attributes: ["glaciers"]
},
{
title: "Coding",
attributes: ["java", "mongodb"]
}
]
}
How are locations mapped to zones?
Query routing without
LATAM zone
{
location:
{$in: [ 'BR-PE', 'BR-PA']}
}
Get ISO Country code from HTTP Request
AWS – Lambda & CloudFront
• headers['cloudfront-viewer-country’]
*Limited to country
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-examples.html#lambda-examples-redirecting-examples
Google Cloud –Functions
• country: req.headers["x-appengine-country"]
• region: req.headers["x-appengine-region"]
https://cloud.google.com/appengine/docs/standard/go/reference/request-response-headers
https://medium.com/mop-developers/free-ip-based-geolocation-with-google-cloud-functions-f92e20d47651
CloudFlare – Enable IP Geolocation
• HTTP_CF_IPCOUNTRY header
Akamai – EdgeScape (CDN)
• country_code and region_code headers
Provide a better experience to
growing markets
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
When should I add a Zone?
If latency of complete request exceeds threshold?
Not really – There are many layers contributing to the latency outside of Atlas
Metrics in Atlas?
Maybe – performance metrics
Maybe – mongos logs – cross-reference IP against IP-GeoLocation DB / Service
It’s beyond Atlas - A combination of:
• Data Set growing from certain countries & sub-divisions
Use Aggregation Framework, BI Connector or Spark Connector for Analytics
• CDN / API Management Metrics: AWS CloudFront / API Gateway, Akamai, etc.
• Planned Expansion: New features targeting specific markets
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
Query routing with
LATAM zone
{
location:
{$in: [ 'BR-PE', 'BR-PA']}
}
Chunk Migration – adding LATAM zone
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers
NA West
Application
Driver
•••
z
Repl0
Repl1
Repl2
NA West
Zone Shard
mongos
NA East EMEA
APAC
North
Global Load Balancer
MongoDB Atlas Global Cluster
NA West
South
America
APAC
South
NA East
Application
Driver
z
Repl0
Repl1
Repl2
NA East
Zone Shard
mongos
South America
Application
Driver
z
Repl0
Repl1
Repl2
South America
Zone Shard
mongos
EMEA
Application
Driver
z
Repl0
Repl1
Repl2
EMEA
Zone Shard
mongos
APAC North
Application
Driver
z
Repl0
Repl1
Repl2
APAC North
Zone Shard
mongos
APAC South
Application
Driver
z
Repl0
Repl1
Repl2
APAC South
Zone Shard
mongos••• ••• ••• •••
Simplified connectivity
Concise and global, it will look like
Your driver will use this address to discover every mongos in the cluster globally
Taking advantage of the MongoDB 3.6 driver support for SRV records
… so you can deploy the same application code everywhere - symmetrically
mongodb+srv://user:pass@globalCluster-rzeyq.mongodb.net
Resolving SRV record to mongos’s
Blog Post: https://www.mongodb.com/blog/post/mongodb-3-6-here-to-SRV-you-with-easier-replica-set-connections
$ python mongodb_srv_records.py globalcluster-twijg.mongodb.net
globalcluster-shard-00-00-twijg.mongodb.net:27016
globalcluster-shard-00-01-twijg.mongodb.net:27016
globalcluster-shard-00-02-twijg.mongodb.net:27016
globalcluster-shard-01-00-twijg.mongodb.net:27016
globalcluster-shard-01-01-twijg.mongodb.net:27016
globalcluster-shard-01-02-twijg.mongodb.net:27016
globalcluster-shard-02-00-twijg.mongodb.net:27016
globalcluster-shard-02-01-twijg.mongodb.net:27016
globalcluster-shard-02-02-twijg.mongodb.net:27016
globalcluster-shard-03-00-twijg.mongodb.net:27016
globalcluster-shard-03-01-twijg.mongodb.net:27016
globalcluster-shard-03-02-twijg.mongodb.net:27016
globalcluster-twijg.mongodb.net: "authSource=admin"
An even better user experience?
What if I want low latency global reads?
What if I want low latency global reads?
What if I want low latency global reads?
Where this is going and limits
Massive reach
MongoDB Atlas
• in-country regions for 27% of the world population
• with a much higher percent served by regions in nearby countries
Available in 56 global cloud regions
• AWS: 15 regions (38 availability zones)
• Azure: 26 regions (26 availability zones w/ 60 Fault Domains)
• GCP: 15 regions (38 Availability zones)
Africa
• S. Africa announced by Azure; a long way from
most of Africa’s population, however
• Biggest economies in Africa: Nigeria, South
Africa, Egypt; with Ethiopia now the fastest
growing
Middle East
• We’ll see
China
• It’s complicated...
There are gaps
Russia
• It’s also complicated…
• Frankfurt remains best bet but also Finland on
Google Cloud
Special / Government / Compliance contexts
But MongoDB runs everywhere
Over time the entire world will be well served by major cloud infrastructure
You can always run your own MongoDB outside of where the big public cloud
• MongoDB Ops Manager / MongoDB Cloud Manager
• Live Migrate to MongoDB Atlas when ready
So you can have a seamless development experience in any context
Imagine 2030
2030 Projection
GDP & relative position
compared with today
1 China ↑ 17 Spain ↓
2 United States ↓ 18 Canada ↓
3 India ↑↑↑↑ 19 Egypt ↑↑↑
4 Japan ↓ 20 Pakistan ↑↑↑
5 Indonesia ↑↑↑ 21 Nigeria ↑↑
6 Russia ↑ 22 Thailand ↑↑
7 Germany ↓ 23 Australia ↓
8 Brazil ↑ 24 Philippines ↑↑
9 Mexico ↑ 25 Malaysia ↑↑
10 United Kingdom ↓ 26 Poland ↓
11 France ↓ 27 Argentina ↓
12 Turkey ↑ 28 Bangladesh ↑↑↑
13 Saudi Arabia ↑↑ 29 Vietnam ↑↑↑
14 South Korea ↓ 30 South Africa ↑↑
15 Italy ↓ 31 Colombia ↑↑
16 Iran ↑↑ 32 Netherlands ↓
You can go global incrementally
Path to Global Over Time
1. Cluster – Single Region ← deploy today for free on Atlas
○ Focus on finding traction
○ Scale up when needed in a few minutes on Atlas
Path to Global Over Time
1. Cluster – Single Region ← deploy today for free on Atlas
○ Focus on finding traction
○ Scale up when needed in a few minutes on Atlas
2. Cluster – Multi Region HA
○ Get your application HA as well
○ Scale up when needed in a few minutes on Atlas
Path to Global Over Time
1. Cluster – Single Region ← deploy today for free on Atlas
○ Focus on finding traction
○ Scale up when needed in a few minutes on Atlas
2. Cluster – Multi Region HA
○ Get your application HA as well
○ Scale up when needed in a few minutes on Atlas
3. Cluster – add Global Read Regions
○ Route users to nearby application instance; use secondary reads
○ Scale up when needed in a few minutes on Atlas
Path to Global Over Time
1. Cluster – Single Region ← deploy today for free on Atlas
○ Focus on finding traction
○ Scale up when needed in a few minutes on Atlas
2. Cluster – Multi Region HA
○ Get your application HA as well
○ Scale up when needed in a few minutes on Atlas
3. Cluster – add Global Read Regions
○ Route users to nearby application instance; use secondary reads
○ Scale up when needed in a few minutes on Atlas
4. Enable Global Writes
○ Add a second write zone
○ Add location attribute to your data & shard your global collections in the Atlas UI
Path to Global Over Time
1. Cluster – Single Region ← deploy today for free on Atlas
○ Focus on finding traction
○ Scale up when needed in a few minutes on Atlas
2. Cluster – Multi Region HA
○ Get your application HA as well
○ Scale up when needed in a few minutes on Atlas
3. Cluster – add Global Read Regions
○ Route users to nearby application instance; use secondary reads
○ Scale up when needed in a few minutes on Atlas
4. Enable Global Writes
○ Add a second write zone
○ Add location attribute to your data & shard your global collections in the Atlas UI
5. Expand Reach of Global Cluster
○ Add more write zones
○ Or add shards to existing zones
○ Scale up any time
And you can follow your users...
Now go out and reach
those 4+ billion internet users
Thanks
Sigfrido “Sig” Narvaez
Principal Solution Architect, MongoDB
sig@mongodb.com
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers

More Related Content

PPTX
Advanced Schema Design Patterns
PDF
Big Data Day LA 2015 - Lessons Learned from Designing Data Ingest Systems by ...
PDF
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
PPTX
HBaseConAsia2018: Track2-5: JanusGraph-Distributed graph database with HBase
PDF
Multi Model Machine Learning by Maximo Gurmendez and Beth Logan
PDF
Hadoop Networking at Datasift
PPTX
Tailored for Spark
PDF
Amazon RedShift - Ianni Vamvadelis
Advanced Schema Design Patterns
Big Data Day LA 2015 - Lessons Learned from Designing Data Ingest Systems by ...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & Deep Learning ...
HBaseConAsia2018: Track2-5: JanusGraph-Distributed graph database with HBase
Multi Model Machine Learning by Maximo Gurmendez and Beth Logan
Hadoop Networking at Datasift
Tailored for Spark
Amazon RedShift - Ianni Vamvadelis

What's hot (19)

PPTX
Explore big data at speed of thought with Spark 2.0 and Snappydata
PDF
Interactive Visualization of Streaming Data Powered by Spark by Ruhollah Farc...
PPTX
Building a Virtual Data Lake with Apache Arrow
PDF
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
PPTX
Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...
PDF
HBaseConAsia2018 Track2-6: Scaling 30TB's of data lake with Apache HBase and ...
PDF
Yelp Ad Targeting at Scale with Apache Spark with Inaz Alaei-Novin and Joe Ma...
PDF
MLflow: Infrastructure for a Complete Machine Learning Life Cycle
PDF
GCP Data Engineer cheatsheet
PDF
Efficiently Building Machine Learning Models for Predictive Maintenance in th...
PDF
HBaseConAsia2018 Track3-3: HBase at China Life Insurance
PDF
Operationalizing Big Data Pipelines At Scale
PDF
Accelerating Machine Learning on Databricks Runtime
PPTX
Time-oriented event search. A new level of scale
PDF
On-boarding with JanusGraph Performance
PDF
Spark meetup - Zoomdata Streaming
PDF
Microsoft cosmos
PDF
AWS DynamoDB
PPTX
HBaseConAsia2018 Track2-2: Apache Kylin on HBase: Extreme OLAP for big data
Explore big data at speed of thought with Spark 2.0 and Snappydata
Interactive Visualization of Streaming Data Powered by Spark by Ruhollah Farc...
Building a Virtual Data Lake with Apache Arrow
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
Виталий Бондаренко "Fast Data Platform for Real-Time Analytics. Architecture ...
HBaseConAsia2018 Track2-6: Scaling 30TB's of data lake with Apache HBase and ...
Yelp Ad Targeting at Scale with Apache Spark with Inaz Alaei-Novin and Joe Ma...
MLflow: Infrastructure for a Complete Machine Learning Life Cycle
GCP Data Engineer cheatsheet
Efficiently Building Machine Learning Models for Predictive Maintenance in th...
HBaseConAsia2018 Track3-3: HBase at China Life Insurance
Operationalizing Big Data Pipelines At Scale
Accelerating Machine Learning on Databricks Runtime
Time-oriented event search. A new level of scale
On-boarding with JanusGraph Performance
Spark meetup - Zoomdata Streaming
Microsoft cosmos
AWS DynamoDB
HBaseConAsia2018 Track2-2: Apache Kylin on HBase: Extreme OLAP for big data
Ad

Similar to Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers (20)

PPTX
MongoDB.local Seattle 2019: Global Cluster Topologies in MongoDB Atlas
PDF
MongoDB World 2018: Global Clusters for a Global World
PPTX
Global Cluster Topologies in MongoDB Atlas - Andrew Davidson
PDF
Global Cluster Topologies in MongoDB Atlas
PPTX
Webinar: General Technical Overview of MongoDB for Ops Teams
PDF
MongoDB webiner01
PDF
MongoDB 4.0 새로운 기능 소개
PPTX
MongoDB Evenings Toronto - Monolithic to Microservices with MongoDB
PDF
Simplifying & accelerating application development with MongoDB's intelligent...
PPTX
Webinar: Building Your First Application with MongoDB
KEY
Discover MongoDB - Israel
PDF
Mongo db 3.4 Overview
PPTX
MongoDB Roadmap
PDF
Cloud conference - mongodb
PDF
MongoDB World 2019: Get the Best of Geo Data with MongoDB Atlas and MongoDB C...
PPTX
Webinar: Scaling MongoDB
PPTX
Ops Jumpstart: MongoDB Administration 101
PPTX
MonogDB Admin 101 - MonogDBDays Munich
PDF
Online | MongoDB Atlas on GCP Workshop
PPTX
MongoDB.local Atlanta: MongoDB on Z
MongoDB.local Seattle 2019: Global Cluster Topologies in MongoDB Atlas
MongoDB World 2018: Global Clusters for a Global World
Global Cluster Topologies in MongoDB Atlas - Andrew Davidson
Global Cluster Topologies in MongoDB Atlas
Webinar: General Technical Overview of MongoDB for Ops Teams
MongoDB webiner01
MongoDB 4.0 새로운 기능 소개
MongoDB Evenings Toronto - Monolithic to Microservices with MongoDB
Simplifying & accelerating application development with MongoDB's intelligent...
Webinar: Building Your First Application with MongoDB
Discover MongoDB - Israel
Mongo db 3.4 Overview
MongoDB Roadmap
Cloud conference - mongodb
MongoDB World 2019: Get the Best of Geo Data with MongoDB Atlas and MongoDB C...
Webinar: Scaling MongoDB
Ops Jumpstart: MongoDB Administration 101
MonogDB Admin 101 - MonogDBDays Munich
Online | MongoDB Atlas on GCP Workshop
MongoDB.local Atlanta: MongoDB on Z
Ad

More from MongoDB (20)

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

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Cloud computing and distributed systems.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
A Presentation on Artificial Intelligence
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Machine Learning_overview_presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25-Week II
Cloud computing and distributed systems.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Electronic commerce courselecture one. Pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine Learning_overview_presentation.pptx

Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level With Triggers

  • 2. Global Clusters Topologies Sig Narvaez Principal Solution Architect, MongoDB
  • 3. 3.15 Billion new internet users since the first MongoDB code commit
  • 4. Every year a US-sized population is coming online for the first time
  • 5. You don’t have to be a household name to meaningfully reach them
  • 6. Yes, a CDN can reach but users expect more
  • 7. Your users want… Interactive experiences Personalization Instant gratification Global Operational Data
  • 8. Your users want… Interactive experiences Personalization Instant gratification Global Operational Data You want… Happy users To stay ahead of competition Global awareness
  • 9. What does 100ms equate to?
  • 10. What does 100ms equate to? 1% drop in sales Missed chance to engage a customer meaningfully
  • 11. Global Latencies from AWS US West Americas US West – US East: 83ms EMEA US West – Frankfurt: 163ms LATAM US West – Sao Paulo: 190ms APAC US West – Singapore: 225ms
  • 16. Secondary Primary Frankfurt Frankfurt Application Driver US West Application Driver Singapore Application Driver EMEA Users Americas Users APAC Users Global Load Balancer Secondary US West Singapore
  • 17. Global Multi-Region Replication Single connection string globally Cross-region high availability Advantages Disadvantages All writes go to preferred region ⅔ of users experience > 100ms Fast reads require secondary read preference Asymmetrical deployment
  • 19. Frankfurt Application Driver US West Application Driver Singapore Application Driver EMEA Users Americas Users APAC Users Global Load Balancer Secondary Secondary Primary Frankfurt SingaporeUS West Secondary Secondary Primary Secondary Secondary Primary
  • 20. Cluster Per Region Easy today in MongoDB Atlas Independently scalable Advantages Disadvantages No global aggregation Application tier manages end user to connection string affinity
  • 21. Can we get the best of both worlds?
  • 22. Global Clusters with Global Writes
  • 26. Data includes location attribute { _id: 123, firstName: "Johannes", lastName: "Doe", activities: [ { title: "Skiing", attributes: ["downhill", "jumps"] }, { title: "Coding", attributes: ["mongodb", "python"] } ] } { _id: 123, location: "DE", firstName: "Johannes", lastName: "Doe", activities: [ { title: "Skiing", attributes: ["downhill", "jumps"] }, { title: "Coding", attributes: ["mongodb", "python"] } ] }
  • 27. Generally... an ISO 3166-1 country code e.g., US, DE, IN, or JP Or optionally and more specifically... an ISO-3166-2 subdivision code e.g., US-CA or US-NY Examples Description Potential Region Affinity US United States US East DE Germany Frankfurt IN India Mumbai JP Japan Tokyo US-CA California US West US-NY New York US East What is a location attribute?
  • 28. US West Application Driver mongos mongos••• z Repl0 Repl1 Repl2 US West Zone Shard Frankfurt Application Driver Singapore Application Driver mongos Americas Users EMEA Users APAC Users Global Load Balancer MongoDB Atlas Global Cluster Repl0 Repl1 Repl2 Frankfurt Zone Shard Repl0 Repl1 Repl2 Singapore Zone Shard ••• z Repl0 Repl1 Repl2 Config Servers
  • 29. Data includes location attribute { _id: 123, firstName: "Johannes", lastName: "Doe", activities: [ { title: "Skiing", attributes: ["downhill", "jumps"] }, { title: "Coding", attributes: ["mongodb", "python"] } ] } { _id: 123, location: "DE", firstName: "Johannes", lastName: "Doe", activities: [ { title: "Skiing", attributes: ["downhill", "jumps"] }, { title: "Coding", attributes: ["mongodb", "python"] } ] }
  • 30. US West Application Driver mongos mongos••• z Repl0 Repl1 Repl2 US West Zone Shard Frankfurt Application Driver Singapore Application Driver mongos Americas Users EMEA Users APAC Users Global Load Balancer MongoDB Atlas Global Cluster Repl0 Repl1 Repl2 Frankfurt Zone Shard Repl0 Repl1 Repl2 Singapore Zone Shard ••• z Repl0 Repl1 Repl2 Config Servers Repl0 Repl1 Repl2 Frankfurt Zone Shard
  • 32. MongoDB Atlas will be very opinionated... In the Data Explorer, you’ll be guided to set a shard key like {location : 1, <identifier> : 1} You’ll receive global-targeting query examples db.globalColl.findOne({ location : "XY", <identifier> : 123, ... })
  • 33. For example location and _id { _id: 123, location: "CA", firstName: "Jane", lastName: "Doe", activities: [ { title: "Mountaineering", attributes: ["glaciers"] }, { title: "Coding", attributes: ["java", "mongodb"] } ] }
  • 34. How are locations mapped to zones?
  • 35. Query routing without LATAM zone { location: {$in: [ 'BR-PE', 'BR-PA']} }
  • 36. Get ISO Country code from HTTP Request AWS – Lambda & CloudFront • headers['cloudfront-viewer-country’] *Limited to country https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-examples.html#lambda-examples-redirecting-examples Google Cloud –Functions • country: req.headers["x-appengine-country"] • region: req.headers["x-appengine-region"] https://cloud.google.com/appengine/docs/standard/go/reference/request-response-headers https://medium.com/mop-developers/free-ip-based-geolocation-with-google-cloud-functions-f92e20d47651 CloudFlare – Enable IP Geolocation • HTTP_CF_IPCOUNTRY header Akamai – EdgeScape (CDN) • country_code and region_code headers
  • 37. Provide a better experience to growing markets
  • 39. When should I add a Zone? If latency of complete request exceeds threshold? Not really – There are many layers contributing to the latency outside of Atlas Metrics in Atlas? Maybe – performance metrics Maybe – mongos logs – cross-reference IP against IP-GeoLocation DB / Service It’s beyond Atlas - A combination of: • Data Set growing from certain countries & sub-divisions Use Aggregation Framework, BI Connector or Spark Connector for Analytics • CDN / API Management Metrics: AWS CloudFront / API Gateway, Akamai, etc. • Planned Expansion: New features targeting specific markets
  • 41. Query routing with LATAM zone { location: {$in: [ 'BR-PE', 'BR-PA']} }
  • 42. Chunk Migration – adding LATAM zone
  • 44. NA West Application Driver ••• z Repl0 Repl1 Repl2 NA West Zone Shard mongos NA East EMEA APAC North Global Load Balancer MongoDB Atlas Global Cluster NA West South America APAC South NA East Application Driver z Repl0 Repl1 Repl2 NA East Zone Shard mongos South America Application Driver z Repl0 Repl1 Repl2 South America Zone Shard mongos EMEA Application Driver z Repl0 Repl1 Repl2 EMEA Zone Shard mongos APAC North Application Driver z Repl0 Repl1 Repl2 APAC North Zone Shard mongos APAC South Application Driver z Repl0 Repl1 Repl2 APAC South Zone Shard mongos••• ••• ••• •••
  • 46. Concise and global, it will look like Your driver will use this address to discover every mongos in the cluster globally Taking advantage of the MongoDB 3.6 driver support for SRV records … so you can deploy the same application code everywhere - symmetrically mongodb+srv://user:pass@globalCluster-rzeyq.mongodb.net
  • 47. Resolving SRV record to mongos’s Blog Post: https://www.mongodb.com/blog/post/mongodb-3-6-here-to-SRV-you-with-easier-replica-set-connections $ python mongodb_srv_records.py globalcluster-twijg.mongodb.net globalcluster-shard-00-00-twijg.mongodb.net:27016 globalcluster-shard-00-01-twijg.mongodb.net:27016 globalcluster-shard-00-02-twijg.mongodb.net:27016 globalcluster-shard-01-00-twijg.mongodb.net:27016 globalcluster-shard-01-01-twijg.mongodb.net:27016 globalcluster-shard-01-02-twijg.mongodb.net:27016 globalcluster-shard-02-00-twijg.mongodb.net:27016 globalcluster-shard-02-01-twijg.mongodb.net:27016 globalcluster-shard-02-02-twijg.mongodb.net:27016 globalcluster-shard-03-00-twijg.mongodb.net:27016 globalcluster-shard-03-01-twijg.mongodb.net:27016 globalcluster-shard-03-02-twijg.mongodb.net:27016 globalcluster-twijg.mongodb.net: "authSource=admin"
  • 48. An even better user experience?
  • 49. What if I want low latency global reads?
  • 50. What if I want low latency global reads?
  • 51. What if I want low latency global reads?
  • 52. Where this is going and limits
  • 53. Massive reach MongoDB Atlas • in-country regions for 27% of the world population • with a much higher percent served by regions in nearby countries Available in 56 global cloud regions • AWS: 15 regions (38 availability zones) • Azure: 26 regions (26 availability zones w/ 60 Fault Domains) • GCP: 15 regions (38 Availability zones)
  • 54. Africa • S. Africa announced by Azure; a long way from most of Africa’s population, however • Biggest economies in Africa: Nigeria, South Africa, Egypt; with Ethiopia now the fastest growing Middle East • We’ll see China • It’s complicated... There are gaps Russia • It’s also complicated… • Frankfurt remains best bet but also Finland on Google Cloud Special / Government / Compliance contexts
  • 55. But MongoDB runs everywhere Over time the entire world will be well served by major cloud infrastructure You can always run your own MongoDB outside of where the big public cloud • MongoDB Ops Manager / MongoDB Cloud Manager • Live Migrate to MongoDB Atlas when ready So you can have a seamless development experience in any context
  • 57. 2030 Projection GDP & relative position compared with today 1 China ↑ 17 Spain ↓ 2 United States ↓ 18 Canada ↓ 3 India ↑↑↑↑ 19 Egypt ↑↑↑ 4 Japan ↓ 20 Pakistan ↑↑↑ 5 Indonesia ↑↑↑ 21 Nigeria ↑↑ 6 Russia ↑ 22 Thailand ↑↑ 7 Germany ↓ 23 Australia ↓ 8 Brazil ↑ 24 Philippines ↑↑ 9 Mexico ↑ 25 Malaysia ↑↑ 10 United Kingdom ↓ 26 Poland ↓ 11 France ↓ 27 Argentina ↓ 12 Turkey ↑ 28 Bangladesh ↑↑↑ 13 Saudi Arabia ↑↑ 29 Vietnam ↑↑↑ 14 South Korea ↓ 30 South Africa ↑↑ 15 Italy ↓ 31 Colombia ↑↑ 16 Iran ↑↑ 32 Netherlands ↓
  • 58. You can go global incrementally
  • 59. Path to Global Over Time 1. Cluster – Single Region ← deploy today for free on Atlas ○ Focus on finding traction ○ Scale up when needed in a few minutes on Atlas
  • 60. Path to Global Over Time 1. Cluster – Single Region ← deploy today for free on Atlas ○ Focus on finding traction ○ Scale up when needed in a few minutes on Atlas 2. Cluster – Multi Region HA ○ Get your application HA as well ○ Scale up when needed in a few minutes on Atlas
  • 61. Path to Global Over Time 1. Cluster – Single Region ← deploy today for free on Atlas ○ Focus on finding traction ○ Scale up when needed in a few minutes on Atlas 2. Cluster – Multi Region HA ○ Get your application HA as well ○ Scale up when needed in a few minutes on Atlas 3. Cluster – add Global Read Regions ○ Route users to nearby application instance; use secondary reads ○ Scale up when needed in a few minutes on Atlas
  • 62. Path to Global Over Time 1. Cluster – Single Region ← deploy today for free on Atlas ○ Focus on finding traction ○ Scale up when needed in a few minutes on Atlas 2. Cluster – Multi Region HA ○ Get your application HA as well ○ Scale up when needed in a few minutes on Atlas 3. Cluster – add Global Read Regions ○ Route users to nearby application instance; use secondary reads ○ Scale up when needed in a few minutes on Atlas 4. Enable Global Writes ○ Add a second write zone ○ Add location attribute to your data & shard your global collections in the Atlas UI
  • 63. Path to Global Over Time 1. Cluster – Single Region ← deploy today for free on Atlas ○ Focus on finding traction ○ Scale up when needed in a few minutes on Atlas 2. Cluster – Multi Region HA ○ Get your application HA as well ○ Scale up when needed in a few minutes on Atlas 3. Cluster – add Global Read Regions ○ Route users to nearby application instance; use secondary reads ○ Scale up when needed in a few minutes on Atlas 4. Enable Global Writes ○ Add a second write zone ○ Add location attribute to your data & shard your global collections in the Atlas UI 5. Expand Reach of Global Cluster ○ Add more write zones ○ Or add shards to existing zones ○ Scale up any time
  • 64. And you can follow your users...
  • 65. Now go out and reach those 4+ billion internet users
  • 67. Sigfrido “Sig” Narvaez Principal Solution Architect, MongoDB sig@mongodb.com