SlideShare a Scribd company logo
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development
Company
1
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development
Company
2
Service Oriented Architecture in NodeJS
What is Service oriented Architecture in NodeJS?
Serviceoriented architecture is a way to Building a backend applications by consisting
multiple independent services. A service can be any business logic that completes an action
and provides a specified result to the end point user.
Each service in SOA is a complete business function in itself.
For an Example
Let’s discuss about a grocery store.
The owner add the product details in the inventory. Then owner search to find data about a
unique product. And the backend application database query should be inside the service
section by leveraging data access layer. Then it securely fetch data and give the response to
the owner.
Layers in Service oriented Architecture
How SOA Works
● Here first when API call, in node app first it face router section where all the
authentication and validation occur through the middleware function. Then control
moves towards controller section which work is collect the incoming data related to
APIrequest. Here all the business logic to access data are combined inside a service.
So the controller invokes that service and service leverage data access layer to
connect with database and calculation. Then services return the data to the
controller. After that controller give the response to the end point user.
● The most important benefit in SOA is as all the services are independent and small
chunks so whenever we want to change our programing language it should be very
fast and easy in development process.
Router layer
Service layer
Data access layer
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development
Company
3
Flow chart diagram:
SOA Advantages
● Reliable– Even though service-oriented architecture has small and independent
services, it becomes easier to debug code as it checks small chunks instead of
checking a large codebase
● Independent of location– Services can be accessed through URL therefore change in
location doesn’t affect customer experience
● Scalable– Service-oriented architecture can run on multiple platforms and can
operate various servers within the given environment
● Reusability– The SOA uses its services in multiple applications independently without
disturbing other services
● Easy maintenance– SOA is an independent unit therefore updating becomes easy as
it is a single entity
● Agile– Due to reusable components and services, it helps developers to integrate
and build applications quickly according to requirements and consequently increases
the agility of service-oriented architecture.
Now question is why we shouldn’t did this directly inside the controller?
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development
Company
4
As router built with express so it combined with req and res object.So when we put our
business logic inside controller then at the testing we have to write mock for test with
response mock.
The problem is when we try to only test our business logic we can’t do that but when we
combined that inside service we can test that service without req, res object.
Code Example:
In this example we create a service that to resister a user in data base for sign up API.
In user.js controller receive all the request data and call the user service
// controllers/user.js
constUserService=require( "../services/UserService" );
constUserServicesec=newUserService();
asyncfunctionmakeUser ( req, res ) {
try {
letbodyData=req.body;
constmakeUser=awaitUserServicesec.create( bodyData );
returnres.send( makeUser );
} catch( err ) {
res.
status(500 ).
send( err );
}
}
module.exports={ makeUser };
Then in the user service folder import the data access layer and database model then
service used that data access layer and execute query in database
// services/UserService.js
// Data Access Layer
constMongooseService=require( "./MongooseService" );
From the Resource Library of Andolasoft.Inc | Web and Mobile App Development
Company
5
constuserModel=require( "../models/user" );
classUserService {
constructor () {
this.MongooseService=newMongooseService(userModel );
}
asynccreate ( createUser ) {
try {
constresult=awaitthis.MongooseService.create( createUser );
return { success:true, body:result };
} catch( err ) {
return { success:false, error: err };
}
}
}
module.exports=UserService;
Conclusion:
The main aim of service-oriented architecture is to allow users to mix large chunks of
functionalities into one in order to build an application and services by combining services.
This architectural design of node backend application is considered as a best practice in
industrial label.
Ad

More Related Content

Similar to Service Oriented Architecture in NodeJS (20)

Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
Katy Slemon
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
The Role of Angular Services in Web Development.pdf
The Role of Angular Services in Web Development.pdfThe Role of Angular Services in Web Development.pdf
The Role of Angular Services in Web Development.pdf
gauravpareekhawkscod
 
Mean stack Magics
Mean stack MagicsMean stack Magics
Mean stack Magics
Aishura Aishu
 
icv
icvicv
icv
Imran Raza
 
A Deep Dive into REST API Framework Survey
A Deep Dive into REST API Framework SurveyA Deep Dive into REST API Framework Survey
A Deep Dive into REST API Framework Survey
IRJET Journal
 
