Modular-services in a Nodejs Monolith

By Naval Saini

Elevator Pitch

We discuss the theory and design practices that can be followed by organizations to develop modular cloud applications that optimize for readability, reusability, maintainability, and agility. A well-designed modular application is a precursor to a successful microservice architecture in the future.

Description

Microservices are described as services with a few hundred lines of code. Big organizations run such microservices in 100’s and are often looked up to by engineers in startups/smaller companies, too eager to join that league. However, the hard reality is that only a few startups will survive to scale and need microservices. Busting the hype, the experts are suggesting smaller companies to adopt writing modular code instead of microservices code. How do you write modular code in NodeJs and why are they better than microservices?

Modules are blocks of functionality that are bigger than microservices, a few files ideally. A few modules can be piped/joined together to make an app. They share a lot of similarities to microservices and hence to title — modular services in a monolith. A well-written modular code can be broken up into microservices (when being deployed) and also tested upon as a single app (when running on a laptop). I will introduce a dependency chaining library ArchieJs (https://github.com/archiejs) and how the modules in ArchieJs are the way to architect your Nodejs monolith.

Other recent developments outside of NodeJS world on this topic is the inclusion of ‘module’ construct in Java 9. The first part of this talk is inspired by similar talks from Java world. The second part ventures into implementing the modular architecture tenets in the Js world.

Notes

Outline

  • Compare Modular Monoliths to Microservices - engineering complexity, cost, etc
  • Introduction to Tenets of Modular development
  • Using Archiejs to implement Modular architecture
  • Challenges to splitting monoliths into services; and how Archiejs addresses them

Slides

http://slides.com/navalsaini/modular-nodejs#/

Talk at @JsFoo @2017

https://www.youtube.com/watch?v=qkDEp5lRasE&start=07:13:30&end=07:50:00