SlideShare a Scribd company logo
#MDBW17
An Engineering Journey through Constraints and
Portability
BUILDING THE
REAL TIME PERFORMANCE
PANEL
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
#MDBW17
Highest Granularity: 10 seconds
#MDBW17
Refresh Rate: 1 minute
#MDBW17
A BETTER EXPERIENCE
• 10x Higher Granularity
• Live Experience
#MDBW17
CHALLENGES
• Bigger
• Faster
ACT I
ARCHITECTURE
#MDBW17
GETTING METRIC DATA FROM MONGODB
TO THE CLOUD
Understanding Our Architecture
#MDBW17
UNDERSTANDING OUR ARCHITECTURE
Application
Server
DB
DB
Client
Customer MongoDB
#MDBW17
UNDERSTANDING OUR ARCHITECTURE
Application
Server
DB
DB
Client
Customer Network
#MDBW17
UNDERSTANDING OUR ARCHITECTURE
DB
DB
DB
Client
Customer Network
Agent
Application
Server
#MDBW17
UNDERSTANDING OUR ARCHITECTURE
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
DB
Client
Customer Network
Agent
#MDBW17
GETTING METRIC DATA FROM MONGODB
TO THE CLOUD
Understanding Our Architecture
Ideal Real Time Setup
#MDBW17
IDEAL REAL TIME SETUP
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
DB
Client
Customer Network
Agent
I have data!
Pub
Sub
I have data!
#MDBW17
HTTP VS. WEBSOCKETS
HTTP 1.1 Websockets
Request/Response
Request from Client
Client can push, Server cannot
Stateless
Two way connection
Initial Request from Client
Server and Client can push
Stateful
#MDBW17
Pub
Sub
WEBSOCKETS WITH LOAD BALANCER
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
Client
Customer Network
Agent
#MDBW17
GETTING METRIC DATA FROM MONGODB
TO THE CLOUD
Understanding Our Architecture
Ideal Real Time Setup
The Reality
#MDBW17
Pub
Sub
ATLAS PROCESS LOCATION
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
Client
Customer Network
Agent
#MDBW17
Pub
Sub
CLOUD MANAGER PROCESS LOCATION
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
Client
Customer Network
Agent
#MDBW17
Pub
Sub
OPS MANAGER PROCESS LOCATION
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
Client
Customer Network
Agent
L
O
A
D
B
A
L
A
N
C
E
R
#MDBW17
GETTING METRIC DATA FROM MONGODB
TO THE CLOUD
Understanding Our Architecture
Ideal Real Time Setup
The Reality
Our Solution
#MDBW17
SOLUTION: POLLING
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
DB
Client
Customer Network
Agent
#MDBW17
TRADITIONAL POLLING
Server ClientAgent
Got my data?Hm, nope How about
now?
Nope, nada
Hey, here’s
the data!
And now?
Oh, yeah!
Here it is!
#MDBW17
LONG
POLLING
Server ClientAgent
Got my data?
Hey, here’s
the data!
It’s not here.
Nap time!
Still not here.
Nap time!
Oh, yeah!
Here it is!
#MDBW17
SOLUTION: LONG POLLING
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
DB
Client
Customer Network
Agent
ACT II
OPTIMIZATION
#MDBW17
HOW DO WE MAKE THIS...
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
DB
Client
Customer Network
Agent
#MDBW17
Pub
Sub
...BEHAVE LIKE THIS?
L
O
A
D
B
A
L
A
N
C
E
R
Application
Server
Application
Server
DB
DB
Client
Customer Network
Agent
#MDBW17
HOW TO MAKE "REAL TIME" MEAN "REAL
TIME"
Time to First Point
#MDBW17
PREVIOUS POLLING
Server ClientAgent
t = 0
t = 30
#MDBW17
NEW POLLING
Server ClientAgent
t = 0
t = 30
#MDBW17
AGENT INACTIVE/ACTIVE
Inactive
Active
Agent
Inactive 30s Polling
Active 1s Polling
#MDBW17
TIME TO FIRST POINT
30s
Agent
Polling
+ 100ms
Network
Latency
+1s
Second
Point
100ms
Network
Latency
+
#MDBW17
THREE CONNECTION SOLUTION
• Agent Polling
• Client Long Polling
• Client Heartbeat
#MDBW17
AGENT AND CLIENT STATES
Inactive
ActiveDormant
Agent Data Heartbeat
Inactive 30s Polling Not Polling Not Polling
Active 1s Polling Long Polling 30s Polling
Dormant 1s Polling Not Polling 30s Polling
#MDBW17
HOW TO MAKE "REAL TIME" MEAN "REAL
TIME"
Time to First Point
Clock Skew
#MDBW17
NAIVE APPROACH
Server ClientAgent
t = 0
t = 3000
t = 2000
t = 1000
sampleTime = 1500
sampleTime = 2500
Got anything with
sampleTime > 1200?
Got anything with
sampleTime > 2200?
#MDBW17
CLOCK SKEW
Server ClientAgent
t = 0
t = 3000
t = 2000
t = 1000
#MDBW17
CLOCK SKEW
Server ClientAgent
t = 0
t = 3000
t = 2000
t = 1000
sampleTime = 800
sampleTime = 1800
Got anything with
sampleTime > 1200?
#MDBW17
SOLUTION
Server ClientAgent
t = 0
t = 3000
t = 2000
t = 1000
sampleTime = 800
sampleTime = 1800
Got anything?
sampleTime = 800
Got anything with
sampleTime > 800?
#MDBW17
HOW TO MAKE "REAL TIME" MEAN "REAL
TIME"
Time to First Point
Clock Skew
Respond ASAP
#MDBW17
RESPOND ASAP
Server ClientAgent
t = 0
t = 2
t = 1
#MDBW17
RESPOND ASAP
Server ClientAgent
t = 0
t = 2
t = 1
#MDBW17
Last Point was at t
= 1020
Add 1000ms for
agent
Eh, 100ms for db
time sounds good
RESPOND
ASAP
Server ClientAgent
t = 0
t = 3000
t = 2000
t = 1000 tReceived = 1020
1020
1000
+ 100
2120
What time is it?
Oh, 1600 so…
2120
-1600
520
Sleep for 520msNailed it!
tReceived = 1020
#MDBW17
HOW TO MAKE "REAL TIME" MEAN "REAL
TIME"
Time to First Point
Clock Skew
Respond ASAP
Keep it Smooth
#MDBW17
#MDBW17
TIMING OUR "SWING"
• Ball = Data
• Bat = Animation
#MDBW17
TOO FAST
#MDBW17
TOO SLOW
#MDBW17
SOLUTION?
• Rolling Average
• Assume 1000ms
• Track time
• Average actual time
#MDBW17
#MDBW17
JUST RIGHT
#MDBW17
JUST RIGHT
#MDBW17
HOW WE DID IT
• Process
• Work inside constraints
• Optimize, optimize, optimize!
• Smooth it over on the client
#MDBW17
Cloud Software Engineer, MongoDB
JONATHAN BALSANO
@jrbalsano

