Jim Lynch Codes
  • Blog
  • About Jim

Writings about one coder's stories & experiences.

The Main Reason Why I Love MongoDb

6/28/2019

0 Comments

 
Recently I've been doing a lot of work with MongoDB, an I've definitely been enjoying it! I work primarily in NodeJS and front-end JavaScript, and the reason why I love mongo so much is that you can basically just take an object and drop it directly into your database! Then when you read the value, it's already nicely in an object for you!

Application State Is An Object

As I've said many times before, every front-end application is just an interactive reflection of the data, and as we know from using Redux the data can be represented as one massive object outside of your components. JavaScript's collections are inherently very simple- it's either an array of a key-value pair, and that's exactly how you can save your data in Mongo as well. 

No Need To Map Back And Forth To Spreadsheet Format

The old relational databases would give me such a headache as you would always have to map your objects back and forth between JSON and the table structure that resembled a "Microsoft Excel Spreadsheet". I guess it's easy to look at the data in an admin view (ie MySQL Workbench or something like that), but it kind of sucks to work with from the code because JavaScript doesn't store data in rows and columns. Not being able to nest properties forces you to do all these wacky table-joining aerobics, and not having internally recognized "Date" types would screw with sorting. Relational database are outdated, and imo there are very few JavaScript applications whose data would be better modeled in Postgres tables than Mongo (would love to be criticized for this in the comments lol). 

New Versions Don't Suck

Finally, I just want to point out that it took me a while to really get into Mongo because I had heard some horror stories about people losing data or it being slow or whatever. While some of those stories are definitely true, a ton of development time has gone into fixing those issues, and nowadays if you are experiences bad things then it's most likely just you doing it wrong. haha. With that said though I feel like Mongo does make it very easy to do some obnoxiously heavy query and shoot yourself in the foot, but maybe that's just a consequence of the flexibility and power available to you. The other great thing is that there are a ton of other people using Mongo right now so almost any issue you have can just be googled to find other people also experiencing that issue and stack overflow answers that will hopefully get you past the stumbling point. Let me know how you feel about Mongo and other object-based databases in the comments below!
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    ​Author

    Picture
    The posts on this site are written and maintained by Jim Lynch. About Jim...
    Picture
    Follow @JimLynchCodes
    Follow @JimLynchCodes

    Categories

    All
    Actionscript 3
    Angular
    AngularJS
    Automated Testing
    AWS Lambda
    Behavior Driven Development
    Blockchain
    Blogging
    Business Building
    C#
    C / C++
    ClojureScript / Clojure
    Coding
    Community Service
    CS Philosophy
    Css / Scss
    Dev Ops
    Firebase
    Fitness
    Flash
    Front End
    Functional Programming
    Git
    Go Lang
    Haskell
    Illustrations
    Investing
    Java
    Javascript
    Lean
    Life
    Linux
    Logic Pro
    Music
    Node.js
    Planning
    Productivity
    Professionalism
    Python
    React
    Redux / Ngrx
    Refactoring
    Reusable Components
    Rust
    Security
    Serverless
    Shell Scripting
    Swift
    Test Driven Development
    Things
    TypeScript
    Useful Sites
    Useful Tools
    Video
    Website Development
    WebStorm
    Writing

    Archives

    March 2023
    August 2021
    February 2021
    January 2021
    October 2020
    September 2020
    May 2020
    April 2020
    February 2020
    January 2020
    December 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015

    RSS Feed

  • Blog
  • About Jim
JimLynchCodes © 2023