Tuesday 23 April 2019

Need Advice (Noob): The wild world of Node & ORMs

TL;DR: Frontend JS Developer wanting to build full stack web apps. Fairly new at backend. Want to build a coupon based website(very similar not exact). Tried Learning Django Rest framework, it was too much abstraction. Started learning node. Most tutorials use MongoDB/Mongoose. Need SQL but struggling choosing an ORM with Node. Tried Sequelize, Knex.js, Objection.js and been back and forth with all. Need help choosing one with great concern about data security (sqli, validation, serialization etc.). Knex.js by itself seems intuitive but not sure if it leaves me open to a lot of data breaches considering my limited SQL experience.I have a goal of wanting to build a web application that will be very similar to a coupon styled website (business owners post coupons, consumers claim coupons. Lots of different categories). I have been teaching myself Javascript/React for about 7 months so i have front-end knowledge covered for the most part. I finally ventured into backend as it was always my ultimate goal to have full stack knowledge to create online businesses/web apps.Initially started learning python and got into Django for its rest framework (Heard it was the best ORM by far). It was nice and robust but learning a whole other language was very daunting for me and all the abstraction of Django made it even more overwhelming. My fundamentals in JS are far superior to that of Python so i said i would just go with Node.js.Started taking a node.js tutorial which has been great, but unfortunately as you may know most tutorials use MongoDB (which i hate) and Mongoose. Since most of the ideas i have for web apps will have relational data, that was a dealbreaker for me.Thus leads me to the problem that seems common (based on reddit searches) with node, which are ORMs.I have looked at Sequelize, node-postgres, knex.js and Objection.js. I am struggling with choosing one, as based on my limited knowledge, all have their pros and cons.Its so frustrating as a noob as i have banged my head against the wall for the past 3 days moving from Sequelize to Knex.js to Knex.js with Objection.js back to Sequelize and doing it all over again.I like knex.js and it seems the most intuitive to me but i worry about security such as SQLi (very naive on this part of it). Does knex.js leave me to many security concerns?I see many advise to use Knex.js with Objection.js. However, there are hardly any tutorials to my knowledge (video or written) to follow and understand how they work with each other.Sequelize gives me the beauty of having a lot of tutorials to look at but the level of abstraction scares me.So with all that being said, what is my best course of action with my proposed web app that i would be building, taking into consideration data security (validation, serialization etc.). I have been stuck on this for a while and i just need some clarity on this.thanks in advance.

Submitted April 23, 2019 at 07:27PM by RSpringer242

No comments:

Post a Comment