Microservices are not a tool, rather a way of thinking when building software applications. Let’s begin the explanation with the opposite: if you develop a single, self-contained application and keep improving it as a whole, it’s usually called a monolith. Over time, it’s more and more difficult to maintain and update it without breaking anything, so the development cycle may become a continuous progress of fixing some things while breaking others. If you apply the way of microservices, then you break down a potential monolith into smaller, more manageable, self-contained individual pieces that communicate with each other when needed. Then you don’t have to worry that much when you add more features because changes in a service can’t break a feature in another. This not only saves time, but makes development more secure too. It’s also easier to distribute work among autonomous teams, even across the globe.
What Does Require Do
When a module is loaded using the require() function, the module’s code is executed and the exports object of the module is returned. The require() function can be used to load local files as well as modules installed from npm.