mongodb days silicon valley: winning the dreamforce hackathon with mongodb

66
MongoDB Days Silicon Valley Winning the Dreamforce Hackathon with MongoDB

Upload: mongodb

Post on 12-Apr-2017

1.224 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB Days Silicon Valley

Winning the Dreamforce Hackathon with MongoDB

Page 2: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

db.mongoDaysSV.insert( {

“init”: “Welcome Message”, “author”: “Greg Deeds”,

“twitter”: “@TEGBIZ”, setInterval: 162000

} );

Page 3: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

RAPID PROTOTYPING with MongoDB

Page 4: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

You want to change the game?

You have 24 hours...

Page 5: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Two True Tales Of MongoDB

MongoDB & Force // GR • API driven rapid prototyping • HEROKU CONTAINERIZATION • MASS IMPORT DATA SCIENCE

DRONEY EXPRESS // MongoDB your range • Geospatial & Autonomous

Page 6: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB or RDBMS

Page 7: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Winning with MongoDB

• Developing Rapid Prototypes

• Winning Hackathons with MongoDB

• Drones / MongoDB {Range Management}

Page 8: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB or

stay in the RDBMS Matrix

Page 9: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Give Up The Old And Win

• Traditional DevOps Practitioner moved to Micro-services

{Microsoft .NET & SQL Server}

{Oracle APEX-PL/SQL & Oracle Server} {Any Linux... MySQL/POSTGRES}

• Teamwork to overworked evolutions

• My SQL Dreams never materialized - {WHATS NEXT!}

• AGILITY TRAIN YOUR MIND AS A LIFESTYLE

Page 10: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

The Early Days

Page 11: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MY BACKGROUND

• Started in 1979 {Ti99/Tape Deck} • Wrote first database on Commodore • BBS Author/ISP {One of the young ones} • Multimedia Producer // Software Engineer • Worked for corporations to startups

{ Military / Federal / Education } • The Writing is on the Wall - MongoDB Time!

Page 12: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

My Computing History

Page 13: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

TI-99/4A {circa 1982}

Page 14: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Monuments to Awesome-ness

Page 15: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Languages & Coding {Berkeley Logo}

Page 16: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Languages & Coding {Learning to Communicate}

Page 17: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Languages & Coding {Standing on the Shoulders of Giants to Communicate}

Page 18: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 19: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB Queries Support Projection!

Page 20: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

PROBLEM: The data is available but in various formats, not easy to use and is changing

• Accessing your government should not be data science or outside of SalesForce.com

• PLATFORM HEROKU - {the app processing grid}

Page 21: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Our target user ranges from the socially conscious individual to Publicly Traded Companies and Governments. Our comprehensive tool will allow…

• Grassroots Organizations, Associations • Publicly Traded Companies • Lobbyists, PACs and Governments

Manage information

• Up-to-Date Congressional Legislator Directories

• Congressional / State Legislation Tracking

• Easy Meetings Management

• Bill and Amendments Tracking

• Committees and more

We are most proud of the tool because it allows both individuals and organizations to understand the landscape of our Government, politics, and social activism.

Page 22: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB & Droney Express

Page 23: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

ForceGR / SPEC

• FORCE.COM APP Generator • APEX & PL/SQL Classes • Restful NODEJS HEROKU • Mongo for Import, Reduce and Production

Page 24: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 25: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 26: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

A Global Competition

Page 27: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 28: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Data Sets Matter• Variety Of Formats

• YAML // XML // JSON // CSV // TAB

• Normalized only for XML / DTD files.

• Multiple websites crawled/parsed {Using RSYNC || PHP To Bulk Load Objects}

• Aggregate Pipeline

• Build Words / Terms from triples

Page 29: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Semantic to understand {What you say}

• Latent Semantic to understand {What you mean}

• MongoDB // Provides both when used in pipeline

with other word bag or terminology generators

• The results are we find correlation in unnormalized

data

Data Miner Mongo DB

Page 30: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 31: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Over 500k Objects

Page 32: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 33: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 34: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Monitor the query in MongoDB reactively {Check to see how the indexes need to improve with a statistics collection of performance and counters for the API}

