Book Image

TypeScript Microservices

Book Image

TypeScript Microservices

Overview of this book

In the last few years or so, microservices have achieved the rock star status and right now are one of the most tangible solutions in enterprises to make quick, effective, and scalable applications. The apparent rise of Typescript and long evolution from ES5 to ES6 has seen lots of big companies move to ES6 stack. If you want to learn how to leverage the power of microservices to build robust architecture using reactive programming and Typescript in Node.js, then this book is for you. Typescript Microservices is an end-to-end guide that shows you the implementation of microservices from scratch; right from starting the project to hardening and securing your services. We will begin with a brief introduction to microservices before learning to break your monolith applications into microservices. From here, you will learn reactive programming patterns and how to build APIs for microservices. The next set of topics will take you through the microservice architecture with TypeScript and communication between services. Further, you will learn to test and deploy your TypeScript microservices using the latest tools and implement continuous integration. Finally, you will learn to secure and harden your microservice. By the end of the book, you will be able to build production-ready, scalable, and maintainable microservices using Node.js and Typescript.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

When to react and when not to react (orchestrate)


Now, we are at a stage where we are well acquainted with the core concepts of microservices. The next question that we often interact with is regarding the implementation of microservices, and how they will interact with each other. The most common question is when to use orchestration, when to react, and is it possible to use a hybrid approach. In this section, we will understand each of the approaches, its pros and cons, and look at practical examples for the use of each approach. Let's start with orchestration.

Orchestration

Orchestration is more of a Service Oriented Architecture (SOA) approach where we handle interaction between various services in an SOA. When we say orchestration, we maintain one controller that is the orchestrator or the main coordinator of all the service interactions. This typically follows more of a request/response-type pattern where a mode of communication can be anything. For example, we can have one orchestrator...