Sharing about Lucid Architecture x Laravel
Sharing about Lucid Architecture x LaravelSharing about Lucid Architecture x Laravel
Sharing about Lucid Architecture x Laravel
TrnLTunKit
 
CV_PurnimaBalla_WCS-Consultant_7Yrs
CV_PurnimaBalla_WCS-Consultant_7YrsCV_PurnimaBalla_WCS-Consultant_7Yrs
CV_PurnimaBalla_WCS-Consultant_7Yrs
Purnima Balla
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
Resume_Vivek_Bishnoi
Resume_Vivek_BishnoiResume_Vivek_Bishnoi
Resume_Vivek_Bishnoi
vivek bishnoi
 
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and WorkingIRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET Journal
 
Components of a Generic Web Application Architecture
Components of  a Generic Web Application ArchitectureComponents of  a Generic Web Application Architecture
Components of a Generic Web Application Architecture
MadonnaLamin1
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architectures
sonpro2312
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platform
Kashif Akram
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
Gagandeep Singh
 
Resume
ResumeResume
Resume
Michael Alberts
 
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
Building Microservices with Ruby on Rails: Maximizing Efficiency and ScalabilityBuilding Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
BoTree Technologies
 
Final_Poster
Final_PosterFinal_Poster
Final_Poster
Accenture
 
Final_Poster
Final_PosterFinal_Poster
Final_Poster
varun_2289
 
Unit-III Service Oritented Architecture.pptx
Unit-III Service Oritented Architecture.pptxUnit-III Service Oritented Architecture.pptx
Unit-III Service Oritented Architecture.pptx
jayakanthan8
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
Katy Slemon
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
The Role of Angular Services in Web Development.pdf
The Role of Angular Services in Web Development.pdfThe Role of Angular Services in Web Development.pdf
The Role of Angular Services in Web Development.pdf
gauravpareekhawkscod
 
A Deep Dive into REST API Framework Survey
A Deep Dive into REST API Framework SurveyA Deep Dive into REST API Framework Survey
A Deep Dive into REST API Framework Survey
IRJET Journal
 
Sharing about Lucid Architecture x Laravel
Sharing about Lucid Architecture x LaravelSharing about Lucid Architecture x Laravel
Sharing about Lucid Architecture x Laravel
TrnLTunKit
 
CV_PurnimaBalla_WCS-Consultant_7Yrs
CV_PurnimaBalla_WCS-Consultant_7YrsCV_PurnimaBalla_WCS-Consultant_7Yrs
CV_PurnimaBalla_WCS-Consultant_7Yrs
Purnima Balla
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
Resume_Vivek_Bishnoi
Resume_Vivek_BishnoiResume_Vivek_Bishnoi
Resume_Vivek_Bishnoi
vivek bishnoi
 
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and WorkingIRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET Journal
 
Components of a Generic Web Application Architecture
Components of  a Generic Web Application ArchitectureComponents of  a Generic Web Application Architecture
Components of a Generic Web Application Architecture
MadonnaLamin1
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architectures
sonpro2312
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platform
Kashif Akram
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
Gagandeep Singh
 
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
Building Microservices with Ruby on Rails: Maximizing Efficiency and ScalabilityBuilding Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
BoTree Technologies
 
Final_Poster
Final_PosterFinal_Poster
Final_Poster
Accenture
 
Unit-III Service Oritented Architecture.pptx
Unit-III Service Oritented Architecture.pptxUnit-III Service Oritented Architecture.pptx
Unit-III Service Oritented Architecture.pptx
jayakanthan8
 

More from Andolasoft Inc (20)

Scalable Mobile App Development for Business Growth1 (1).pdf
Scalable Mobile App Development for Business Growth1 (1).pdfScalable Mobile App Development for Business Growth1 (1).pdf
Scalable Mobile App Development for Business Growth1 (1).pdf
Andolasoft Inc
 
Latest Facts and Trends in Fitness App Development
Latest Facts and Trends in Fitness App DevelopmentLatest Facts and Trends in Fitness App Development
Latest Facts and Trends in Fitness App Development
Andolasoft Inc
 
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
Challenges of React Native App Development_ Effective Mitigation Strategies.pdfChallenges of React Native App Development_ Effective Mitigation Strategies.pdf
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
Andolasoft Inc
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Andolasoft Inc
 
