O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Queries 

Similar to commands, queries are used when one microservice needs some information from another microservice. For example, during invoice in our shopping cart microservice, we need information on the total number of reward points so as to give a promotional discount, so the invoice microservice queries the rewards points microservice. This is a synchronous mode of communication and is generally implemented using HTTP GET requests. Whenever a query fails, the caller does not get the data it needs. If the caller handles exceptions well enough then there is a minimal impact with some degraded functionality. If it does not handle errors well enough, the error propagates throughout the system.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required