• Compound indexes need to be built on geojson first then other fields when used

• Consider using elastic search to boost the Hackathon Team to victory if free text is slow

Use Conditional Indexes {add Agility_new ways working with this data?}

Page 35: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Find source files over APIs //

{ to maintain high speed with no throttles. Hackathon bandwidth is varied sometimes when you need it. It gets worse with time }

• Use Old School Shell Tools // { NodeJS is not ideal for all challenges }

• PHP • PERL • PyThon • RSYNC

MISSION: Data Capture

Page 36: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• The focus of TEG’s FORCEGR tool is to present information into SalesForce users Desktop

• Then to make decisions about responses to these decisions

• Further guiding the NodeJS learning engine

APEX CLASSES / INTERACTIONS

Page 37: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

question =

(my_department, has, what)

knowledge = (

(I, own, my_apartment),

(my_department, has, my_computer),

(my_department, has, my_vote),

(my_department, is_in, Philadelphia)

)

Page 38: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

‘$push’ ‘$pop’

‘$unset’ ‘$set’

bye bye SQL...

Sew the Dataset

Page 39: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

The Team

Page 40: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• .NET/Oracle APEX/PLSQL is heavy Spiral DEVOPS

• The Browser Wars- We Won {HTML5/Javascript Rocks}

• SUBVERSION TO GIT DEVOPS TO NEW CHATOPS {Your Dated If You Can’t GIT With It…}

• Shifts in web computer science

• Multitouch surface the GPU and JavaScript are the next big shift

Recognizing Shift

Page 41: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Practice writing specifications for NOSQL

• Use New tools to trap ideas

• CHECK YOUR ROADMAP? { are you on course & time? }

• Gain momentum by solving problems quicker

• GIT more done { Practice like you play the game }

• Organization to Reproduce Results {use automated ‘Agents’ when possible & makes sense} {containerize your app with docker or Heroku}

Next Generation DevOps

Page 42: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

question = (my_department, has, what)knowledge = ( (I, own, my_apartment), (my_department, has, my_computer), (my_department, has, my_vote), (my_department, is_in, Philadelphia) )for each statement in knowledge { if ((statement.subject == question.subject or question.subject == what) { and (statement.predicate == question.predicate or question.predicate == what) and (statement.object == question.object or question.object == what)) call FoundAnswer(statement) }}

Output: Answer: my_department has my_computer Answer: my_department has my_vote

Pseudocode for Question- Answering Logic in NodeJS

Page 43: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 44: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Ask yourself on each project freshly {What else is aggregation good for?}

• HINT: You can use the $out pipeline operator and it will create or replace the collection it spits out, after the results are ready....

Aggregation Tips { Use the Pipeline, Luke! }

Page 45: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

