• Post category:StudyBullet-9
  • Reading time:4 mins read


Build a microservice

What you will learn

Create a microservice

Test and Prototype API

Create an Express Server

Send messages to the console

Make API Call and fetch data

Description

In a microservice, each software application feature is separated from the other, in most cases with their respective servers and databases. Applications built with this kind of architecture are loosely coupled, also referred to as distributed applications.

Early on in the practice of software development, best practice involved tightly coupling all of the softwareโ€™s components in what is known as a monolithic application. However, monolithic applications require extra effort to respond to changes in the system. If any particular component develops a fault, the entire system is affected.

Nowadays, we can solve the problem using microservices, which allow us to build our software product components separately. If there is a fault in one component, it wonโ€™t affect the functioning of the entire software product.

In this article, weโ€™ll review the concept of microservices, learn how to implement a microservice with Node.js, and explore how microservices are changing the practice of software development


Get Instant Notification of New Courses on our Telegram channel.


Imagine weโ€™re building an ecommerce store. Weโ€™ll need models for a payment feature, cart, customers, admin, and order. Each of these features will have its own separate servers and databases.

Our ecommerce microservices will communicate with each other using the REST API framework. With our store features developed independently from each other, we can easily identify which feature to debug if our system develops a fault and avoid having to bring down the entire application.

microservices offer a better developer experience. A new developer joining the team wonโ€™t have to understand the entire code base, but rather only the features they are working on, increasing productivity.

English
language

Content

Setting Up Node Js

Introduction
What are Microservices
What is Node Js
Install Node Js
What is Npm
Text Editors
Installing Atom
What is express
Install Express
Creating the application file
What is Nodemon
Installing Nodemon
Sending messages to console
Using Arrow functions
Using Const
Refactoring Code
Creating directory for source code
Exploring sample microservice
Installing axios
Fetching data