SlideShare a Scribd company logo
1 of 36
Download to read offline
Turkeys vs. Swans:
Building Antifragile IT Systems
for Disaster Response
MongoDB World 2019
Imanuel Portalatín
iportalatin@mitre.org
Approved for Public Release; Distribution Unlimited. Public Release Case Number 19-1264
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
About MITRE
• We work across the whole of government to tackle difficult problems
that challenge the safety, stability and well-being of our nation
through:
• Operation of Federally Funded R&D Centers (FFRDCs)
• Public-private partnerships
• We have a unique vantage point working across federal, state and
local governments, as well as industry and academia
• We work in the public interest to:
• Discover new possibilities and create unexpected opportunities
• Lead by pioneering together for public good to bring innovative ideas into
existence in national security and the public sector
Our mission-driven team is dedicated to solving problems for a safer world.
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Agenda
• Black Swans, Turkeys and Antifragility
• OLAF Prototype Overview
• Lessons Learned
• Ansible MongoDB Deployment
• Tracking, Updating and Sharing Geo-Tagged Data
• OLAF Live Demo
• What’s Next?
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Black Swans, Turkeys and Antifragility
An Introduction
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://www.flickr.com/photos/noaasatellites/37224066361
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: http://www.coastal.jp/tsunami2011/
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Photo By: Michael C. Barton, Mass Communication Specialist 2nd Class, U.S. Navy, Released (100119-N-8878B-322)
Retrieved From: http://www.navy.mil/view_image.asp?id=80340
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://www.maxpixel.net/Bad-Weather-Storm-Highway-Blizzard-Snow-Driving-2053388
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://pixabay.com/photos/black-swan-bird-nature-water-1034891/
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://www.pexels.com/photo/boy-crystal-ball-magic-magician-369384/
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Turkey Problem:
“A turkey is fed by a butcher all its
life so every day that passes confirms
to the turkey and its team of analysts
that butchers love turkeys with
increased statistical confidence.
That is until a few days before
Thanksgiving when there is a big
surprise that the turkey never saw
coming.”
Retrieved From: https://www.maxpixel.net/Free-Range-Turkeys-Plumage-Birds-Poultry-2799462
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://pxhere.com/en/photo/1334293
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Retrieved From: https://www.dreamstime.com/stock-photo-exponential-growth-image18365370#res22058481
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Promoting Antifragility
• Follow simple heuristics (rules of thumb)
• Take small risks with high payoff potential
• Avoid risks that could lead to catastrophic outcomes
• Build in redundancy and multiple layers
• Keep your options open (optionality)
• Use small incremental steps
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
MongoDB and Antifragility
• Document Database
• Dynamic schema supports fluent polymorphism
• Documents (i.e. objects) correspond to native data types in many
programming languages
• High Availability (Replica Sets)
• Automatic failover
• Data redundancy
• Horizontal Scalability
• Sharding distributes data across a cluster of machines
• Compatible with commodity servers and virtualized elastic environments
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Offline Application Facilitation (OLAF)
Prototype Overview
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Problem
• Communication networks are
devastated by regional disasters
• Effective response requires close
coordination between diverse relief
agencies
• Backup communications cannot
handle the volume of data generated
during these disasters
Experts consider communications a basic necessity, like food and water!
Photo By: Michael C. Barton, Mass Communication Specialist 2nd Class, U.S. Navy, Released (100119-N-8878B-322)
Retrieved From: http://www.navy.mil/view_image.asp?id=80340
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
1. Special software is automatically
installed on inexpensive low-power
computers, called edge gateways
2. Edge gateways automatically relay
data through alternate channels
when main networks are down
3. First responders and the public
connect to edge gateways via local
Wi-Fi networks on their own
personal devices
4. Critical information is uploaded via
gateways with active connection to
the internet, called master nodes
5. Up-to-date information is made
available via online services,
improving command & control
capabilities and public awareness
Idea
Retrieved From: https://www.maxpixel.net/Computer-Pi-Technology-Raspberry-
Pi-Electronics-1719219
Photo By: © Arne9001 | Dreamstime.com
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
OLAF Architecture
Affected
Population
First Responders
Command &
Control
Relief
Organizations
General Public
Local Wi-Fi
Edge Gateway
Containerized
app
Local data
Mesh Protocol
Update Agent
Master Node
Automated
Deployment
Shared data
Mesh Protocol
Update Server
DRMS/GeoQ
Other Services
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Lessons Learned
Ansible MongoDB Deployment
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Benefits of Ansible
• Lightweight agent-less IT automation tool
• Designed for simplicity and ease of use
• Minimum moving parts
• Uses SSH for secure transport
• Only depends on Python and OpenSSH
• Easy to understand template language (YAML)
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Ansible Inventory
all:
vars:
ansible_user: olaf
ansible_ssh_private_key_file: ~/.ssh/mesh_node
ansible_become: yes
ansible_become_pass: olaf
children:
master_nodes:
hosts:
master:
ansible_host: 192.168.0.101
mesh_nodes:
hosts:
mesh_node1:
ansible_host: 192.168.0.1
Variables for All Hosts
Hosts and Groups
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Dockerized MongoDB Deployment
---
- name: Deploy MonogDB to all hosts
hosts: all
tasks:
- name: Start Mongo DB container
docker_container:
name: database
image: mongo
state: started
recreate: yes
published_ports:
- 27017:27017
register: docker_container
$ ansible_playbook mongo_deploy.yml –i hosts
mongo_deploy.yml:
Command Line:
Target Hosts or Groups
Tasks to be run on Host
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Node.js App Configuration
- name: Configure Node.js app
hosts: mesh_node
vars:
- mongoConfig:
url: "mongodb://localhost:27017/"
tasks:
- name: Get MongoDB ip from docker_start output
set_fact:
mongodb_ip: "{{ docker_container.ansible_facts.docker_container.NetworkSettings.IPAddress }}”
when: docker_container is defined
- name: Override default MongoDB config
set_fact:
mongoConfig: "{{ mongoConfig | combine({ 'url' : 'mongodb://' + mongodb_ip + '/' }) }}”
when: mongodb_ip is defined
- name: Write Javascript configuration file
copy:
content: "module.exports = {{ appMongoConfig | to_nice_json }}"
dest: /opt/olaf/webapp/config/mongoConfig.js
mongo_deploy.yml (continued):
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Node.js App Configuration (Continued)
module.exports = {
url: "mongodb://172.17.0.2:27017/"
}
./config/mongoConfig.js (auto-generted):
'use strict’;
const mongoConfig = require('./config/mongoConfig’);
MongoClient.connect(mongoConfig.url, function(err, client) {
assert.equal(null, err);
…
});
app.js:
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Lessons Learned
Tracking, Updating and Sharing Geo-Tagged Data
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Geo-Marker Document
{
"_id":"5b0dcb214ff9980016c119f6",
"type":"Feature",
"geometry": {
"type":"Point",
"coordinates": [
-66.03899002075195,
18.398795619534134
]
},
"properties": {
"name":"fire”
}
}
MongoDB ObjectId
GeoJSON Data Fields
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Creating 2dsphere Index in Node.js
…
MongoClient.connect(mongoConfig.url, function(err, client) {
assert.equal(null, err);
const db = client.db(mongoConfig.dbName);
const collection = db.collection(mongoConfig.makerCollection);
collection.createIndex( { “geometry.coordinates” : “2dsphere” }, function(err, result) {
if (err) {
console.log('Error while creating indexes: '+err);
} else {
console.log('All 2dsphere indexes were created successfully!');
client.close();
}});
});
server.js:
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Tracking Updates with MongoDB ObjectID
…
const ObjectID = require('mongodb').ObjectID;
var lastObjectId = ObjectID.createFromTime(0);
setInterval(function() {
var objectId = new ObjectID();
let query = { '$and' : [ { '_id' : { '$gte' : lastObjectId } }, {'_id' : { '$lt' : objectId } } ] };
MongoClient.connect(mongoConfig.url, function(err, client) {
assert.equal(null, err);
const db = client.db(mongoConfig.dbName);
db.collection(col).find(query).toArray(function(err,docs) {
// Process query results …
lastObjectId = objectId;
});
});
},delay);
update.js:
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Graceful Recovery after Disconnect
…
setInterval(function() {
var objectId = new ObjectID();
let query = { '$and' : [ { '_id' : { '$gte' : lastObjectId } }, {'_id' : { '$lt' : objectId } }, { update : { '$exists' : false } } ] };
MongoClient.connect(mongoConfig.url, function(err, client) {
assert.equal(null, err);
const db = client.db(mongoConfig.dbName);
db.collection(col).find(query).toArray(function(err,docs) {
// Process query results …
db.collection(col).update(query, { '$set’ : { 'update’ : 1 } }, { 'multi' : true }, function(err,updated) {
lastObjectId = objectId;
});
});
});
},delay);
update.js:
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Sharing Geo-Tagged Data
DRMS/GeoQ
OLAF Master Node
Automated
Deployment
Shared data
Mesh Protocol
Update Server
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0, 0]
},
"properties": {
"popupContent": "flood"
}
}
]
}
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Sharing FeatureCollection over HTTP
…
router.route('/getMarkers').get(function(req,res) {
var query = getQuery(req);
var filter = { '_id' : 0 };
…
collection.find(query,filter).toArray(function(err, docs) {
res.setHeader('content-type',"application/geo+json");
// Build the GeoJSON FeatureCollection object
var featureCollection = {
'type' : 'FeatureCollection',
'features’ : docs
}
res.end(JSON.stringify(featureCollection));
});
});
server.js:
Process URL Query String
Query Markers Collection
Set HTTP Response MIME Type
Package Feature Array in
FeatureCollection Object
Remove ObjectID from Results
Send HTTP Response
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
Live Demo
OLAF Prototype
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
What’s Next?
OLAF Prototype
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
1. OLAF Prototype and AWS Greengrass used to deploy
trained ML models and mesh network software to
edge gateways hosted on Raspberry Pi’s.
2. UAVs with on-board OLAF gateways
can transmit overhead imagery and
relay data from other sensors.
4. Local inference on human pose estimation
models and custom analytics at edge
gateways classify images of victims that
are trapped or need of immediate help.
3. Edge gateways are
deployed to autonomous
platforms able to operate
in hard to access and
hazardous areas.
5. Geotagged images of
victims trapped or in
need of assistance are
sent to OLAF master
nodes at forward
command center and
displayed at DMRS
console.
DRMS Console
6. Analysts use DRMS to
validate automatic
classification and
identify cells where
resources need to be
deployed immediately.
©2019 The MITRE Corporation. ALL RIGHTS RESERVED.

More Related Content

Similar to MongoDB World 2019: Turkeys vs. Swans: Building Antifragile IT Systems for Disaster Response

Protecting data privacy in analytics and machine learning ISACA London UK
Protecting data privacy in analytics and machine learning ISACA London UKProtecting data privacy in analytics and machine learning ISACA London UK
Protecting data privacy in analytics and machine learning ISACA London UK
Ulf Mattsson
 

Similar to MongoDB World 2019: Turkeys vs. Swans: Building Antifragile IT Systems for Disaster Response (20)

MITRE ATT&CKcon 2.0: ATT&CK Updates - Sightings; John Wunder, MITRE
MITRE ATT&CKcon 2.0: ATT&CK Updates - Sightings; John Wunder, MITREMITRE ATT&CKcon 2.0: ATT&CK Updates - Sightings; John Wunder, MITRE
MITRE ATT&CKcon 2.0: ATT&CK Updates - Sightings; John Wunder, MITRE
 
ATT&CKing Your Adversaries - Operationalizing cyber intelligence in your own ...
ATT&CKing Your Adversaries - Operationalizing cyber intelligence in your own ...ATT&CKing Your Adversaries - Operationalizing cyber intelligence in your own ...
ATT&CKing Your Adversaries - Operationalizing cyber intelligence in your own ...
 
