My Account Log in

1 option

TypeScript microservices : build, deploy, and secure microservices using TypeScript combined with Node.js / Parth Ghiya.

Ebook Central Academic Complete Available online

View online
Format:
Book
Author/Creator:
Ghiya, Parth, author.
Language:
English
Subjects (All):
TypeScript (Computer program language).
Physical Description:
1 online resource (399 pages)
Edition:
1st ed.
Place of Publication:
Birmingham ; Mumbai : Packt, 2018.
Biography/History:
Ghiya Parth: Parth Ghiya loves technologies and enjoys learning new things and facing the unknown. He has shown his expertise in multiple technologies, including mobile, web, and enterprise. He has been leading projects in all domains with regard to security, high-availability, and CI/CD. He has provided real-time data analysis, time series, and forecasting solutions too. In his leisure time, he is an avid traveler, reader, and an immense foodie. He believes in technological independence and is a mentor, trainer, and contributor.
Summary:
Microservices has evolved as one of the most tangible solutions to make effective and scalable applications. Due to its evolution from ES5 to ES6 stack, Typescript has become one of the most de facto solutions. This book will help you leverage microservices' power to build robust architecture using reactive programming and Typescript in Node.js.
Contents:
Cover
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Debunking Microservices
Debunking microservices
Rise of microservices
Wide selection of languages as per demand
Easy handling of ownership
Frequent deployments
Self-sustaining development units
What are microservices?
Principles and characteristics
No monolithic modules
Dumb communication pipes
Decentralization or self-governance
Service contracts and statelessness
Lightweight
Polyglot
Good parts of microservices
Self-dependent teams
Graceful degradation of services
Supports polyglot architecture and DevOps
Event-driven architecture
Bad and challenging parts of microservices
Organization and orchestration
Platform
Testing
Service discovery
Microservice example
Key considerations while adopting microservices
Service degradation
Proper change governance
Health checks, load balancing, and efficient gateway routing
Self-curing
Cache for failover
Retry until
Microservice FAQs
Twelve-factor application of microservices
Microservices in the current world
Netflix
Walmart
Spotify
Zalando
Microservice design aspects
Communication between microservices
Remote Procedure Invocation (RPI)
Messaging and message bus
Protobufs
Service registry for service-service communication
Server-side discovery
Client-side discovery
Registration patterns - self-registration
Data management
Database per service
Sharing concerns
Externalized configuration
Observability
Log aggregation
Distributed tracing
Microservice design patterns
Asynchronous messaging microservice design pattern
Backend for frontends
Gateway aggregation and offloading.
Proxy routing and throttling
Ambassador and sidecar pattern
Anti-corruption microservice design pattern
Bulkhead design pattern
Circuit breaker
Strangler pattern
Summary
Chapter 2: Gearing up for the Journey
Setting up primary environment
Visual Studio Code (VS Code)
PM2
NGINX
Docker
Primer to TypeScript
Understanding tsconfig.json
compilerOptions
include and exclude
extends
Understanding types
Installing types from DefinitelyTyped
Writing your own types
Using the dts-gen tool
Writing your own *.d.ts file
Debugging
Primer to Node.js
Event Loop
Understanding Event Loop
Node.js clusters and multithreading
Async/await
Retrying failed requests
Multiple requests in parallel
Streams
Writing your first Hello World microservice
Chapter 3: Exploring Reactive Programming
Introduction to reactive programming
Why should I consider adopting reactive programming?
Reactive Manifesto
Responsive systems
Resilient to errors
Elastic scalable
Message-driven
Major building blocks and concerns
Observable streams
Subscription
emit and map
Operator
Backpressure strategy
Currying functions
When to react and when not to react (orchestrate)
Orchestration
Benefits
Disadvantages
Reactive approach
React outside, orchestrate inside
Reactive coordinator to drive the flow
Synopsis
When a pure reactive approach is a perfect fit
When pure orchestration is a perfect fit
When react outside, orchestrate inside is a perfect fit
When introducing a reactive coordinator is the perfect fit
Being reactive in Node.js
Rx.js
Bacon.js
HighLand.js
Key takeaways
Chapter 4: Beginning Your Microservice Journey
Overview of shopping cart microservices.
Business process overview
Functional view
Deployment view
Architecture design of our system
Different microservices
Cache microservice
Service registry and discovery
Registrator
Logger
Gateway
Design aspects involved
Microservice efficiency model
Core functionalities
Supporting efficiencies
Infrastructure role
Governance
Implementation plan for shopping cart microservices
What to do when the scope is not clear
Schema design and database selection
How to segregate data between microservices
Postulate 1 - data ownership should be regulated via business capabilities
Postulate 2 - replicate the database for speed and robustness
How to choose a data store for your microservice
Design of product microservices
Microservice predevelopment aspects
HTTP code
1xx - informational
2xx - success
3xx - redirections
4xx - client errors
5xx - server errors
Why HTTP code is vital in microservices?
Auditing via logs
PM2 process manager
Tracing requests
Developing some microservices for a shopping cart
Itinerary
Development setup and prerequisite modules
Repository pattern
Configuring application properties
Custom health module
Dependency injection and inversion of control
Inversify
Typedi
TypeORM
Application directory configurations
src/data-layer
src/business-layer
src/service-layer
src/middleware
Configuration files
Processing data
Ready to serve (package.json and Docker)
package.json
Microservice design best practices
Setting up proper microservice scope
Self-governing functions
Polyglot architecture
Size of independent deployable component
Distributing and scaling services whenever required
Being Agile
Single business capability handler.
Adapting to shifting needs
Handling dependencies and coupling
Deciding the number of endpoints in a microservice
Communication styles between microservices
Specifying and testing the microservices contract
Number of microservices in a container
Data sources and rule engine among microservices
Chapter 5: Understanding API Gateway
Debunking API Gateway
Concerns API Gateway handles
Security
Dumb gateways
Transformation and orchestration
Monitoring, alerting, and high availability
Caching and error handling
Circuit breakers
Versioning and dependency resolution
API Gateway design patterns and aspects
Circuit breakers and its role
Need for gateway in our shopping cart microservices
Handle performance and scalability
Reactive programming to up the odds
Invoking services
Discovering services
Handling partial service failures
Design considerations
Available API Gateways options
HTTP proxy and Express Gateway
Zuul and Eureka
API Gateway versus reverse proxy NGINX
RabbitMQ
Designing our gateway for shopping cart microservices
What are we going to use?
Chapter 6: Service Registry and Discovery
Introduction to the service registry
What, why, and how of service registry and discovery
The why of service registry and discovery
How service registry and discovery?
Service registration
Service resolution
The what of service registry and discovery
Maintaining service registry
Timely health checks
Service discovery patterns
Client-side discovery pattern
Server-side discovery pattern
Service registry patterns
Self-registration pattern
Third-party registration pattern
Service registry and discovery options
Eureka
Setting up the Eureka server.
Registering with Eureka server
Discovering with Eureka server
Key points for Eureka
Consul
Setting up the Consul server
Talking with Consul server
Registering a service instance
Sending heartbeats and doing a health check
Deregistering an application
Subscribing to updates
Key points for Consul
Key points for Registrator
How to choose service registry and discovery
If you select Consul
If you select Eureka
Chapter 7: Service State and Interservice Communication
Core concepts - state, communication, and dependencies
Microservice state
Interservice communication
Commands
Queries
Events
Exchanging data formats
Text-based message formats
Binary message formats
Dependencies
Communication styles
NextGen communication styles
HTTP/2
gRPC with Apache Thrift
Versioning microservices and failure handling
Versioning 101
When a developer's nightmare comes true
Client resiliency patterns
Bulkhead and retry pattern
Client-side load balancing or queue-based load leveling pattern
Circuit breaker pattern
The fallback and compensating transaction pattern
Case Study - The NetFlix Stack
Part A - Zuul and Polyglot Environment
Part B - Zuul, Load balancing and failure resiliency
Message queues and brokers
Introduction to pub/sub pattern
Sharing dependencies
The problem and solution
Getting started with bit
The problem of shared data
Cache
Blessing and curse of caching
Introduction to Redis
Setting up our distributed caching using redis
Chapter 8: Testing, Debugging, and Documenting
What and how to test
The testing pyramid - what to test?
System tests
Service tests
Contract tests
Unit tests
Hands-on testing
Our libraries and test tool types
Chai.
Mocha.
Notes:
Description based on print version record.
ISBN:
9781788836852
1788836855
OCLC:
1039691603

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account