Learning Library

← Back to Library

MongoDB: Best Database for JSON Storage

Key Points

  • Jamil Spain explains that when a project centers on JSON data, MongoDB is a strong database choice because it natively stores flexible, schema‑less documents.
  • He evaluates technology using three criteria—flexibility, ease of implementation, and deployment—and marks MongoDB high on flexibility.
  • MongoDB’s in‑memory processing offers fast access, but developers should manage inconsistent field counts by using null placeholders or enforcing some consistency.
  • The platform also provides powerful geospatial query capabilities and extensive SDK support (JavaScript, Java, Go, etc.), making it easy to integrate into various applications.

Full Transcript

# MongoDB: Best Database for JSON Storage **Source:** [https://www.youtube.com/watch?v=VOLeKvNz-Zo](https://www.youtube.com/watch?v=VOLeKvNz-Zo) **Duration:** 00:05:37 ## Summary - Jamil Spain explains that when a project centers on JSON data, MongoDB is a strong database choice because it natively stores flexible, schema‑less documents. - He evaluates technology using three criteria—flexibility, ease of implementation, and deployment—and marks MongoDB high on flexibility. - MongoDB’s in‑memory processing offers fast access, but developers should manage inconsistent field counts by using null placeholders or enforcing some consistency. - The platform also provides powerful geospatial query capabilities and extensive SDK support (JavaScript, Java, Go, etc.), making it easy to integrate into various applications. ## Sections - [00:00:00](https://www.youtube.com/watch?v=VOLeKvNz-Zo&t=0s) **Choosing MongoDB for JSON Storage** - Jamil Spain explains why MongoDB’s flexible, schema‑free, and easily deployable NoSQL design makes it the ideal database for handling JSON objects. - [00:03:08](https://www.youtube.com/watch?v=VOLeKvNz-Zo&t=188s) **Flexible Implementation and Scalable Deployment** - The speaker outlines broad SDK language support, simple development setup, and a production‑ready MongoDB architecture featuring primary‑secondary replication for horizontal scaling. ## Full Transcript
0:00Hmm, let's see, let me make some first name 0:08Let's see, maybe last name 0:20Oh just .. oh, oh, hello! I'm just making some  JSON here! Now I've made this JSON object, 0:26question comes to mind: if that's the format I  love to work in, what is the best data store to 0:32handle JSON objects? Hello, my name is Jamil  Spain, Brand Technical Specialist with the 0:38US Financial Services Market. Today I want  to talk through when making that decision, 0:44not the front-end, not the back-end, but for the  database layer in your application architecture. 0:50If you love working with JSON which database of  choice should you use? Today's topic is MongoDB 0:58being that choice. Now as a technologist often when  we evaluate technology we ought to have some type 1:05of criteria to make our decisions against. Here  I have my chosen 3 that I like to do when 1:11it comes to evaluating technology - the flexibility,  how easy easy is it to implement, and also at some 1:19point once we start having fun behind the keyboard  we got to consider the deployment aspect here. I've 1:25already started here with the JSON object. So as  you can see and guess, MongoDB is great for storing 1:34NoSQL data structures. Meaning it's not, you  know, built to be, I don't have to define the 1:39structure up front, I can take a JSON object,  a document, that really has no structure 1:45any number of fields, and it's great to  store that. Then it also is an in memory 1:54data store. 1:57So all the objects that I store are located  in memory processed there which means I have 2:03relatively easy access to get to those as  well. These JSON documents can be any kind 2:09of size here. One caveat that I have learned from  working with this and leveraging Mongo to store 2:16my documents here is be conscious of sometimes  we have a tendency with JSON to not have a set 2:22number of fields. And that can become a problem,  you may want to make placeholders for null values, 2:28or define some type of consistency here as well.  One other great feature that I've noticed is if I 2:36were to add a longitude, latitude to my JSON object,  Mongo is great for querying, doing geospatial 2:43queries against these data sets as well. So, if I wanted to make my own type of let's say a food 2:50delivery service and I wanted to determine which  locations were closest to you. If I have the users, 2:56me Spain here, actual longitude latitude  coordinates I could compare that against 3:03the other JSON documents that may also include  the same type of information here as well. 3:08All right, I think we've covered this. Let's put  a check mark next to flexibility here as well. 3:14Now when it comes to implementation, yes, you got  to make sure that all the SDKs are available, are 3:20are there any limitations that you have to account for.  So of course, there is JavaScript, there's Java, 3:28Golang, there's pretty much all the the value  pairs are there. Theres the popular languages are 3:35are there for you to use, and easy examples  client libraries to actually access this as 3:41well. So not a consideration from there. Let's  talk about deployment for a second after I do 3:47that check mark on implementation here. Therefore  deployment, you can set up MongoDB relatively, I 3:55want to say easily, but it does, there are easy  ways to facilitate, whether it's on containers or 4:02maybe on your own Linux servers. You can set up an  easy instance without security, very easy to play 4:07with. So for development, I would say yes it's very  easy to set up a single instance and prove out how 4:18easy it is to implement into your architecture  whether you're architecting for web or mobile 4:23and what you're working with. And for production  purposes, once you get that exciting architecture 4:30set up here, you will have the ability, it works off  the same what I like to call "main and secondary 4:36models". So you have a main node that you publish  to or interact with and it can do the replication 4:46to those secondaries. 4:51So scaling that way on more of a horizontal scale  to meet the demand of your actual architecture 4:58there. So that can really be useful if  you want it to be your primary database 5:03to function with, and as we know JSON is becoming  a pretty popular standard to to work with your 5:10data structures there. So, we'll do the check mark  there. So, hopefully it's been useful. There's much, 5:18much more, we're just touching the surface here, but  I want you to definitely go out to mongodb.org and 5:24look out for more information. Thank you for your  time. If you have questions, please drop us a line 5:30below. And if you want to see more videos like  this in the future, please like and subscribe.