Understanding IoT Security: How to Quantify Security Risk of IoT Technologies
Understanding IoT Security: How to Quantify Security Risk of IoT TechnologiesUnderstanding IoT Security: How to Quantify Security Risk of IoT Technologies
Understanding IoT Security: How to Quantify Security Risk of IoT Technologies
 
Privacy preserving computing and secure multi-party computation ISACA Atlanta
Privacy preserving computing and secure multi-party computation ISACA AtlantaPrivacy preserving computing and secure multi-party computation ISACA Atlanta
Privacy preserving computing and secure multi-party computation ISACA Atlanta
 
Protecting data privacy in analytics and machine learning ISACA London UK
Protecting data privacy in analytics and machine learning ISACA London UKProtecting data privacy in analytics and machine learning ISACA London UK
Protecting data privacy in analytics and machine learning ISACA London UK
 
IAM for mobile and BYOD
IAM for mobile and BYODIAM for mobile and BYOD
IAM for mobile and BYOD
 
FIRST CTI Symposium: Turning intelligence into action with MITRE ATT&CK™
FIRST CTI Symposium: Turning intelligence into action with MITRE ATT&CK™FIRST CTI Symposium: Turning intelligence into action with MITRE ATT&CK™
FIRST CTI Symposium: Turning intelligence into action with MITRE ATT&CK™
 