More Related Content

PPTX
Sizing MongoDB Clusters
PPTX
Introducing Stitch
PPTX
Managing Cloud Security Design and Implementation in a Ransomware World
PPTX
Using Aggregation for Analytics
PPTX
Common Cluster Configuration Pitfalls
PPTX
Practical Design Patterns for Building Applications Resilient to Infrastructu...
PPTX
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
PPTX
Creating Highly-Available MongoDB Microservices with Docker Containers and Ku...
Sizing MongoDB Clusters
Introducing Stitch
Managing Cloud Security Design and Implementation in a Ransomware World
Using Aggregation for Analytics
Common Cluster Configuration Pitfalls
Practical Design Patterns for Building Applications Resilient to Infrastructu...
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
Creating Highly-Available MongoDB Microservices with Docker Containers and Ku...

What's hot (20)

PPTX
Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB
PPTX
Scaling MongoDB to a Million Collections
PPTX
It's a Dangerous World
PPTX
Advanced Schema Design Patterns
PPTX
Securing Your Enterprise Web Apps with MongoDB Enterprise
PPTX
Power Real Estate Property Analytics with MongoDB + Spark
PPTX
Managing Multi-Tenant SaaS Applications at Scale
PDF
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
PDF
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
PDF
Containerizing MongoDB with kubernetes
PPTX
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PPTX
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
PDF
MongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep Dive
PPTX
Bye Bye Legacy: Simplifying the Journey
PDF
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
PDF
Engineering an Encrypted Storage Engine
PDF
Mongo DB Monitoring - Become a MongoDB DBA
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
Powering Microservices with Docker, Kubernetes, Kafka, and MongoDB
Scaling MongoDB to a Million Collections
It's a Dangerous World
Advanced Schema Design Patterns
Securing Your Enterprise Web Apps with MongoDB Enterprise
Power Real Estate Property Analytics with MongoDB + Spark
Managing Multi-Tenant SaaS Applications at Scale
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
MongoDB .local Bengaluru 2019: The Journey of Migration from Oracle to MongoD...
Containerizing MongoDB with kubernetes
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
MongoDB .local Bengaluru 2019: MongoDB Atlas Data Lake Technical Deep Dive
Bye Bye Legacy: Simplifying the Journey
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
Engineering an Encrypted Storage Engine
Mongo DB Monitoring - Become a MongoDB DBA
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB SoCal 2020: MongoDB Atlas Jump Start
Ad