Essential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdfEssential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdf
Andolasoft Inc
 
A Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare AppA Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare App
Andolasoft Inc
 
Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024
Andolasoft Inc
 
A Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website DevelopmentA Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website Development
Andolasoft Inc
 
How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using Python
Andolasoft Inc
 
Impact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App DevelopmentImpact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App Development
Andolasoft Inc
 
How to Optimize the SEO of Shopify Stores
 How to Optimize the SEO of Shopify Stores How to Optimize the SEO of Shopify Stores
How to Optimize the SEO of Shopify Stores
Andolasoft Inc
 
14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance
Andolasoft Inc
 
The Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce StoreThe Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce Store
Andolasoft Inc
 
Ranking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the WorldRanking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the World
Andolasoft Inc
 
Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023
Andolasoft Inc
 
List of 10 Best WordPress Development Companies
List of 10 Best WordPress Development CompaniesList of 10 Best WordPress Development Companies
List of 10 Best WordPress Development Companies
Andolasoft Inc
 
WooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online StoreWooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online Store
Andolasoft Inc
 
Why Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce StoreWhy Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce Store
Andolasoft Inc
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
Andolasoft Inc
 
Top Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must KnowTop Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must Know
Andolasoft Inc
 
Scalable Mobile App Development for Business Growth1 (1).pdf
Scalable Mobile App Development for Business Growth1 (1).pdfScalable Mobile App Development for Business Growth1 (1).pdf
Scalable Mobile App Development for Business Growth1 (1).pdf
Andolasoft Inc
 
Latest Facts and Trends in Fitness App Development
Latest Facts and Trends in Fitness App DevelopmentLatest Facts and Trends in Fitness App Development
Latest Facts and Trends in Fitness App Development
Andolasoft Inc
 
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
Challenges of React Native App Development_ Effective Mitigation Strategies.pdfChallenges of React Native App Development_ Effective Mitigation Strategies.pdf
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
Andolasoft Inc
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Andolasoft Inc
 
Essential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdfEssential Functionalities Your Real Estate Web App Must Have.pdf
Essential Functionalities Your Real Estate Web App Must Have.pdf
Andolasoft Inc
 
A Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare AppA Complete Guide to Developing Healthcare App
A Complete Guide to Developing Healthcare App
Andolasoft Inc
 
Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024Game-Changing Power of React Native for Businesses in 2024
Game-Changing Power of React Native for Businesses in 2024
Andolasoft Inc
 
A Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website DevelopmentA Complete Guide to Real Estate Website Development
A Complete Guide to Real Estate Website Development
Andolasoft Inc
 
How to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using PythonHow to Build Cross-Platform Mobile Apps Using Python
How to Build Cross-Platform Mobile Apps Using Python
Andolasoft Inc
 
Impact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App DevelopmentImpact of AI on Modern Mobile App Development
Impact of AI on Modern Mobile App Development
Andolasoft Inc
 
How to Optimize the SEO of Shopify Stores
 How to Optimize the SEO of Shopify Stores How to Optimize the SEO of Shopify Stores
How to Optimize the SEO of Shopify Stores
Andolasoft Inc
 
14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance14 Tips On How To Improve Android App Performance
14 Tips On How To Improve Android App Performance
Andolasoft Inc
 
The Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce StoreThe Ultimate Guide to Setting Up Your WooCommerce Store
The Ultimate Guide to Setting Up Your WooCommerce Store
Andolasoft Inc
 
Ranking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the WorldRanking The Best PHP Development Companies in the World
Ranking The Best PHP Development Companies in the World
Andolasoft Inc
 
Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023Top 8 WordPress Design and Development Trends of 2023
Top 8 WordPress Design and Development Trends of 2023
Andolasoft Inc
 
List of 10 Best WordPress Development Companies
List of 10 Best WordPress Development CompaniesList of 10 Best WordPress Development Companies
List of 10 Best WordPress Development Companies
Andolasoft Inc
 
WooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online StoreWooCommerce vs Shopify: Which is Better For Your Online Store
WooCommerce vs Shopify: Which is Better For Your Online Store
Andolasoft Inc
 
Why Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce StoreWhy Choose WooCommerce For Your eCommerce Store
Why Choose WooCommerce For Your eCommerce Store
Andolasoft Inc
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
Andolasoft Inc
 