Neo Automation Series Part 1 - Primer
Neo Automation Series Part 1 - PrimerNeo Automation Series Part 1 - Primer
Neo Automation Series Part 1 - Primer
 
Law seminars intl cybersecurity in the power industry
Law seminars intl cybersecurity in the power industryLaw seminars intl cybersecurity in the power industry
Law seminars intl cybersecurity in the power industry
 
The Inconvenient Truth About API Security
The Inconvenient Truth About API SecurityThe Inconvenient Truth About API Security
The Inconvenient Truth About API Security
 
Harbor Research: IoT Investment Report - June 2017
Harbor Research: IoT Investment Report - June 2017Harbor Research: IoT Investment Report - June 2017
Harbor Research: IoT Investment Report - June 2017
 
BYOD: Be your own device?
BYOD: Be your own device?BYOD: Be your own device?
BYOD: Be your own device?
 
Proteja sus datos en cualquier servicio Cloud y Web de forma unificada
Proteja sus datos en cualquier servicio Cloud y Web de forma unificadaProteja sus datos en cualquier servicio Cloud y Web de forma unificada
Proteja sus datos en cualquier servicio Cloud y Web de forma unificada
 
Extreme Automation: The Emergence of RPA and AI for Treasury
Extreme Automation: The Emergence of RPA and AI for TreasuryExtreme Automation: The Emergence of RPA and AI for Treasury
Extreme Automation: The Emergence of RPA and AI for Treasury
 
FIWARE Global Summit - FIWARE For Smart Agrifood - An Open Integration Approach
FIWARE Global Summit - FIWARE For Smart Agrifood - An Open Integration ApproachFIWARE Global Summit - FIWARE For Smart Agrifood - An Open Integration Approach
FIWARE Global Summit - FIWARE For Smart Agrifood - An Open Integration Approach
 
A Diet of Poisoned Fruit: Designing Implants & OT Payloads for ICS Embedded D...
A Diet of Poisoned Fruit: Designing Implants & OT Payloadsfor ICS Embedded D...A Diet of Poisoned Fruit: Designing Implants & OT Payloadsfor ICS Embedded D...
A Diet of Poisoned Fruit: Designing Implants & OT Payloads for ICS Embedded D...
 
Aalto cyber-10.4.18
Aalto cyber-10.4.18Aalto cyber-10.4.18
Aalto cyber-10.4.18
 
The UK's Code of Practice for Security in Consumer IoT Products and Services ...
The UK's Code of Practice for Security in Consumer IoT Products and Services ...The UK's Code of Practice for Security in Consumer IoT Products and Services ...
The UK's Code of Practice for Security in Consumer IoT Products and Services ...
 
IOT - Internet of Things - September 2017
IOT - Internet of Things - September 2017IOT - Internet of Things - September 2017
IOT - Internet of Things - September 2017
 
Io t for_scm
Io t for_scmIo t for_scm
Io t for_scm
 

More from MongoDB

More from 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...
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

