Home » Microservices

Microservices

Last Updated on July 9, 2023 by KnownSense

41. What is the role of web and RESTful APIs in Microservices?
A microservice architecture is based on a concept wherein all its services should be able to interact with each other to build a business functionality. So, to achieve this, each microservice must have an interface. This makes the web API a very important enabler of microservices. Being based on the open networking principles of the Web, RESTful APIs provide the most logical model for building interfaces between the various components of a microservice architecture.

RESTful APIs

42. What do you understand by Semantic monitoring in Microservices architecture?
Semantic monitoring, also known as synthetic monitoring combines automated tests with monitoring the application in order to detect business failing factors.

43. How can we perform Cross-Functional testing?
Cross-functional testing is a verification of non-functional requirements, i.e. those requirements which cannot be implemented like a normal feature.

44. How can we eradicate non-determinism in tests?
Non-Deterministic Tests (NDT)  are basically unreliable tests.  So, sometimes it may happen that they pass and obviously sometimes they may also fail. As and when they fail, they are made to re-run to pass.
Some ways to remove non-determinism from tests are as follows:

  1. Quarantine
  2. Asynchronous
  3. Remote Services
  4. Isolation
  5. Time
  6. Resource leaks

45. What is the difference between Mock or Stub?
Stub

  • A dummy object that helps in running the test.
  • Provides fixed behavior under certain conditions which can be hard-coded.
  • Any other behavior of the stub is never tested.

For example, for an empty stack, you can create a stub that just returns true for empty() method. So, this does not care whether there is an element in the stack or not.
Mock

  • A dummy object in which certain properties are set initially.
  • The behavior of this object depends on the set properties.
  • The object’s behavior can also be tested.

For example, for a Customer object, you can mock it by setting name and age. You can set age as 12 and then test for isAdult() method that will return true for age greater than 18. So, your Mock Customer object works for the specified condition.

46. What is the purpose of Docker in Microservices?
Docker provides a container environment that can be used to host any application. In this, the software application and the dependencies which support it are tightly-packaged together.
So, this packaged product is called a Container and since it is done by Docker, it is called Docker container!

47. What is Canary Releasing?
Canary Releasing is a technique to reduce the risk of introducing a new software version in production. This is done by slowly rolling out the change to a small subset of users before giving it out to the entire infrastructure, i.e. making it available to everybody.

48. What do you mean by Continuous Integration (CI)?
Continuous Integration (CI) is the process of automating the build and testing of code every time a team member commits changes to version control. This encourages developers to share code and unit tests by merging the changes into a shared version control repository after every small task completion.

49. What is Continuous Monitoring?
Continuous monitoring gets into the depth of monitoring coverage, from in-browser front-end performance metrics, through application performance, and down to host virtualized infrastructure metrics.

50. Can we create a State machines out of Microservices?
As we know that each Microservice owning its own database is an independently deployable program unit, this, in turn, lets us create a State Machine out of it. So, we can specify different states and events for a particular microservice.
For Example, we can define an Order microservice. An Order can have different states. The transitions of Order states can be independent events in the Order microservice.

51. What are Reactive Extensions in Microservices?
Reactive Extensions also are known as Rx. It is a design approach in which we collect results by calling multiple services and then compile a combined response. These calls can be synchronous or asynchronous, blocking or non-blocking. Rx is a very popular tool in distributed systems which works opposite to legacy flows.


Authored by codingknownsense.com

Scroll to Top