Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading a JSON file vs querying MongoDB

It is a performance question - I created a web app (in Node.js) that loads a JSON file that has around 10 000 records and then displays that data to the user. I'm wondering if it would be faster to use (for example) MongoDB(or any other noSQL database, CouchDB?) instead? And how much faster would it be?

like image 230
mirta Avatar asked Mar 30 '17 10:03

mirta


People also ask

How do I load a JSON file into a MongoDB collection?

Open the Import Wizard. Then, choose JSON as the import format and click OK. Click on + to add JSON source documents, – to remove them, or the clipboard icon to paste JSON data from the clipboard. Here we will add the JSON source document, Rainfall-Data.

Is MongoDB good for JSON?

The best database for JSON This makes the MongoDB database the best natural fit for storing JSON data. You can store details of an entire object in one document, making it easier to view and query. MongoDB is the most popular JSON database as it offers many other benefits, like: Flexible schema.

What is faster JSON or SQL?

Native JSON Data Stores do not always have the Best Performance. One of the best things about NoSQL database management systems is their performance. Since they work with simpler data structures than SQL databases, storage and retrieval tend to be faster in NoSQL database systems.


1 Answers

If you are looking for speed, JSON is quite specifically "not-fast". JSON involves sending the Keys along with the Values and it requires some heavy parsing on the receiving end. Reading the data from file can be slower than reading from the DB. I wouldn't like to say which is better, so you'll have to test it.

like image 141
Jordy Cuan Avatar answered Oct 21 '22 08:10

Jordy Cuan