What is a microservice architecture? 10 must-know knowledge points!

Preface

With the gradual maturity of the distributed technology stack, in recent years, more and more systems and fields have been designed with microservice architecture in the industry, including finance, e-commerce, live broadcast, logistics, marketing, procurement, manufacturing, etc., both in the Internet field and traditional field.
Recently, it is the best time to find a job. I have collected some interview questions from major manufacturers and the latest data this year (2020). The following are some screenshots of the data (all data have been integrated into documents, and pdf compressed and packaged) .
If you have a friend in need, you can click here to get information, code: qf
Insert picture description here

Theme

How can we eliminate indeterminism in testing?

Non-deterministic testing (NDT) is basically an unreliable test. So, sometimes it may happen that they pass, obviously sometimes they may also fail. When they fail, they will re-run and pass.

Some ways to remove non-determinism from testing are as follows:

1. Isolation

2. Asynchronous

3. Remote service

4. Isolation

5. Time

6. Resource leakage

What is the difference between Mock or Stub?

stub

· A virtual object useful for running tests.

· Provide fixed behavior under certain conditions that can be hard-coded.

· Never test any other behavior of the stub.

For example, for an empty stack, you can create a stub that only returns true for the empty() method. Therefore, it doesn't care whether there are elements in the stack.

fling in teeth

· A virtual object in which certain properties are initially set.

· The behavior of this object depends on the set attribute.

· You can also test the behavior of the object.

For example, for the Customer object, you can simulate it by setting the name and age. You can set age to 12, and then test the isAdult() method, which will return true when the age is greater than 18. Therefore, your Mock Customer object is suitable for the specified conditions.

How much do you know about Mike Cohn's test pyramid?

Mike Cohn provided a model called Test Pyramid. This describes the type of automated testing required for software development.

Insert picture description here

                                 Mike Cohn 的测试金字塔 – 微服务面试问题

According to the pyramid, the number of tests on the first layer should be the highest. At the service layer, the number of tests should be less than the unit test level, but should be greater than the end-to-end level.

What is the purpose of Docker?

Docker provides a container environment that can be used to host any application. Here, the software application and the dependencies that support it are tightly packaged together.

Therefore, this packaged product is called Container, because it is done by Docker, so it is called Docker container!

What is canary release?

Canary Releasing is a technology that reduces the risk of introducing new software versions into production. This is done by slowly rolling out the change to a small group of users, then publishing it to the entire infrastructure, and making it available to everyone.

What is continuous integration (CI)?

Continuous integration (CI) is the process of automatically building and testing code every time a team member submits a version control change. This encourages developers to share code and unit tests by merging changes into a shared version control repository after each small task is completed.

What is continuous monitoring?

Continuous monitoring and in-depth monitoring of coverage, from front-end performance indicators in the browser, to application performance, to host virtualization infrastructure indicators.

What is the role of the architect in the microservice architecture?

The architect in the microservice architecture plays the following roles:

· Decide the layout of the entire software system.

· Help determine the partitioning of components. Therefore, they ensure that the components are glued to each other, but not tightly coupled.

· Co-write code with developers to understand the challenges faced in daily life.

· Provide suggestions on certain tools and techniques for teams developing microservices.

· Provide technology governance so that the technology development team follows the principles of microservices.

Can we create state machines with microservices?

We know that each microservice with its own database is an independently deployable program unit, which in turn allows us to create a state machine. Therefore, we can specify different states and events for specific microservices.

For example, we can define the Order microservice. Orders can have different statuses. The transition of the Order state can be an independent event in the Order microservice.

What is reactive extension in microservices?

Reactive Extensions is also called Rx. This is a design method in which we collect results by calling multiple services and then compile the combined response. These calls can be synchronous or asynchronous, blocking or non-blocking. Rx is a very popular tool in distributed systems, contrary to traditional processes.

2020, I wish you all the best!

Insert picture description here

Guess you like

Origin blog.csdn.net/w1103576/article/details/108599597