Top Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must KnowTop Features And Updates Of Angular 13 You Must Know
Top Features And Updates Of Angular 13 You Must Know
Andolasoft Inc
 
Ad

Recently uploaded (20)

Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Gojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service BusinessGojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service Business
XongoLab Technologies LLP
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
The Elixir Developer - All Things Open
The Elixir Developer - All Things OpenThe Elixir Developer - All Things Open
The Elixir Developer - All Things Open
Carlo Gilmar Padilla Santana
 
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by AjathMobile Application Developer Dubai | Custom App Solutions by Ajath
Mobile Application Developer Dubai | Custom App Solutions by Ajath
Ajath Infotech Technologies LLC
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Programs as Values - Write code and don't get lost
Programs as Values - Write code and don't get lostPrograms as Values - Write code and don't get lost
Programs as Values - Write code and don't get lost
Pierangelo Cecchetto
 
Ad

Service Oriented Architecture in NodeJS

  • 1. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 1
  • 2. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 2 Service Oriented Architecture in NodeJS What is Service oriented Architecture in NodeJS? Serviceoriented architecture is a way to Building a backend applications by consisting multiple independent services. A service can be any business logic that completes an action and provides a specified result to the end point user. Each service in SOA is a complete business function in itself. For an Example Let’s discuss about a grocery store. The owner add the product details in the inventory. Then owner search to find data about a unique product. And the backend application database query should be inside the service section by leveraging data access layer. Then it securely fetch data and give the response to the owner. Layers in Service oriented Architecture How SOA Works ● Here first when API call, in node app first it face router section where all the authentication and validation occur through the middleware function. Then control moves towards controller section which work is collect the incoming data related to APIrequest. Here all the business logic to access data are combined inside a service. So the controller invokes that service and service leverage data access layer to connect with database and calculation. Then services return the data to the controller. After that controller give the response to the end point user. ● The most important benefit in SOA is as all the services are independent and small chunks so whenever we want to change our programing language it should be very fast and easy in development process. Router layer Service layer Data access layer
  • 3. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 3 Flow chart diagram: SOA Advantages ● Reliable– Even though service-oriented architecture has small and independent services, it becomes easier to debug code as it checks small chunks instead of checking a large codebase ● Independent of location– Services can be accessed through URL therefore change in location doesn’t affect customer experience ● Scalable– Service-oriented architecture can run on multiple platforms and can operate various servers within the given environment ● Reusability– The SOA uses its services in multiple applications independently without disturbing other services ● Easy maintenance– SOA is an independent unit therefore updating becomes easy as it is a single entity ● Agile– Due to reusable components and services, it helps developers to integrate and build applications quickly according to requirements and consequently increases the agility of service-oriented architecture. Now question is why we shouldn’t did this directly inside the controller?
  • 4. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 4 As router built with express so it combined with req and res object.So when we put our business logic inside controller then at the testing we have to write mock for test with response mock. The problem is when we try to only test our business logic we can’t do that but when we combined that inside service we can test that service without req, res object. Code Example: In this example we create a service that to resister a user in data base for sign up API. In user.js controller receive all the request data and call the user service // controllers/user.js constUserService=require( "../services/UserService" ); constUserServicesec=newUserService(); asyncfunctionmakeUser ( req, res ) { try { letbodyData=req.body; constmakeUser=awaitUserServicesec.create( bodyData ); returnres.send( makeUser ); } catch( err ) { res. status(500 ). send( err ); } } module.exports={ makeUser }; Then in the user service folder import the data access layer and database model then service used that data access layer and execute query in database // services/UserService.js // Data Access Layer constMongooseService=require( "./MongooseService" );
  • 5. From the Resource Library of Andolasoft.Inc | Web and Mobile App Development Company 5 constuserModel=require( "../models/user" ); classUserService { constructor () { this.MongooseService=newMongooseService(userModel ); } asynccreate ( createUser ) { try { constresult=awaitthis.MongooseService.create( createUser ); return { success:true, body:result }; } catch( err ) { return { success:false, error: err }; } } } module.exports=UserService; Conclusion: The main aim of service-oriented architecture is to allow users to mix large chunks of functionalities into one in order to build an application and services by combining services. This architectural design of node backend application is considered as a best practice in industrial label.
  翻译: