addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

MySQL vs MongoDB: The JSON Wars

From: user 5.
Sent on: Wednesday, August 26, 2015, 4:26 PM

So I’ve been using mysql and mongodb together for the past few years. I like mysql because its relational nature makes it easy to normalize documents thereby making it great for search.  My front end has list-based and text-based searching options and they are easy to implement on the back end with mysql thus allowing users to search across many thousands (and ultimately hundreds of thousands, as my db grows) of documents.  Mongo’s inability to search across collections is something I’ve never liked and putting all of my documents in one huge collection in order to search across them all is simply not feasible.

 

On the other hand, my documents are json and obviously that makes mongo a great choice for storing them. In addition, mongo’s javascript api works well with node.js, which I’ve been using for quite some time and just about every node framework assumes you’re using mongo for storage. The headache comes from trying to keep the mysql and mongo db’s in sync.

 

Along comes mysql 5.7 which has native json support. I’ve tested it out and, even though it’s still considered a development release, it works quite well. I can do crud on json documents without much hassle. Couple that with mysql’s relational nature and, in my humble opinion, mongo’s got somewhat of a problem – so much so that I’ve decided to stop using mongo and go with mysql only. I also use redis, but just as a temporary buffer between my web crawler and my web site.

 

After using mongo for years (and mysql even longer) this feels weird. I’m confident in my decision, yet I feel the need to get some feedback. So, for those that have some experience with both db’s, what do you think?

People in this
group are also in: