SlideShare a Scribd company logo
1 of 26
 Monolithic Architecture and its Pros n Cons
 Microservice Architecture and its Pros n Cons
 Service Discovery
 Feature of Node.Js 10
 HTTP2 and its feature
 N-API
 Building Rest API in Node.JS
 Securing Rest API in Node.JS
Index
Monolithic Architecture
A monolithic architecture means that your app is written as one single unit of code whose
components are designed to work together, sharing the same memory space and resources.
Ex: JAR , WAR File which deployed as a single unit on application server
A microservice architecture means that your app is made up of lots of smaller, independent
services capable of running in their own memory space and scaling independently from each
other
1. Monolithic means composed all in one piece
2. In monolithic architecture, components of the program are interconnected and interdependent
rather than loosely coupled
3. If any program component must be updated, the whole application has to be rewritten
4. Not Modular : its a software application which is designed without modularity
5. Single-tiered software application
Disadvantages of Monolithic Arc.
 1.Difficult to scale: scaling the app reqires running
multiple copies of entire app.
 2. Long build/ test / release cycle
 3. New releas takes months
 4. Long time to add new feature
 5. Lack of agility: Changes made to program can not
be done very rapidly
 6. Adding new feature is complex as code grows
 7. Small change made to a part of app requires entire
app to be rebuild and redeployed.
 8. If a single component fails, it can cause the entire
application to fail which is unreliable
Disadvantages of Monolithic Arc.
9.Large and complex application: It becomes complex
to understand and modify such app and as a result
development slows down
10.Difficult to understand how to correctly implement
a change
11.Slow development: As the app and team grows
that app become difficult to understand and modify
because its huge in size and multiple team working on
it which makes developer less productive.
Microservice Architecure
 Microservice architecture, is an approach to
application development in which a large application
is made up of samller independent services
 Microservices run each application process as a
secvice
 Communicate via well defined interface using
lightweight API
 Each service performs a single function
 Because they are independently run, each service
can be updated, deployed, and scaled to meet
demand for specific functions of an application.
 Advanteges:
 1. Single Deployment Unit
 Since entire application is packaged as a single
unit, deployment process is relatively easy.
 2.One Stop shop Codebase
 navigating through the code base is easy
Proc and Cons
Advantages of Microservice
 Agility – Changes in a particular micro service can
be done very rapidly and can be deployed very
quickly
 Independent Development and Deployment
 Reusable Code: Dividing software into small, well-
defined modules enables teams to use functions for
multiple purposes.
 Maintainability: For each Service, a separate micro
service is created. Thus business code in a micro
service is very easy to understand.
Advantages of Microservice
 Scalability: Individual components can scale as per
need, there is now no need to scale all components
together
 Availability: Even if one service fails, other micro
services are highly available and the failed micro
service can be rectified very quickly
 Fault Tolerance: Even if one micro service has some
faults with regards to say Database, thus there is a
very clear boundary defined with regards to any fault.

Advantages of Microservice
 Do one thing well: Each microservice performs only
one task
 Independent: (loosely coupled) components can be
changed, upgraded, or replaced independently
without affecting the functioning of other components.
 Small and Focused: Each service performs a single
business function
 Language Nuetral: Different microservices written in
different programming language as well as different
framework.
 Rapid Build/Test/Realease cycle
Disadvantages of Microservice
 Distributed Systems : Developing distributed systems
can be complex
 Increased Resource use - All the independently
running components need their own runtime
containers with more memory and CPU.
 Increase Network communication - Independently
running components interact with each other over a
network. Such systems require reliable and fast
network connections
 Developer tools/IDEs don’t provide explicit support
for developing distributed applications.
Disadvantage of Microservice
 Testing a microservices-based application can be
large. each dependent service needs to be confirmed
before you can start testing
 Deploying microservices can be complex. They may
need coordination among multiple services.
Continuous deployment is difficult
 Migration: The migration process from a monolithic
architecture to a microservices architecture requires
you to determine the right boundaries for
microservices
Disadvantage of Microservice
 Developers must implement the inter-process
communication mechanism.
 Increased memory consumption
 Versions: Versioning for microservices can be
challenging
 Multiple databases and transaction management
can be painful.
Q.How do we keep a track of all the
microservices?
 Suppose we have a four different functions and they
might be running on four different servers.
 By using SERVICE DISCOVERY TOOL we can
communicate with microservices.
 Service discovery tools are a key value stores.
 If one microservice fails then it does not affects other
microservice.
Q.How do we keep a track of all the
microservices?
 These different microservices are in the separate
container and ready to join application and before
they work together they need to find one another.
they do this by using service discovery which creates
roadmap for this and many other microservices to
communicate.
 When microservice found each other they
communicate through API.
Features of Node.js 10
 N-API (Node.js API)
 HTTP/2
 openSSL 1.1.1
 JavaScript language improvements
 Error-handling improvements
 Performance boosts via V8, including for the async
generator and array.
 NPM v6
 Better support of ES 6 modules
Features of Node.js 10
 fs/promises API
 fs/promises API gives us a set of alternative
asynchronous file system methods that return a
Promise object instead of using callbacks. We can
access this API through require('fs/promises')
N-API
 Called as Next generation Node.js APIs for native
modules
 Used for building native Addons
 It is independent from the underlying JavaScript
runtime (ex V8) and is maintained as part of Node.js
itself
 With N-API, native module developers can compile
their module once per platform and architecture, and
make it available for any version of Node.js that
implements N-API. This holds true even for versions
of Node.js that are built with a different VM, e.g.
Node-ChakraCore.
N-API
 N-API enables different modules to work across
differnent version and flavours of node.js
without recompilation.
 ChakraCore is a JavaScript engine developed
by Microsoft for its Microsoft Edge web browser
 Chrome V8, is an open-source JavaScript
engine developed by for Google Chrome web
browsers.
Features of HTTP/2
 Multiplexing : multiple req/res transaction occurs
over a single connection
 Multiplexing the streams means that packages from
many streams are mixed over the same connection.
 Single Connection :It has single connection with
multiple streams
 Prioritization
 Header Compression: H2 forces all HTTP headers
to be sent in a compressed format.
Features of HTTP/2
 HPACK compression: Allows to compress http
headers
 Server Push: Uses SERVER PUSH by which
necessary files like style.css, script.js will get stored
in cache
 Servers can push web assets (CSS, JS, images)
before a browser knows it needs them which speeds
up page load times by reducing number of requests.
 error in individual req/res transaction do not cause
socket connection to be destroyed
Features Of HTTP/2
 Stream priority: Allows browsers to specify priority of
assets. For example, browser can request HTML
first to render it before any styles or JavaScript.
 HTTP/2 Is Binary, Instead of Textual
 Intelligent packet streaming management:
This results in reduced latency and accelerates
content download on modern web pages.
Building APIs in Node.js
 Prefer using HTTP error codes:There are 75 status
codes and in most cases you can find a suitable one
 Versioning: Any change made that is not backward
compatible, obviously will brake client applications.
 APIs should built over HTTPS
Building APIs in Node.js
 1. Use HTTP Methods & API Routes: POST, PUT,
GET, DELETE,PATCH . API routes should always
use nouns as resource identifiers.
2. Use HTTP Status Codes Correctly:
200, if everything was okay,
300, if the resource was moved,
500, if something went wrong on the API side
3. Pick the right framework for your Node.js REST
API: Express, Koa or Hapi, Restify
Building APIs in Node.js
Express, Koa or Hapi :used to create browser
applications, and as such, they support templating
and rendering
Restify: Used to build build REST services
4. Black-Box Test your Node.js REST APIs :
Black-box testing is a method of testing where the
functionality of an application is examined without the
knowledge of its internal structures or workings.
One of the modules that can help you with black-box
testing Node.js REST APIs is supertest.
Building APIs in Node.js
5. Embrace Rate Limiting: Rate limiting is used to
control how many requests a given consumer can
send to the API.
6. Create a Proper API Documentation: This is the
only one way you can describe it to clients or other
developers.
Secure REST API in Node.js
1. Cookie-based authentication: Server creates
active session in DB and place cookie with session
ID. Browser request protected resourse with cookie
and server verifies session ID against DB , if valid
it proceed.
2. Token Based Authentication:
a) JWT-Based, Stateless Authentication: Stateless
means server does not store any state about the
client session on the server side. session state
handled entirely by the client.
It cosnsist of three parts:
Header , Payload, Signature

More Related Content

What's hot

Microservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App CloudMicroservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App Cloudpbattisson
 
Integrating microservices in the cloud
Integrating microservices in the cloudIntegrating microservices in the cloud
Integrating microservices in the cloudJason Bloomberg
 
Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016 Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016 Sagara Gunathunga
 
Service mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communicationsService mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communicationsSatya Syam
 
Microservice Architecture 101
Microservice Architecture 101Microservice Architecture 101
Microservice Architecture 101Kochih Wu
 
[WSO2Con EU 2017] Resilience Patterns with Ballerina
[WSO2Con EU 2017] Resilience Patterns with Ballerina[WSO2Con EU 2017] Resilience Patterns with Ballerina
[WSO2Con EU 2017] Resilience Patterns with BallerinaWSO2
 
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?FABERNOVEL TECHNOLOGIES
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principlesSanjoy Kumar Roy
 
Microservice-Based Architecture in the App Cloud
Microservice-Based Architecture in the App CloudMicroservice-Based Architecture in the App Cloud
Microservice-Based Architecture in the App CloudSalesforce Developers
 
[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for Enterprises[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for EnterprisesWSO2
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureKanushka Gayan
 
Building Microservices: Designing Fine-Grained System by Sam Newman
Building Microservices: Designing Fine-Grained System by Sam NewmanBuilding Microservices: Designing Fine-Grained System by Sam Newman
Building Microservices: Designing Fine-Grained System by Sam NewmanIsmail Habib Muhammad
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureWSO2
 
DEVNET-1184 Microservices Patterns
DEVNET-1184	Microservices PatternsDEVNET-1184	Microservices Patterns
DEVNET-1184 Microservices PatternsCisco DevNet
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureMohamad Farhani
 
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless IntegrationWSO2
 
Securing elastic applications_on_mobile_devices
Securing elastic applications_on_mobile_devicesSecuring elastic applications_on_mobile_devices
Securing elastic applications_on_mobile_devicesfirzhan naqash
 

What's hot (20)

Microservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App CloudMicroservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App Cloud
 
Integrating microservices in the cloud
Integrating microservices in the cloudIntegrating microservices in the cloud
Integrating microservices in the cloud
 
Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016 Understanding Microservice Architecture WSO2Con Asia 2016
Understanding Microservice Architecture WSO2Con Asia 2016
 
Service mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communicationsService mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communications
 
Microservice Architecture 101
Microservice Architecture 101Microservice Architecture 101
Microservice Architecture 101
 
[WSO2Con EU 2017] Resilience Patterns with Ballerina
[WSO2Con EU 2017] Resilience Patterns with Ballerina[WSO2Con EU 2017] Resilience Patterns with Ballerina
[WSO2Con EU 2017] Resilience Patterns with Ballerina
 
Microservices
MicroservicesMicroservices
Microservices
 
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?
APIDays 2018 - APIOps & Microservices - What is MICRO by the Way ?
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
 
Microservice-Based Architecture in the App Cloud
Microservice-Based Architecture in the App CloudMicroservice-Based Architecture in the App Cloud
Microservice-Based Architecture in the App Cloud
 
[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for Enterprises[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for Enterprises
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Microservices
MicroservicesMicroservices
Microservices
 
Building Microservices: Designing Fine-Grained System by Sam Newman
Building Microservices: Designing Fine-Grained System by Sam NewmanBuilding Microservices: Designing Fine-Grained System by Sam Newman
Building Microservices: Designing Fine-Grained System by Sam Newman
 
Kong
KongKong
Kong
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer Architecture
 
DEVNET-1184 Microservices Patterns
DEVNET-1184	Microservices PatternsDEVNET-1184	Microservices Patterns
DEVNET-1184 Microservices Patterns
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
 
Securing elastic applications_on_mobile_devices
Securing elastic applications_on_mobile_devicesSecuring elastic applications_on_mobile_devices
Securing elastic applications_on_mobile_devices
 

Similar to Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2

Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsSrdjan Strbanovic
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdfSonia Simi
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern LaunguageInho Kang
 
All-inclusive insights on Building JavaScript microservices with Node!.pdf
All-inclusive insights on Building JavaScript microservices with Node!.pdfAll-inclusive insights on Building JavaScript microservices with Node!.pdf
All-inclusive insights on Building JavaScript microservices with Node!.pdfShelly Megan
 
Node.js Microservices Building Scalable and Reliable Applications.pdf
Node.js Microservices Building Scalable and Reliable Applications.pdfNode.js Microservices Building Scalable and Reliable Applications.pdf
Node.js Microservices Building Scalable and Reliable Applications.pdfSufalam Technologies
 
Microservice - Intro and Discussion
Microservice - Intro and DiscussionMicroservice - Intro and Discussion
Microservice - Intro and DiscussionSagarDevkota8
 
Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023Netizens Technologies
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On Ram G Suri
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfWDP Technologies
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed? Dev_Events
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with MicroservicesRishabh Dugar
 
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdf
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdfNestJS vs. Express The Ultimate Comparison of Node Frameworks.pdf
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdfchristiemarie4
 
Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Vadim Zendejas
 
Best Spring Boot & MicroServices Classroom & Online Training Naresh-IT
Best Spring Boot & MicroServices Classroom & Online Training Naresh-ITBest Spring Boot & MicroServices Classroom & Online Training Naresh-IT
Best Spring Boot & MicroServices Classroom & Online Training Naresh-ITmanoharjgpsolutions
 
Think Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesThink Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesRyan Baxter
 

Similar to Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2 (20)

Building Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJsBuilding Killer RESTful APIs with NodeJs
Building Killer RESTful APIs with NodeJs
 
Microservices
MicroservicesMicroservices
Microservices
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
All-inclusive insights on Building JavaScript microservices with Node!.pdf
All-inclusive insights on Building JavaScript microservices with Node!.pdfAll-inclusive insights on Building JavaScript microservices with Node!.pdf
All-inclusive insights on Building JavaScript microservices with Node!.pdf
 
Node.js Microservices Building Scalable and Reliable Applications.pdf
Node.js Microservices Building Scalable and Reliable Applications.pdfNode.js Microservices Building Scalable and Reliable Applications.pdf
Node.js Microservices Building Scalable and Reliable Applications.pdf
 
Microservice - Intro and Discussion
Microservice - Intro and DiscussionMicroservice - Intro and Discussion
Microservice - Intro and Discussion
 
Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023Important Backend Frameworks To Remember For Businesses In 2023
Important Backend Frameworks To Remember For Businesses In 2023
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
The Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdfThe Positive and Negative Aspects of Node.js Web App Development.pdf
The Positive and Negative Aspects of Node.js Web App Development.pdf
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed?
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with Microservices
 
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdf
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdfNestJS vs. Express The Ultimate Comparison of Node Frameworks.pdf
NestJS vs. Express The Ultimate Comparison of Node Frameworks.pdf
 
Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017Azure Modern Cloud App Development Approaches 2017
Azure Modern Cloud App Development Approaches 2017
 
Best Spring Boot & MicroServices Classroom & Online Training Naresh-IT
Best Spring Boot & MicroServices Classroom & Online Training Naresh-ITBest Spring Boot & MicroServices Classroom & Online Training Naresh-IT
Best Spring Boot & MicroServices Classroom & Online Training Naresh-IT
 
Think Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To MicroservicesThink Small To Go Big - Introduction To Microservices
Think Small To Go Big - Introduction To Microservices
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2

  • 1.  Monolithic Architecture and its Pros n Cons  Microservice Architecture and its Pros n Cons  Service Discovery  Feature of Node.Js 10  HTTP2 and its feature  N-API  Building Rest API in Node.JS  Securing Rest API in Node.JS Index
  • 2. Monolithic Architecture A monolithic architecture means that your app is written as one single unit of code whose components are designed to work together, sharing the same memory space and resources. Ex: JAR , WAR File which deployed as a single unit on application server A microservice architecture means that your app is made up of lots of smaller, independent services capable of running in their own memory space and scaling independently from each other 1. Monolithic means composed all in one piece 2. In monolithic architecture, components of the program are interconnected and interdependent rather than loosely coupled 3. If any program component must be updated, the whole application has to be rewritten 4. Not Modular : its a software application which is designed without modularity 5. Single-tiered software application
  • 3. Disadvantages of Monolithic Arc.  1.Difficult to scale: scaling the app reqires running multiple copies of entire app.  2. Long build/ test / release cycle  3. New releas takes months  4. Long time to add new feature  5. Lack of agility: Changes made to program can not be done very rapidly  6. Adding new feature is complex as code grows  7. Small change made to a part of app requires entire app to be rebuild and redeployed.  8. If a single component fails, it can cause the entire application to fail which is unreliable
  • 4. Disadvantages of Monolithic Arc. 9.Large and complex application: It becomes complex to understand and modify such app and as a result development slows down 10.Difficult to understand how to correctly implement a change 11.Slow development: As the app and team grows that app become difficult to understand and modify because its huge in size and multiple team working on it which makes developer less productive.
  • 5. Microservice Architecure  Microservice architecture, is an approach to application development in which a large application is made up of samller independent services  Microservices run each application process as a secvice  Communicate via well defined interface using lightweight API  Each service performs a single function  Because they are independently run, each service can be updated, deployed, and scaled to meet demand for specific functions of an application.
  • 6.  Advanteges:  1. Single Deployment Unit  Since entire application is packaged as a single unit, deployment process is relatively easy.  2.One Stop shop Codebase  navigating through the code base is easy Proc and Cons
  • 7. Advantages of Microservice  Agility – Changes in a particular micro service can be done very rapidly and can be deployed very quickly  Independent Development and Deployment  Reusable Code: Dividing software into small, well- defined modules enables teams to use functions for multiple purposes.  Maintainability: For each Service, a separate micro service is created. Thus business code in a micro service is very easy to understand.
  • 8. Advantages of Microservice  Scalability: Individual components can scale as per need, there is now no need to scale all components together  Availability: Even if one service fails, other micro services are highly available and the failed micro service can be rectified very quickly  Fault Tolerance: Even if one micro service has some faults with regards to say Database, thus there is a very clear boundary defined with regards to any fault. 
  • 9. Advantages of Microservice  Do one thing well: Each microservice performs only one task  Independent: (loosely coupled) components can be changed, upgraded, or replaced independently without affecting the functioning of other components.  Small and Focused: Each service performs a single business function  Language Nuetral: Different microservices written in different programming language as well as different framework.  Rapid Build/Test/Realease cycle
  • 10. Disadvantages of Microservice  Distributed Systems : Developing distributed systems can be complex  Increased Resource use - All the independently running components need their own runtime containers with more memory and CPU.  Increase Network communication - Independently running components interact with each other over a network. Such systems require reliable and fast network connections  Developer tools/IDEs don’t provide explicit support for developing distributed applications.
  • 11. Disadvantage of Microservice  Testing a microservices-based application can be large. each dependent service needs to be confirmed before you can start testing  Deploying microservices can be complex. They may need coordination among multiple services. Continuous deployment is difficult  Migration: The migration process from a monolithic architecture to a microservices architecture requires you to determine the right boundaries for microservices
  • 12. Disadvantage of Microservice  Developers must implement the inter-process communication mechanism.  Increased memory consumption  Versions: Versioning for microservices can be challenging  Multiple databases and transaction management can be painful.
  • 13. Q.How do we keep a track of all the microservices?  Suppose we have a four different functions and they might be running on four different servers.  By using SERVICE DISCOVERY TOOL we can communicate with microservices.  Service discovery tools are a key value stores.  If one microservice fails then it does not affects other microservice.
  • 14. Q.How do we keep a track of all the microservices?  These different microservices are in the separate container and ready to join application and before they work together they need to find one another. they do this by using service discovery which creates roadmap for this and many other microservices to communicate.  When microservice found each other they communicate through API.
  • 15. Features of Node.js 10  N-API (Node.js API)  HTTP/2  openSSL 1.1.1  JavaScript language improvements  Error-handling improvements  Performance boosts via V8, including for the async generator and array.  NPM v6  Better support of ES 6 modules
  • 16. Features of Node.js 10  fs/promises API  fs/promises API gives us a set of alternative asynchronous file system methods that return a Promise object instead of using callbacks. We can access this API through require('fs/promises')
  • 17. N-API  Called as Next generation Node.js APIs for native modules  Used for building native Addons  It is independent from the underlying JavaScript runtime (ex V8) and is maintained as part of Node.js itself  With N-API, native module developers can compile their module once per platform and architecture, and make it available for any version of Node.js that implements N-API. This holds true even for versions of Node.js that are built with a different VM, e.g. Node-ChakraCore.
  • 18. N-API  N-API enables different modules to work across differnent version and flavours of node.js without recompilation.  ChakraCore is a JavaScript engine developed by Microsoft for its Microsoft Edge web browser  Chrome V8, is an open-source JavaScript engine developed by for Google Chrome web browsers.
  • 19. Features of HTTP/2  Multiplexing : multiple req/res transaction occurs over a single connection  Multiplexing the streams means that packages from many streams are mixed over the same connection.  Single Connection :It has single connection with multiple streams  Prioritization  Header Compression: H2 forces all HTTP headers to be sent in a compressed format.
  • 20. Features of HTTP/2  HPACK compression: Allows to compress http headers  Server Push: Uses SERVER PUSH by which necessary files like style.css, script.js will get stored in cache  Servers can push web assets (CSS, JS, images) before a browser knows it needs them which speeds up page load times by reducing number of requests.  error in individual req/res transaction do not cause socket connection to be destroyed
  • 21. Features Of HTTP/2  Stream priority: Allows browsers to specify priority of assets. For example, browser can request HTML first to render it before any styles or JavaScript.  HTTP/2 Is Binary, Instead of Textual  Intelligent packet streaming management: This results in reduced latency and accelerates content download on modern web pages.
  • 22. Building APIs in Node.js  Prefer using HTTP error codes:There are 75 status codes and in most cases you can find a suitable one  Versioning: Any change made that is not backward compatible, obviously will brake client applications.  APIs should built over HTTPS
  • 23. Building APIs in Node.js  1. Use HTTP Methods & API Routes: POST, PUT, GET, DELETE,PATCH . API routes should always use nouns as resource identifiers. 2. Use HTTP Status Codes Correctly: 200, if everything was okay, 300, if the resource was moved, 500, if something went wrong on the API side 3. Pick the right framework for your Node.js REST API: Express, Koa or Hapi, Restify
  • 24. Building APIs in Node.js Express, Koa or Hapi :used to create browser applications, and as such, they support templating and rendering Restify: Used to build build REST services 4. Black-Box Test your Node.js REST APIs : Black-box testing is a method of testing where the functionality of an application is examined without the knowledge of its internal structures or workings. One of the modules that can help you with black-box testing Node.js REST APIs is supertest.
  • 25. Building APIs in Node.js 5. Embrace Rate Limiting: Rate limiting is used to control how many requests a given consumer can send to the API. 6. Create a Proper API Documentation: This is the only one way you can describe it to clients or other developers.
  • 26. Secure REST API in Node.js 1. Cookie-based authentication: Server creates active session in DB and place cookie with session ID. Browser request protected resourse with cookie and server verifies session ID against DB , if valid it proceed. 2. Token Based Authentication: a) JWT-Based, Stateless Authentication: Stateless means server does not store any state about the client session on the server side. session state handled entirely by the client. It cosnsist of three parts: Header , Payload, Signature