SlideShare a Scribd company logo
MongoDB for the
Industrial IOT
ecosystem
Luis Lobo Borobia
Senior Software Engineer @ PetroCloud
Who Am I? Where I work @?
Customers
● Luis Lobo Borobia
○ Senior Software Engineer @ PetroCloud since 2013
● PetroCloud
○ Real-Time Oil Field Automation and Security Platform
○ It started in 2012 by Lance White, our CEO
○ From the ground up, an Industrial IoT company
○ Today we are the market leader and our customers are all
household names in Oil and Gas, and Electric utilities
What will we be talking about?
- Industrial IOT implementation example
- MySQL -> MongoDB -> MongoDB Atlas
- New tool on the block! DA-Tracer
Some history
How we started?
● 2012
● Python
● PHP
● MySQL
● Some devices
● Small AWS deployment
Not ready for our vision
● Hard to connect to different devices and protocols
● Too many languages - few developers
● Static web application, server side rendered
We knew we had to re engineer and rethink our stack and by the end
of 2013 we started the process
Key factors during our re engineering process
● Integration
○ Connect/integrate any kind of devices (hardware agnostic)
○ Different protocols
● One Language to rule them all
○ JavaScript replaced Python, PHP, SQL
○ JSON for all our data structures
Key factors (continued…)
● People
○ Angular JS, Node JS were trends, we wanted talents
● Platform
○ Build a robust Platform to support our business
○ Browser based, Event driven, Real Time application
○ Integration of Video with Industrial Processes
○ Easy and robust database, Javascript friendly
And the database engine that won was...
MongoDB!
● High Availability
● Almost zero maintenance
● JSON and Javascript friendly
● Schema(less) flexibility
How we did we re engineer a working
production system?
● Parallel system
● Iterative process
● One feature at a time
● Cut off
Our stack and
current
Architecture
● Node.js
○ Sails.js
○ Waterline
● Angular JS
● MongoDB
MongoDB: Rock Solid
● Always available and up
● The service was never down
● … only on that single particular situation
○ Love your MongoDB Cloud Manager Backup!
■ https://docs.cloudmanager.mongodb.com/
tutorial/nav/backup-deployments/
And then, we moved to MongoDB Atlas!
What does MongoDB Atlas offer?
● Support!
● Dedicated instances instead of shared ones
● Security compliance
● Performance analysis
● Ability to expand with a snap
● Database infrastructure management
○ No need to worry about it
○ Who’s better to know how to do it than
MongoDb!
○ Security
○ Encryption
Why?
● We are 10 developers and one
dev-ops
● We have our own infrastructure
to care about: more than 3.5K
industrial remote devices
generating 250K events a day
● Tips on moving to Atlas
○ Drivers
○ A/B system
(Near) Real-time data
Schema(less) and
stats
● Event Model
○ Date
○ Name
○ Equipment Type
○ Data JSON
● Event collection
○ 234 million documents
○ Average of 250K events per
day, 7.5M events a month
○ … and growing!
○ About 640 GB local storage
○ Index size 29GB
● Devices
○ Around 3.5K different devices
{
"id": "5ba5049e1d69b32a09094000",
"eventName": "cameras/motion",
"description": "Motion occurred on Jones Camera",
"equipment": "54257bbee6066fa8504ac000",
"data": {
"video": "Motion.1.1537541248",
"media": {
"images": [],
"thumbs": [],
"videos": []
}
},
"eventDate": "2018-09-21T14:47:48.242Z",
"flagged": false,
"dismissed": false,
"deleted": false,
"createdAt": "2018-09-21T14:47:58.558Z",
"updatedAt": "2018-09-21T14:48:01.316Z",
"version": "1.11.2"
}
Volume = hard to manage data and trace
devices
- Thousand of devices
- Tons of app servers
- Tons of logs to tail
… So what now?!
Change Streams... What the luck!
● Change Streams
○ Change streams allow applications to access real-time data
changes without tailing the oplog.
○ Applications subscribe to all data changes on a single
collection, a database, or an entire deployment, and
immediately react to them
○ https://docs.mongodb.com/manual/changeStreams/
Change Streams... What the luck!
● Some sample code
const collection = db.collection('event');
const changeStream = collection.watch();
// You can use a cursor
const next = await changeStream.next();
// Or just subscribe to an event!
changeStream.on('change', console.log)
MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem
Connect to the live Poll App
https://poll.luislobo.xyz
Event Flow
MongoDb
Service
Change
Stream
WebSocket
Web App
MongoDB
Native
Driver Custom
Sails.js
Service
Sails.io
(Socket.io)
Vue.js
Wrapping up
- Industrial IOT Implementation
- Re Engineering Process
- Python, PHP, SQL to Javascript,
JSON
- Migration to MongoDB Atlas
- DA Tracer
- What’s next?
- Check Repo README.md
- Your Pull Request is welcome!
Contact:
Luis Lobo Borobia
Twitter: @luislobo
GitHub: @luislobo
Link to DATracer:
https://github.com/luislobo/da-tracer
AWS diagrams made using
https://cloudcraft.co
Thanks!
MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem
MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem
MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem

More Related Content

PPTX
Mage Titans - Magento 2 Frontend Framework - UI Components
PDF
Protecting the Web at a scale using consul and Elk / Valentin Chernozemski (S...
PPTX
Announcing StencilJS
PDF
NATS vs HTTP
PDF
Webinar: Building a Blockchain Database with MongoDB
PDF
Mongo bbmw
PDF
Piano Media - approach to data gathering and processing
PDF
MicroProfile Panel - Sept 2016
Mage Titans - Magento 2 Frontend Framework - UI Components
Protecting the Web at a scale using consul and Elk / Valentin Chernozemski (S...
Announcing StencilJS
NATS vs HTTP
Webinar: Building a Blockchain Database with MongoDB
Mongo bbmw
Piano Media - approach to data gathering and processing
MicroProfile Panel - Sept 2016

What's hot (20)

PPTX
Managing Cloud Security Design and Implementation in a Ransomware World
PPTX
Private Cloud Self-Service at Scale
PDF
An Introduction to Druid
PPTX
Going Serverless
PDF
Midgard2 Content Repository at FSCONS 2009
PPTX
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
PDF
Lean and mean MongoDB
PDF
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
PPTX
PSU CSE 541 Project Idea
ODP
Manage your personal information space with Midgard
PPTX
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
PDF
Building mobile apps with Realm for React Native
PPTX
[MongoDB.local Bengaluru 2018] The Path to Truly Understanding Your MongoDB Data
PDF
BigchainDB 2.0 - The Blockchain Database
PPTX
Meteor presentation
PDF
Building a dynamic application with GatsbyJS-Tec-Mexicali
PDF
Getting started with BigQuery
PDF
Introduction to the Nancy Framework
PPTX
Node js - Yns
Managing Cloud Security Design and Implementation in a Ransomware World
Private Cloud Self-Service at Scale
An Introduction to Druid
Going Serverless
Midgard2 Content Repository at FSCONS 2009
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Lean and mean MongoDB
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
PSU CSE 541 Project Idea
Manage your personal information space with Midgard
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
Building mobile apps with Realm for React Native
[MongoDB.local Bengaluru 2018] The Path to Truly Understanding Your MongoDB Data
BigchainDB 2.0 - The Blockchain Database
Meteor presentation
Building a dynamic application with GatsbyJS-Tec-Mexicali
Getting started with BigQuery
Introduction to the Nancy Framework
Node js - Yns
Ad

Similar to MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem (20)

PDF
Devoxx : being productive with JHipster
PDF
Devoxx Belgium 2017 - easy microservices with JHipster
PDF
Easy Microservices with JHipster - Devoxx BE 2017
PDF
Data Platform in the Cloud
PDF
FIWARE Wednesday Webinars - Strategies for Context Data Persistence
PPTX
WSO2Con USA 2015: An Introduction to the WSO2 Analytics Platform
PDF
Workflow Engines + Luigi
PDF
Data Science in the Cloud @StitchFix
PDF
MongoDB@sfr.fr
PPTX
Node.js Web Apps @ ebay scale
PPTX
Traveloka's journey to no ops streaming analytics
PDF
What cloud changes the developer
PDF
Running Data Platforms Like Products
PPTX
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
PDF
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
PDF
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
PDF
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
PDF
DocDokuPLM presentation - OW2Con 2015 Community Award winner
PDF
AWS Lambda and Serverless framework: lessons learned while building a serverl...
PDF
Streamsets and spark in Retail
Devoxx : being productive with JHipster
Devoxx Belgium 2017 - easy microservices with JHipster
Easy Microservices with JHipster - Devoxx BE 2017
Data Platform in the Cloud
FIWARE Wednesday Webinars - Strategies for Context Data Persistence
WSO2Con USA 2015: An Introduction to the WSO2 Analytics Platform
Workflow Engines + Luigi
Data Science in the Cloud @StitchFix
MongoDB@sfr.fr
Node.js Web Apps @ ebay scale
Traveloka's journey to no ops streaming analytics
What cloud changes the developer
Running Data Platforms Like Products
AWS Big Data Demystified #1.2 | Big Data architecture lessons learned
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Streamsets and spark in Retail
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
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
August Patch Tuesday
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Mushroom cultivation and it's methods.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
1. Introduction to Computer Programming.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Touch Screen Technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Univ-Connecticut-ChatGPT-Presentaion.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Web App vs Mobile App What Should You Build First.pdf
August Patch Tuesday
Heart disease approach using modified random forest and particle swarm optimi...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Assigned Numbers - 2025 - Bluetooth® Document
A comparative study of natural language inference in Swahili using monolingua...
Mushroom cultivation and it's methods.pdf
Group 1 Presentation -Planning and Decision Making .pptx
1. Introduction to Computer Programming.pptx
A Presentation on Artificial Intelligence
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Touch Screen Technology
Tartificialntelligence_presentation.pptx
DP Operators-handbook-extract for the Mautical Institute
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

MongoDB.local Austin 2018: PetroCloud: MongoDB for the Industrial IOT Ecosystem

  • 1. MongoDB for the Industrial IOT ecosystem Luis Lobo Borobia Senior Software Engineer @ PetroCloud
  • 2. Who Am I? Where I work @? Customers ● Luis Lobo Borobia ○ Senior Software Engineer @ PetroCloud since 2013 ● PetroCloud ○ Real-Time Oil Field Automation and Security Platform ○ It started in 2012 by Lance White, our CEO ○ From the ground up, an Industrial IoT company ○ Today we are the market leader and our customers are all household names in Oil and Gas, and Electric utilities
  • 3. What will we be talking about? - Industrial IOT implementation example - MySQL -> MongoDB -> MongoDB Atlas - New tool on the block! DA-Tracer
  • 4. Some history How we started? ● 2012 ● Python ● PHP ● MySQL ● Some devices ● Small AWS deployment
  • 5. Not ready for our vision ● Hard to connect to different devices and protocols ● Too many languages - few developers ● Static web application, server side rendered We knew we had to re engineer and rethink our stack and by the end of 2013 we started the process
  • 6. Key factors during our re engineering process ● Integration ○ Connect/integrate any kind of devices (hardware agnostic) ○ Different protocols ● One Language to rule them all ○ JavaScript replaced Python, PHP, SQL ○ JSON for all our data structures
  • 7. Key factors (continued…) ● People ○ Angular JS, Node JS were trends, we wanted talents ● Platform ○ Build a robust Platform to support our business ○ Browser based, Event driven, Real Time application ○ Integration of Video with Industrial Processes ○ Easy and robust database, Javascript friendly
  • 8. And the database engine that won was... MongoDB! ● High Availability ● Almost zero maintenance ● JSON and Javascript friendly ● Schema(less) flexibility
  • 9. How we did we re engineer a working production system? ● Parallel system ● Iterative process ● One feature at a time ● Cut off
  • 10. Our stack and current Architecture ● Node.js ○ Sails.js ○ Waterline ● Angular JS ● MongoDB
  • 11. MongoDB: Rock Solid ● Always available and up ● The service was never down ● … only on that single particular situation ○ Love your MongoDB Cloud Manager Backup! ■ https://docs.cloudmanager.mongodb.com/ tutorial/nav/backup-deployments/
  • 12. And then, we moved to MongoDB Atlas! What does MongoDB Atlas offer? ● Support! ● Dedicated instances instead of shared ones ● Security compliance ● Performance analysis ● Ability to expand with a snap ● Database infrastructure management ○ No need to worry about it ○ Who’s better to know how to do it than MongoDb! ○ Security ○ Encryption Why? ● We are 10 developers and one dev-ops ● We have our own infrastructure to care about: more than 3.5K industrial remote devices generating 250K events a day ● Tips on moving to Atlas ○ Drivers ○ A/B system
  • 14. Schema(less) and stats ● Event Model ○ Date ○ Name ○ Equipment Type ○ Data JSON ● Event collection ○ 234 million documents ○ Average of 250K events per day, 7.5M events a month ○ … and growing! ○ About 640 GB local storage ○ Index size 29GB ● Devices ○ Around 3.5K different devices { "id": "5ba5049e1d69b32a09094000", "eventName": "cameras/motion", "description": "Motion occurred on Jones Camera", "equipment": "54257bbee6066fa8504ac000", "data": { "video": "Motion.1.1537541248", "media": { "images": [], "thumbs": [], "videos": [] } }, "eventDate": "2018-09-21T14:47:48.242Z", "flagged": false, "dismissed": false, "deleted": false, "createdAt": "2018-09-21T14:47:58.558Z", "updatedAt": "2018-09-21T14:48:01.316Z", "version": "1.11.2" }
  • 15. Volume = hard to manage data and trace devices - Thousand of devices - Tons of app servers - Tons of logs to tail … So what now?!
  • 16. Change Streams... What the luck! ● Change Streams ○ Change streams allow applications to access real-time data changes without tailing the oplog. ○ Applications subscribe to all data changes on a single collection, a database, or an entire deployment, and immediately react to them ○ https://docs.mongodb.com/manual/changeStreams/
  • 17. Change Streams... What the luck! ● Some sample code const collection = db.collection('event'); const changeStream = collection.watch(); // You can use a cursor const next = await changeStream.next(); // Or just subscribe to an event! changeStream.on('change', console.log)
  • 19. Connect to the live Poll App https://poll.luislobo.xyz
  • 20. Event Flow MongoDb Service Change Stream WebSocket Web App MongoDB Native Driver Custom Sails.js Service Sails.io (Socket.io) Vue.js
  • 21. Wrapping up - Industrial IOT Implementation - Re Engineering Process - Python, PHP, SQL to Javascript, JSON - Migration to MongoDB Atlas - DA Tracer - What’s next? - Check Repo README.md - Your Pull Request is welcome! Contact: Luis Lobo Borobia Twitter: @luislobo GitHub: @luislobo Link to DATracer: https://github.com/luislobo/da-tracer AWS diagrams made using https://cloudcraft.co Thanks!

Editor's Notes

  • #3: Hi, my name is Luis Lobo Borobia, I have been working for PetroCloud since August 2013. PetroCloud is a Real-Time Oil Field Automation and Security Platform, focused primarily in Oil and Gas, and Electric utility verticals! There are other verticals in the works as we speak. It all started in 2012. Lance White had some oilfields he needed to monitor but their location were not convenient at all. He wanted to see the people working on it, as well as checking some values from the tank. He then contacted a friend, Martin Apesteguia, who was a co-worker from a previous company, and started the project. Later on, PetroCloud was born as a company. Martin then later on called me to join the project in August 2013. At that time PetroCloud had its very first customers, and we were a very small start-up, with 4 developers. Long time has passed (I know, just 5 years, but that is like... an eternity for Software Projects, right?) and now we are a solid company. We’ve had a big capital injection in December 2017, and we keep growing each month.
  • #4: So, to give you some heads up, we will be talking about: Industrial IOT implementation example, where we were, where we are now Moving from MySQL to MongoDB and recently to MongoDB Atlas And about a new tool I developed for tracing MongoDB operations
  • #5: Back in the days, we were working with Python inside our Router, PhP for our Web Application, and MySQL as our database engine. At that time, the current concepts of IOT, mesh networks, edge devices, were not something that everyone talked about. We new what we wanted to do, and tried to combine the right hardware elements with the right software components to get our job done. And we succeeded to a point, where we were happy and started having our first customers.
  • #6: But we knew that the software stack that we had was not one that would scale or be flexible enough for us to grow to what we have envisioned. With our current stack, it was hard to connect to different devices and protocols We had too many languages for the few developers, and if we were to grow, we would prefer that any developer could work at any level of our software stack, at least be good at reading it. Our current application was a Static web application, server side rendered, not very flexible. We knew we had to re engineer and rethink our stack and by the end of 2013 we started the process
  • #7: Key factors during our re engineering process # Integration Basically, for us to grow in this field, we need to *integrate to whatever device* or feature our customers need. That’s how we create new features: our customers drive our business. Be able to handle all the different protocols used by Industrial devices. # One language to rule them all Also, we were developing in four languages: Python, Javascript, PHP and SQL. We were really small, we wanted new talent. Our software stack was PHP based. Nothing wrong with that, I still love PHP!, but it was using Code Igniter. Yeah, I hear you. Not the best MVC based framework around, but it worked for us at the beginning. We wanted to focus in developing in one single language, so that anyone in the team could jump into Front-End development, Backend-API development, Device development. And that language was Javascript, and the data format was JSON. Our chosen solutions were and still are: MongoDB as our platform database, Node.js with Sails.js as our platform API and RCU software, and finally Angular JS (we are migrating to Angular) as our Frontend development framework.
  • #8: Key factors (continued…) # People At the end, it's all about the people. Most of the developers we were in contact with at the time were all looking at Angular JS opportunities, Node.js was the new kid on the block. We wanted to be in a platform that allowed us to attract great developers, and to be appealing. And let's be honest, would you go back and develop apps in Code Igniter? ### Platform Finally, we wanted to build a platform, not just a "web page". And for that, we wanted to have an independant API, a SPA Responsive Web Application, and our RCU (Remote Computing Unit) software, and Video jobs processsing
  • #9: At that time, I have had previous experience with some NoSQL databases, and I always liked these features about MongoDB: - High Availability is super easy with Replica Sets - Almost zero maintenance (compared to other database infrastructures) - JSON and Javascript friendly - Schema(less) flexibility
  • #10: # Parallel System We had our PHP application, moved it into maintenance mode. That was the live App users had. Then we started developing in parallel the new Node.js based API, with a new front end built on top of Angular.js. We started creating first the new skeleton and then, in an iterative process, creating the different features we had in our legacy PHP application. One of the things that we implemented in this new API and Frontend was the extensive use of Websockets. When we matched the same features we had in our app, we rolled it over, and removed access to the old system. We kept it for a while, just in case there were any events that needed to be accessed but at some point we finally killed it. All new development was done in the new software stack.
  • #11: After some (painful) months, we ended up migrating our system from PHP, Python, MySQL, to a platform 100% javascript based. Choosing a Node.js framework at that time was not that easy. I've always liked MVC frameworks. I was delighted working with Yii Framework, one of the best PHP frameworks I know. And I wanted something similar for our API. After some research, we chose Sails.js. It has an ORM, called Waterline, a nice structure to work on, and it let us focus on developing the software solution rather than thinking on "how to do the things right in Javascript". Waterline has a very nice adapter for MongoDB, and it really works great for us. We have been contributors for that project ever since, improving both Sails and their MongoDB adapters when possible/necessary. I can tell that these last years have been, technologically one of the most fun in my life. We have a solution that can drive tons of different disparate devices from different brands, and all integrated into a single Platform.
  • #12: MongoDB has been such a great tool for us, we think of it as one of the most important parts of our solution. You know why? Because we almost never hear about it! In the last 4 years, the only time it's been down, was because of human error. Actually, because of one error. Actually because of me. Yeah. I messed up with the database, at the beginning. The good thing is that one thing I always pushed forward is having a great backup mechanism. Even paranoid. Since we were happy MongoDB Cloud users were were back in business really quick. Also, because of how our infrastructure is designed, we do at the edge event storage when the platform is unreachable.
  • #13: MongoDB has been such a great tool for us, we think of it as one of the most important parts of our solution. You know why? Because we almost never hear about it! In the last 4 years, the only time it's been down, was because of human error. Actually, because of one error. Actually because of me. Yeah. I messed up with the database, at the beginning. The good thing is that one thing I always pushed forward is having a great backup mechanism. Even paranoid. Since we were happy MongoDB Cloud users were were back in business really quick. Also, because of how our infrastructure is designed, we do at the edge event storage when the platform is unreachable.
  • #14: One of the things we wanted to have since our re-engineering process was to have a (near) real-time system. Today, if an event happens, you event panel populates with a very basic event that is augmented as the information about it increases. For example, we get a tank level high event. You can immediately see the data about it, but the video footage takes a little longer to process, so you first get the data, then the event is augmented with media information that comes from the cameras around the area where the tank is located. This is possible because our platform is getting the information from our remote RCU, to the platform, to the browser and jobs services that processes our snapshots and videos. All of this is built into our different device, API and front end components.
  • #15: Because of the nature of our business, we have so many different devices reporting data, we really need a very flexible schema. MongoDB excels at it. We have a mixture between flexible and fixed schema. With Sails.js, specifically Waterline, you can design your Models to have a structure. And that is what we do. We have a specific Event structure. But we also have our device reported data into one attribute that can be anything. In yellow you can see attributes that are part of the schema of our event collection, and in bright green the ones that are not defined in our event collection schema. What it’s in data is flexible and it depends on the equipment type. From sensors readings: temperature, oil levels, audio noise decibels, to information about videos and snapshots. It can let us accomodate to any situation, as needed.
  • #17: The second I heard of Change Streams I said that! Or something similar... I could not believe my eyes... That is something I would have liked to have so many years ago! We have close to a thousand RCUs, about 3.5K industrial devices/features managed, all sending information about what's relevant to them. We use websockets to keep all of this updated. But... I always wanted to have a tool during the development process that would allow me to see any change in the database as soon as it happens, and being able to filter it... It wasn't possible at the time... until now!
  • #18: The second I heard of Change Streams I said that! Or something similar... I could not believe my eyes... That is something I would have liked to have so many years ago! We have close to a thousand RCUs, about 3.5K industrial devices/features managed, all sending information about what's relevant to them. We use websockets to keep all of this updated. But... I always wanted to have a tool during the development process that would allow me to see any change in the database as soon as it happens, and being able to filter it... It wasn't possible at the time... until now!
  • #19: ## MongoDB Tracer Let me introduce a tiny super very alpha version of a tool I've been working on the last weeks. I had the idea of building it since the second I read about Change Streams, but never had the time/excuse to build it. So, thank you MongoDB .local, you were the perfect excuse. So here it is: a tool that will show you the documents as they come in right from the database, as a tracer tool, a real-time tool that is user friendly, with filters and all the whistles. Let me show how it works. [demo] (Open up webapp) First and foremost, remember, this is an alpha version, bear with me. Now, let's get into it: - we need to provide a connection URI to the database we want - Once you do that, you need to select a collection. - Let's add this 'event' collection. - As you can see... nothing happens... gosh... - But that is intended! We need to start feeding events now. - I have built this simple web poll, that will send events to the same database DA-Tracer is connected to. - I encourage you to go to https://poll.luislobo.xyz and answer the poll so that we can start seeing some results - And all of this is right from the database - It uses Sails.js, WebSockets, VUE - And the best of it… It’s open source under a MIT license.
  • #23: ## MongoDB Tracer Let me introduce a tiny super very alpha version of a tool I've been working on the last weeks. I had the idea of building it since the second I read about Change Streams, but never had the time/excuse to build it. So, thank you MongoDB .local, you were the perfect excuse. So here it is: a tool that will show you the documents as they come in right from the database, as a tracer tool, a real-time tool that is user friendly, with filters and all the whistles. Let me show how it works. [demo] (Open up webapp) First and foremost, remember, this is an alpha version, bear with me. Now, let's get into it: - we need to provide a connection URI to the database we want - Once you do that, you need to select a collection. - Let's add this 'event' collection. - As you can see... nothing happens... gosh... - But that is intended! We need to start feeding events now. - I have built this simple web poll, that will send events to the same database DA-Tracer is connected to. - I encourage you to go to lobo.now.sh and answer the poll so that we can start seeing some results - And all of this is right from the database - It uses Sails.js, WebSockets, VUE - And the best of it... We are open sourcing it under a MIT license.