if (! Links.find().count()) { // init data var nodeNames = []; var data = ['Harry,Sally,1.2', 'Rubio,Mario,1.3', 'Obama,Barrack,0.2', 'Thompson,Fred,0.5', 'Peter,Johan,0.7'];

_.each(data, function (val) { var comp = val.split(',');

Links.insert({ source: comp[0], target: comp[1], compute: comp[2] }); nodeNames.push(comp[0]); nodeNames.push(comp[1]);

});

// remove duplicates nodeNames = _.uniq(nodeNames); _.each(nodeNames, function (name) { Things.insert({ _id: name }); }); }

Finesse by using new tools

Page 46: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

VICTORY It never lasts long enough....

Page 47: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

MongoDB & Droney Express

Page 48: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• HTML5 & WebGL ODM Tools

• MongoDB Powering Geoserver Raster

• Realtime 3-D Model Scenes In A Browser

Hibernate ORM is Dead {long live MongoDB ODM}

Page 49: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Hibernate ORM VS MongoDB ODM • Hibernate Maps Java Objects To RDBMS And Is

Proven Not Scalable

• RDBMS load times for a single object graph (Hibernate/SQL Server) from 3 to 4 seconds

• Relational model is not suited for complex object graphs.

• Even with massive parallel processing is not economical

Hibernate Search • Cannot Beat Elastic-search & MongoDB In

Response Speed

Business Opportunity

Page 50: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• ORM Hibernate JBOSS - Object/Relational Model {storage has reached the end of life period…}

• MongoDB is the best object store on the market today • Hibernate is complex when the world needs BSON • MongoDB is Built For Replication • Hibernate Replacement Is An Opportunity.

Market Need {MongoDB Sensor ODM}

Page 51: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Project Requirements • Open Source/No Internet/Limited WiFI

• Runs on variety of low cost hardware

• Auto-deploys Via Docker On IoT Appliance

• Plugin To Existing GeoServer/ESRI/GRASS

• Replace Hibernate With MongoDB

Droney Express {Range management System}

Page 52: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

• Interchange GeoJSON set of Shapes & Waypoints

• RasberryPi Flight Computer running 2d Queries

• Objects Linked To External GIS Engine (GRASS/ESRI)

• AutoPilot Configuration In Flight/Over-The-Air

• MongoDB Monitors Situational Awareness Of Missions

• GIS Query Results Stream As BSON Objects

What is a Mission?

Page 53: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Geographic Forensics {sensor data store/search}

Page 54: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
Page 55: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

The work of Droney Express

• Planned Geofence Scanning

• 2D/3D indexed sensor data

• GIS & MongoDB Is Powerful

• Integrated GIS Remote Monitoring

• Connect Using DDP To Sync Collections Adhoc

Page 56: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Sensor Range Management

Page 57: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Async Data Sync -> Use Oplog For Synchronization

Serve GIS markup with pretty maps using Geoserver...

MongoDB is perfect for Sensors // sorry Oracle

Page 58: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Flight Plan For Best Routes

GIS Engines Accelerated By MonogDB Can Handle

more ecological range management sensors faster coordinated ground and drone assets

Page 59: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

GEOJSON / MONGODB 2d DRAINAGE MODELING

Page 60: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

GIS ENGINE & PLUGIN Droney Express Flight Planner

Least Cost Power & Route Calculator Export Tools For 3DR Ardupilot.

Page 61: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Replica Sets Are Ideal For Network Segregation

HQ is Always Primary - Drones Always Secondary

Force Constant State of Disaster Recovery - Dedup

Drones Are Small Autonomous Collection Vehicles

Eventual Consistency In Loosely Coupled Networks

MongoDB Makes Life Easy

Secondaries DeDup Secondaries To Update HQ GIS Backends For Mission Planning & Sensor Datasets

Page 62: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Droney Heartbeat modeled from mongoDB University

Airborne MongoDB Prevent Election Of New Primary

Droney Flight Computer Always Have Priority Of 0

They Never Get Elected To Primary

[Priority, Optime, Connections]

Sync Using Oplog To HQ After Weeks In Field

Network Environment Spotty For MongoDB Servers

Page 63: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Statement Replication ...Getting The Data To HQ

Droney Acquires Forensic Sensor Data - ‘A Data Silo’

Facilitates Greater Independence

Replicate Based Oplog For Forensic Time-coding

Member Replica Sync Stored Records Using Oplog

Use Oplog To Journal AutoPilot For Flight Review

MongoDB Secondaries Apply Unique ID Vs Primary

Keeps Mobile Workers From Overwriting Datasets

Page 64: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Cheap IoT Devices MongoDB 32bit Flight Computers & Range Sensors With Embedded MongoDB

In Flight Computers Are Low Power/LINUX Threaded

Sensors Streaming Data To/From MongoDB

Autopilot Flight Recorder Is MongoDB/NodeJS

IoT SD Cards - Ideal For Circular Buffers In Flight

Circular Buffers Makes Room For New Documents

Overwrite The Oldest Documents In A Collection

Page 65: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Final Thought.. NO CAMPING … KEEP CLIMBING!

CONSIDER THE FUTURE OF YOUR TIME STUDY NEXT GENERATION DEVOPS SAY “WHY CANT WE FIRST” SHARPEN UP REGULARLY

TEST YOUR SKILLS OR TEACH A SKILL

Page 66: MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB

Greg Deeds Technology Exploration Group

[email protected] www.TEGbiz.com

@TEGbiz @DRONEYEXPRESS @3dVRviewers