MongoDB World 2019: Turkeys vs. Swans: Building Antifragile IT Systems for Disaster Response

  • 1. Turkeys vs. Swans: Building Antifragile IT Systems for Disaster Response MongoDB World 2019 Imanuel Portalatín iportalatin@mitre.org Approved for Public Release; Distribution Unlimited. Public Release Case Number 19-1264 ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 2. About MITRE • We work across the whole of government to tackle difficult problems that challenge the safety, stability and well-being of our nation through: • Operation of Federally Funded R&D Centers (FFRDCs) • Public-private partnerships • We have a unique vantage point working across federal, state and local governments, as well as industry and academia • We work in the public interest to: • Discover new possibilities and create unexpected opportunities • Lead by pioneering together for public good to bring innovative ideas into existence in national security and the public sector Our mission-driven team is dedicated to solving problems for a safer world. ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 3. Agenda • Black Swans, Turkeys and Antifragility • OLAF Prototype Overview • Lessons Learned • Ansible MongoDB Deployment • Tracking, Updating and Sharing Geo-Tagged Data • OLAF Live Demo • What’s Next? ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 4. Black Swans, Turkeys and Antifragility An Introduction ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 6. ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 7. Retrieved From: http://www.coastal.jp/tsunami2011/ ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 8. Photo By: Michael C. Barton, Mass Communication Specialist 2nd Class, U.S. Navy, Released (100119-N-8878B-322) Retrieved From: http://www.navy.mil/view_image.asp?id=80340 ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 12. Turkey Problem: “A turkey is fed by a butcher all its life so every day that passes confirms to the turkey and its team of analysts that butchers love turkeys with increased statistical confidence. That is until a few days before Thanksgiving when there is a big surprise that the turkey never saw coming.” Retrieved From: https://www.maxpixel.net/Free-Range-Turkeys-Plumage-Birds-Poultry-2799462 ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 13. Retrieved From: https://pxhere.com/en/photo/1334293 ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 15. Promoting Antifragility • Follow simple heuristics (rules of thumb) • Take small risks with high payoff potential • Avoid risks that could lead to catastrophic outcomes • Build in redundancy and multiple layers • Keep your options open (optionality) • Use small incremental steps ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 16. MongoDB and Antifragility • Document Database • Dynamic schema supports fluent polymorphism • Documents (i.e. objects) correspond to native data types in many programming languages • High Availability (Replica Sets) • Automatic failover • Data redundancy • Horizontal Scalability • Sharding distributes data across a cluster of machines • Compatible with commodity servers and virtualized elastic environments ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 17. Offline Application Facilitation (OLAF) Prototype Overview ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 18. Problem • Communication networks are devastated by regional disasters • Effective response requires close coordination between diverse relief agencies • Backup communications cannot handle the volume of data generated during these disasters Experts consider communications a basic necessity, like food and water! Photo By: Michael C. Barton, Mass Communication Specialist 2nd Class, U.S. Navy, Released (100119-N-8878B-322) Retrieved From: http://www.navy.mil/view_image.asp?id=80340 ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 19. 1. Special software is automatically installed on inexpensive low-power computers, called edge gateways 2. Edge gateways automatically relay data through alternate channels when main networks are down 3. First responders and the public connect to edge gateways via local Wi-Fi networks on their own personal devices 4. Critical information is uploaded via gateways with active connection to the internet, called master nodes 5. Up-to-date information is made available via online services, improving command & control capabilities and public awareness Idea Retrieved From: https://www.maxpixel.net/Computer-Pi-Technology-Raspberry- Pi-Electronics-1719219 Photo By: © Arne9001 | Dreamstime.com ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 20. OLAF Architecture Affected Population First Responders Command & Control Relief Organizations General Public Local Wi-Fi Edge Gateway Containerized app Local data Mesh Protocol Update Agent Master Node Automated Deployment Shared data Mesh Protocol Update Server DRMS/GeoQ Other Services ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 21. Lessons Learned Ansible MongoDB Deployment ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 22. Benefits of Ansible • Lightweight agent-less IT automation tool • Designed for simplicity and ease of use • Minimum moving parts • Uses SSH for secure transport • Only depends on Python and OpenSSH • Easy to understand template language (YAML) ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 23. Ansible Inventory all: vars: ansible_user: olaf ansible_ssh_private_key_file: ~/.ssh/mesh_node ansible_become: yes ansible_become_pass: olaf children: master_nodes: hosts: master: ansible_host: 192.168.0.101 mesh_nodes: hosts: mesh_node1: ansible_host: 192.168.0.1 Variables for All Hosts Hosts and Groups ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 24. Dockerized MongoDB Deployment --- - name: Deploy MonogDB to all hosts hosts: all tasks: - name: Start Mongo DB container docker_container: name: database image: mongo state: started recreate: yes published_ports: - 27017:27017 register: docker_container $ ansible_playbook mongo_deploy.yml –i hosts mongo_deploy.yml: Command Line: Target Hosts or Groups Tasks to be run on Host ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 25. Node.js App Configuration - name: Configure Node.js app hosts: mesh_node vars: - mongoConfig: url: "mongodb://localhost:27017/" tasks: - name: Get MongoDB ip from docker_start output set_fact: mongodb_ip: "{{ docker_container.ansible_facts.docker_container.NetworkSettings.IPAddress }}” when: docker_container is defined - name: Override default MongoDB config set_fact: mongoConfig: "{{ mongoConfig | combine({ 'url' : 'mongodb://' + mongodb_ip + '/' }) }}” when: mongodb_ip is defined - name: Write Javascript configuration file copy: content: "module.exports = {{ appMongoConfig | to_nice_json }}" dest: /opt/olaf/webapp/config/mongoConfig.js mongo_deploy.yml (continued): ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 26. Node.js App Configuration (Continued) module.exports = { url: "mongodb://172.17.0.2:27017/" } ./config/mongoConfig.js (auto-generted): 'use strict’; const mongoConfig = require('./config/mongoConfig’); MongoClient.connect(mongoConfig.url, function(err, client) { assert.equal(null, err); … }); app.js: ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 27. Lessons Learned Tracking, Updating and Sharing Geo-Tagged Data ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 28. Geo-Marker Document { "_id":"5b0dcb214ff9980016c119f6", "type":"Feature", "geometry": { "type":"Point", "coordinates": [ -66.03899002075195, 18.398795619534134 ] }, "properties": { "name":"fire” } } MongoDB ObjectId GeoJSON Data Fields ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 29. Creating 2dsphere Index in Node.js … MongoClient.connect(mongoConfig.url, function(err, client) { assert.equal(null, err); const db = client.db(mongoConfig.dbName); const collection = db.collection(mongoConfig.makerCollection); collection.createIndex( { “geometry.coordinates” : “2dsphere” }, function(err, result) { if (err) { console.log('Error while creating indexes: '+err); } else { console.log('All 2dsphere indexes were created successfully!'); client.close(); }}); }); server.js: ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 30. Tracking Updates with MongoDB ObjectID … const ObjectID = require('mongodb').ObjectID; var lastObjectId = ObjectID.createFromTime(0); setInterval(function() { var objectId = new ObjectID(); let query = { '$and' : [ { '_id' : { '$gte' : lastObjectId } }, {'_id' : { '$lt' : objectId } } ] }; MongoClient.connect(mongoConfig.url, function(err, client) { assert.equal(null, err); const db = client.db(mongoConfig.dbName); db.collection(col).find(query).toArray(function(err,docs) { // Process query results … lastObjectId = objectId; }); }); },delay); update.js: ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 31. Graceful Recovery after Disconnect … setInterval(function() { var objectId = new ObjectID(); let query = { '$and' : [ { '_id' : { '$gte' : lastObjectId } }, {'_id' : { '$lt' : objectId } }, { update : { '$exists' : false } } ] }; MongoClient.connect(mongoConfig.url, function(err, client) { assert.equal(null, err); const db = client.db(mongoConfig.dbName); db.collection(col).find(query).toArray(function(err,docs) { // Process query results … db.collection(col).update(query, { '$set’ : { 'update’ : 1 } }, { 'multi' : true }, function(err,updated) { lastObjectId = objectId; }); }); }); },delay); update.js: ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 32. Sharing Geo-Tagged Data DRMS/GeoQ OLAF Master Node Automated Deployment Shared data Mesh Protocol Update Server { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [0, 0] }, "properties": { "popupContent": "flood" } } ] } ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 33. Sharing FeatureCollection over HTTP … router.route('/getMarkers').get(function(req,res) { var query = getQuery(req); var filter = { '_id' : 0 }; … collection.find(query,filter).toArray(function(err, docs) { res.setHeader('content-type',"application/geo+json"); // Build the GeoJSON FeatureCollection object var featureCollection = { 'type' : 'FeatureCollection', 'features’ : docs } res.end(JSON.stringify(featureCollection)); }); }); server.js: Process URL Query String Query Markers Collection Set HTTP Response MIME Type Package Feature Array in FeatureCollection Object Remove ObjectID from Results Send HTTP Response ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 34. Live Demo OLAF Prototype ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 35. What’s Next? OLAF Prototype ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.
  • 36. 1. OLAF Prototype and AWS Greengrass used to deploy trained ML models and mesh network software to edge gateways hosted on Raspberry Pi’s. 2. UAVs with on-board OLAF gateways can transmit overhead imagery and relay data from other sensors. 4. Local inference on human pose estimation models and custom analytics at edge gateways classify images of victims that are trapped or need of immediate help. 3. Edge gateways are deployed to autonomous platforms able to operate in hard to access and hazardous areas. 5. Geotagged images of victims trapped or in need of assistance are sent to OLAF master nodes at forward command center and displayed at DMRS console. DRMS Console 6. Analysts use DRMS to validate automatic classification and identify cells where resources need to be deployed immediately. ©2019 The MITRE Corporation. ALL RIGHTS RESERVED.