Best Practices for React, Node.js API and MongoDB

Best Practices for React, Node.js API and MongoDB

I've been involved in large scale systems for over 20 years and the last 10 years have seen lots of changes, from Monolithic Java/J2EE systems with Oracle back ends to smaller Micro Services based systems with a pure API layer on Node.js Javascript API services with NoSQL integrations with MongoDB and ofcourse front end technologies changing from jQuery to cleaner React JavaScript with Bootstrap as the new presentation layer. Care must be taken to preserve SEO best practices and make the new technology scale even more then before while preserving the ultra new productivity and super low costs of using these new technologies.

I want to highlight a few of the most important things that need to be done when working with these new technologies, with Agile and Scrum processes leading the way, there is less and less formal documentation created and more and more User Stories bringing the new technology into the corporate companies where before only startups would have considered them as a viable solution.

Coding standards for JavaScript are important today, many companies have set standards and its worth searching a bit and find one that fits your company culture. Pair programming and Code review should be the norm with any new project to maintain consistency since in today's market programmer turn over is higher then ever. Clean self documenting code is the norm and must be maintained going forward otherwise written documentation can get our of date quickly and can become miss-leading to new developers working on subsystems.

API's are a core component for any system documentation and using new tools like Swagger/Open API documentation allows your to expose the as built API interface documentation to those who need it while still providing security by limiting access to these resources.

There is a myth that says every developer can work at every level, this is NOT true, there are exceptions but this is not the norm. You would not expect your Database developer to create an amazing UI so why would you expect your UI developer to create amazing database work, it just does not happen that way.

With that in mind, I would like to share some Best Practices for making successful projects that scale and are maintainable.

  • Use the latest Libraries as the creator expected, if you use React.js then focus on the Best Practices from Facebook and the React Community.
  • Don't get hung up in the Full Stack development myth, don't expect a "MERN" application as a single solution. MongoDB, Express, React and Node. These are all amazing technologies but to throw them together in one application is just another way to create another unmaintainable Monolithic application, you remember the ones your are getting away from.
  • Focus on Micro Services, don't let any one component on the front end OR back end take on too much work, let the system scale both horizontally and vertically by adding more instances and loadbalancers rather then by adding complicated code to made things.
  • Use formal contracts, what does this mean? Your front end code needs to connect to the back end services with a well defined contract. These contacts are in the form of API's which have a well defined interfaces and are also Versioned. Versioning allows you to support multiple interfaces from outside. Your web application is an outside interface, your mobile devices are an outside interface and your partners are an outside interface. Yes you can update your web page API integrations by just reloading a browser page but you can't force your users on a mobile app to install the latest version, this is just not acceptable. When you have partners using your API's you need to enable their Integrations with versions and security via API gateways, this may be internal or external but in anycase they need to maintain version control since you can not expect your external partners to make changes at the same pace that you do.
  • Create your API's as a formal Node.js application connected to MongoDB, use Redis when needed for caching and you can support API's that support millions of users, if its just for general merchandise search or even more detailed transactions like Airline travel, having these in place will allow you to scale simply by adding more load balancers and servers in your micro service layers.
  • Don't expect your front end developers to write the same level of code for the back end system, allow people to specialize and become proficient at what they love.
  • I see so many React applications today focused on one platform and having the same developers write code for the front end and back end, its a recipe for disaster and rarely wins out.
  • Using GitHub and Continues Builds are the norm today, don't miss out of these benefits even if you are not focused on testing, I see so many companies that let developers compile and build apps and then they are deployed by hand, use build and deployment automation tools, there will be the time when a developer is not around and you need to push a build, keep DevOps and Developers in sync and let each group focus on what they know and love.
  • Ask experts and peers to take a look and accept input and criticism, no one knows everything and we can all learn now and then!

I'm more then happy to help on your project and I'm looking for the next big thing :)




要查看或添加评论,请登录

Thomas Jay的更多文章

  • React Native - Healthcare and Banking

    React Native - Healthcare and Banking

    Well, its been over 13 years that I have been developing iOS apps and 10 years for Android, After all the changes in…

    2 条评论
  • Conversational Commerce. BOTs and AI

    Conversational Commerce. BOTs and AI

    We've come a long way in the last 30 years. A formal SOA and ESB system that never fully delivered on all the promises,…

  • IoT - Where are we and where are we going?

    IoT - Where are we and where are we going?

    I have created a set of IoT Building Blocks IoT has massive potential, I've talked with hundreds of people and everyone…

    2 条评论
  • Turn on a Light with your iPhone today

    Turn on a Light with your iPhone today

    IoT / iOS / BlueTooth Low Energy (BLE) Learn how to turn a light on with your iPhone today. The Internet changed…

    1 条评论
  • IoT Missing Pieces - WorkFlow and Rules

    IoT Missing Pieces - WorkFlow and Rules

    So we are all experts on IoT and can not see where it fits in our daily life. There must be something we are missing.

    1 条评论
  • iBeacon Simulator

    iBeacon Simulator

    As I develop more and more software around IoT and BLE, I find myself spending lots of time with iBeacons. I work with…

  • iOS iBeacon Locate / Ranging app (open source)

    iOS iBeacon Locate / Ranging app (open source)

    I'm asked all the time for sample code for iBeacon interfaces for iOS. Samples from basic setup, emulators, ad platform…

    2 条评论
  • IoT - iOS 8 with BlueTooth / BLE is ready for primetime

    IoT - iOS 8 with BlueTooth / BLE is ready for primetime

    We are in an interesting time with app development. The last couple of years have been all about social / message apps…

  • Add Email address to your Job Posts

    Add Email address to your Job Posts

    If you've been following any of my posts of Passive Job Seekers, you know my thoughts on adding email addresses to your…

    1 条评论
  • How to connect with Passive Job Seekers aka Unicorns

    How to connect with Passive Job Seekers aka Unicorns

    I've talked to dozens and dozens of companies that are now using https://www.HighTech.

社区洞察

其他会员也浏览了