Similar to Building the Real-Time Performance Panel (20)

PDF
Performance Oriented Design
PDF
Con5133
PPT
Chapter - 1 Introduction to networking (3).ppt
PPTX
Scaling Systems: Architectures that Grow
PDF
Tools, Tips and Techniques for Developing Real-time Apps. Phil Leggetter
PDF
From Data Push to WebSockets
PPTX
Designing Cloud Products
PPTX
Performance Tipping Points - Hitting Hardware Bottlenecks
PDF
Bottlenecks exposed web app db servers
PDF
Big datadc skyfall_preso_v2
PDF
Capacity Planning for fun & profit
PPT
Ch2_Ed7_Network_Applications.ppt
PDF
OSCON Data 2011 -- NoSQL @ Netflix, Part 2
ODP
Building highly available architectures with WAS and MQ
PDF
8 application servers_v2
PDF
From Push Technology to Real-Time Messaging and WebSockets
PDF
Building Your Own MongoDB as a Service Offering
PDF
Enable business continuity and high availability through active active techno...
PDF
L20 Scalability
PDF
Dealing with Enterprise Level Data
Performance Oriented Design
Con5133
Chapter - 1 Introduction to networking (3).ppt
Scaling Systems: Architectures that Grow
Tools, Tips and Techniques for Developing Real-time Apps. Phil Leggetter
From Data Push to WebSockets
Designing Cloud Products
Performance Tipping Points - Hitting Hardware Bottlenecks
Bottlenecks exposed web app db servers
Big datadc skyfall_preso_v2
Capacity Planning for fun & profit
Ch2_Ed7_Network_Applications.ppt
OSCON Data 2011 -- NoSQL @ Netflix, Part 2
Building highly available architectures with WAS and MQ
8 application servers_v2
From Push Technology to Real-Time Messaging and WebSockets
Building Your Own MongoDB as a Service Offering
Enable business continuity and high availability through active active techno...
L20 Scalability
Dealing with Enterprise Level Data
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: 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 .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: 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...
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
PDF
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
PDF
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
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 .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: 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...
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Adéo @MongoDB : MongoDB Atlas & Leroy Merlin : et ...

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx

Building the Real-Time Performance Panel