- TypeScript Microservices
- Parth Ghiya
- 203字
- 2021-06-25 21:48:49
Benefits
The reactive approach has lots of advantages and it overcomes lots of traditional problems:
- Parallel or asynchronous execution gives faster end to end processing. Asynchronous processing essentially won't prevent resource blocking while serving a request.
- Having a centralized event stream or a dumb communication pipe as a mode of communication has the advantage of easily adding or removing any service at any point in time.
- Control of the system is distributed. There is no longer a single point of failure in the system as the orchestrator.
- When this approach is clubbed with several other approaches, then various benefits can be achieved.
- When this approach is clubbed with event sourcing, all the events are stored and it enables event replay. So even if some service is down, the event store can still replay that event when the service is online again and the service can check up on updates.
- Another advantage is Command Query Responsibility Segregation (CQRS). As seen in Chapter 1, Debunking Microservices, we can apply this pattern to separate out the read and write activities. Hence, any of the services can be scaled out independently. This is extremely helpful in situations where applications are either read or write heavy.