On my website I have quite a few JSON databases that I use to store info, such as comments. I know SQL but find it much easier to use JSON for me. Even though I like JSON a lot should I try and switch over to using SQL?
Asked
Active
Viewed 719 times
0
-
You should definitely try to learn SQL so you know both and when one is a better fit. – Jeremy Thompson Sep 06 '15 at 11:54
-
I do know both but when would I use SQL instead of JSON? – Wowsk Sep 06 '15 at 11:55
-
That's a different question: http://stackoverflow.com/questions/2875432/use-cases-for-nosql – Jeremy Thompson Sep 06 '15 at 11:57
1 Answers
3
You shouldn't make JSON document too large, MongoDB has limit of 16MB and even that is quite large. Reading a JSON document typically requires reading the entire thing into memory, which not only uses memory but takes CPU time. Also, you can't do granular locking within a JSON document.
Therefore you should have some system, for organizing JSON documents, which could be (but not limited to):
- the filesystem
- MongoDB
- PostgreSQL
PostgreSQL is now being preferred by many to MongoDB, you can have SQL queries for you relational structures and mix in JSON documents where needed. PostgreSQL even has JSON types.

Rythie
- 46
- 4