‘Modular-services in a Nodejs Monolith’ : feedback on talk
Hello reader:
Last year I created an OSS project — archiejs (https://github.com/archiejs) which allows developers to write modular code in nodejs. Actually, modular coding is an age old thing, also known as clean architecture — where usecases are the modules. I have seen that there is a renewed interest in modular coding as opposed to the microservice hype. So I thought it would be useful to create a talk on writing modular code in Nodejs.
I introduce a dependency chaining library ArchieJS, where instead of using imports between modules, we initialize and pass them as arguments (inject) to constructor functions of upstream modules. Since using ‘import or require statements’ between business logic modules is not allowed, the service boundaries remain cleaner.
Do highlight any cons if you get the time? And any ideas that I can add to the talk or make it useful. Maybe some examples from other domains like IoT, enterprises, etc etc…
Abstract:
Microservices are described as services with a few hundred lines of code. Big organizations run such micro services 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 micro services. 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 micro services, a few files ideally. A few modules can be piped/joined together to make an app. They share a lot of similarities to micro services 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 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.
You can write me a comment here or tweet me a feedback https://twitter.com/navalsaini .
Thank you for your valuable time.
Also a few other references on Modular coding and comparison with Microsevices. Both the talks below are Java focussed and I thought something nodejs focussed would be a new thing.
- https://www.oreilly.com/ideas/modules-vs-microservices and an HN discussion https://news.ycombinator.com/item?id=13960107
- Modules or microservices? — Sander Mak https://www.youtube.com/watch?v=fDoiydWS3D4
- Microservices and Modularity or the difference between treatment and cure! — https://www.youtube.com/watch?v=O77777Zy_HE