Blog

MongoDB For Real-Time Geolocation and Situational Awareness

October 2, 2019

The Coolfire core services are built with NoSQL database MongoDB. We sat down with Chief Architect, Danny Barnes, to learn why. 

Interviewer: It’s no secret that your team is excited about MongoDB and how it’s improving our cloud services. Please take a minute and give us a quick overview of the technology. 

Danny Barnes: MongoDB has a really interesting story. As a company, they’re a shining example of what can happen when you set out to do one thing, things change, and you’re forced to pivot. They actually started out to build a cloud PaaS (Platform as a Service), and their first step was to build a new document-based database. They built such a good one that they pivoted and became a database company. This happens a lot. Companies will try to roll their own features or capabilities, and they do it so well that they just stop there and become that thing. 

This is similar to what we’re doing here at Coolfire. We started out building really interesting custom situational awareness solutions for our customers. We got pretty good at it, and after a while we started noticing patterns in the industry and found that we were building the same set of backend services over and over to handle things like sessions, locations, etc. that we found to be common to just about every app we were building. 

Now, MongoDB is building interesting cloud application features on their Mongo Atlas platform: database plus charts, geospatial charts, realtime guis (stitch) and so on. So they’re coming full circle to what their original goal was and transitioning from a database company to more of a platform company.

Interviewer: Let’s talk about MongoDB in relation to your current work: How does it figure into Coolfire? How do you use it, what for, and why? 

DB: I’ll talk about the why first. Situational awareness (SA), more often than not, is based around geospatial intelligence. SA also means that you have accurate information, and that means the most current information, or in our language: real-time data. MongoDB fulfills both of those needs for us. It’s got geospatial indexing baked in, and it’s document-based rather than SQL, so its extremely flexible and allows us to be highly precise with our data requests. That precision equates to efficiency, and, ultimately, speed. You need to be efficient with your data requests if you’re going to build applications that can deliver lots of information in real-time.

It’s also ultra-scalable and configurable, and with MongoDB we don’t have to worry about rigid infrastructures. Above everything else, MongoDB is dynamic, so it’s a perfect fit for what we’re doing, things like indexing on the fly, adapting to dynamic data schemas, stuff like that.

Then there’s geospatial indexing which, again, is one of the most important features for our situational awareness applications. We need geospatial indexing for just about everything we do from searching within a geofence to saving location breadcrumbs. To develop a true SA app, you have to be working on a database that does geospatial, and Mongo has one of the best and most efficient implementations of it.

 

MondoDB_graphic

 

Interviewer: Can you tell us a bit about Mongo Atlas and why it’s a good fit for Coolfire?

DB: Yeah, Mongo Atlas is their cloud platform, and the way they’ve architected it is very similar to the way we see ourselves architecting Coolfire’s cloud services, so it’s a good pairing. Hosting a Mongo database at a highly scalable level is very challenging. Mongo Atlas abstracts that, and they run it and host it for you. But in order to be fast enough, you have to have it running next to your own infrastructure. So they do what’s called VPC peering, where they will run a scalable Mongo cluster for you in the same data center where you’re running your application. So because it’s in the same data center, you do this VPC connection between the two and now you have a high-speed back plane connection in your app to the highly scalable Mongo Atlas cluster, and you don’t have to worry about managing or scaling the servers as it will autoscale to what you need.

So it truly has turned Mongo from a server that we would run to a database as a service for us. And that is a killer feature for a lot of our clients. However, when needed, we can take Mongo offline and run it on a local Linux computer alongside ours or in a Docker container, and it works just fine there also, which is great for instances where the cloud isn’t available, yet we have the same great geospatially equipped database to run with. So their cloud platform is unique in that they aren’t locked to a specific cloud platform either. They’ll run it on whichever cloud platform you’re using, whether it’s AWS, Azure, etc., and run out in that environment next to your application.

This also allows developers to have full control of their development environment. They don’t have to think about managing each Mongo instance, we can run the mongo container locally for development and be sure the same database is running in the cloud also..

Interviewer: You’ve explained why MongoDB is perfect for situational awareness are there other benefits you want to mention? 

DB: Absolutely. Technically, we could do what we do on SQL. I think we could build everything we’re doing now on Oracle or SQL Server, but the amount of effort it would take would be much, much greater. Working on Mongo means basically eliminating all of that overhead. It allows us to move faster and be more dynamic and adapt to what our clients’ needs are. We can also learn things from our clients’ user base and make adjustments easily and quickly. For instance, we can quickly identify inefficiencies in queries, or indexes and adjust our code to improve performance on the fly with the Atlas Web Portal. This is huge, and they are really far ahead in terms of the featureset they can offer compared to other cloud document database platforms. Doing something like that on an SQL server system is much more difficult and would require much more planning and database administration and things like that. 

The kind of adaptability you get with Mongo is extremely powerful for our clients because now they can see their database performance and basically snap their fingers to make it faster. Not to mention things like continuous backups, easy restoration, and encrypted-at-rest data storage come “out of the box” with Mongo Atlas, which gets us even further down the road in terms of checking those boxes that are must have for modern cloud applications these days. 

In a lot of ways, this is similar to what we offer on our platform, we’d like to offer features that get app developers way ahead of the curve, “out of the box” so they can be more effective at building really effective, impactful apps on our platform. Like all projects in our industry, we “stand on the shoulders of giants” that came before us, Mongo is a giant for us, we want to be a giant for our customers to stand on as well.

 

About Danny Barnes

Danny Barnes is a Chief Architect for Coolfire Solutions in St. Louis, MO where he leads the development for all major software platforms. He has over 15 years of tech experience in multiple industries from hospitality and consumer packaged goods to military and special forces. Danny has developed solutions for public and private clients such as the U.S. Army, P/Kaufmann, Enterprise Rent-A-Car, and AB InBev.